dequelabs / axe-core-npm

Mozilla Public License 2.0
577 stars 65 forks source link

Error: TypeError: (intermediate value).headless is not a function #991

Closed andreas-pa closed 6 months ago

andreas-pa commented 6 months ago

Product

cli

Product Version

4.8.3

Latest Version

Issue Description

Expectation

Run axe command normally.

For example axe https://www.deque.com

Actual

It returns errors :

Running axe-core 4.8.3 in chrome-headless
Error: TypeError: (intermediate value).headless is not a function
    at /Users/.nvm/versions/node/v18.18.2/lib/node_modules/@axe-core/cli/dist/src/lib/webdriver.js:27:54
    at Generator.next (<anonymous>)
    at /Users/.nvm/versions/node/v18.18.2/lib/node_modules/@axe-core/cli/dist/src/lib/webdriver.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/.nvm/versions/node/v18.18.2/lib/node_modules/@axe-core/cli/dist/src/lib/webdriver.js:4:12)
    at startDriver (/Users/.nvm/versions/node/v18.18.2/lib/node_modules/@axe-core/cli/dist/src/lib/webdriver.js:20:33)
    at /Users/.nvm/versions/node/v18.18.2/lib/node_modules/@axe-core/cli/dist/src/bin/index.js:46:47
    at Generator.next (<anonymous>)
    at /Users/.nvm/versions/node/v18.18.2/lib/node_modules/@axe-core/cli/dist/src/bin/index.js:8:71
    at new Promise (<anonymous>)
Please report the problem to: https://github.com/dequelabs/axe-core-npm/issues/

How to Reproduce

Installed Versions :

Chrome : 120.0.6099.234 Chromedriver : 120.0.6099.109 npm : 9.8.1 node : 18.18.2 Mac OS : Sonoma

Also the output of npm list -g axe-core is

npm WARN config dev Please use --include=dev instead.
/Users/.nvm/versions/node/v18.18.2/lib
└─┬ @axe-core/cli@4.8.3
  ├─┬ @axe-core/webdriverjs@4.8.3
  │ └── axe-core@4.8.3 deduped
  └── axe-core@4.8.3

Additional context

If i install the deprecated npm install -g axe-cli which is installing :

npm WARN config dev Please use --include=dev instead.
/Users/.nvm/versions/node/v18.18.2/lib
└─┬ axe-cli@3.2.1
  ├── axe-core@3.5.6
  └─┬ axe-webdriverjs@2.3.0
    └── axe-core@3.5.6 deduped

Everything is working as expected when I am running axe https://www.deque.com

Last but not least, I played with different combination of node ( latest node version for example ) and chrome/chromedriver and still I am can see this issue.

straker commented 6 months ago

Thanks for the issue. I can replicate the issue. We'll try to get out a fix as quick as we can.

straker commented 6 months ago

Found the issue. Selenium-webdriver@4.17.0 released with a breaking change 10 hours ago which is causing the issue. So anyone who installs after their release will encounter this bug until we can get a new release of @axe-core/cli with a fix (which should happen later today).

padmavemulapati commented 4 months ago

Verified the issue during the 4.8.5 release, after fix available for selenium-webdriver@4.17.0 issue not seeing and working as expected.

Command run:

axe https://www.deque.com

Getting results:

MacBook-Pro:plaaywrightCore dq_user$ axe www.google.com
Running axe-core 4.8.4 in chrome-headless

Testing http://www.google.com ... please wait, this may take a minute.

  Violation of "aria-allowed-attr" with 1 occurrences!
    Ensures an element's role supports its ARIA attributes. Correct invalid elements at:
     - iframe
    For details, see: https://dequeuniversity.com/rules/axe/4.8/aria-allowed-attr

  Violation of "aria-allowed-role" with 1 occurrences!
    Ensures role attribute has an appropriate value for the element. Correct invalid elements at:
     - #APjFqb
    For details, see: https://dequeuniversity.com/rules/axe/4.8/aria-allowed-role

  Violation of "aria-valid-attr-value" with 1 occurrences!
    Ensures all ARIA attributes have valid values. Correct invalid elements at:
     - .ayzqOc
    For details, see: https://dequeuniversity.com/rules/axe/4.8/aria-valid-attr-value

  Violation of "frame-title" with 1 occurrences!
    Ensures <iframe> and <frame> elements have an accessible name. Correct invalid elements at:
     - iframe
    For details, see: https://dequeuniversity.com/rules/axe/4.8/frame-title

  Violation of "presentation-role-conflict" with 1 occurrences!
    Elements marked as presentational should not have global ARIA or tabindex to ensure all screen readers ignore them. Correct invalid elements at:
     - iframe
    For details, see: https://dequeuniversity.com/rules/axe/4.8/presentation-role-conflict

  Violation of "region" with 2 occurrences!
    Ensures all page content is contained by landmarks. Correct invalid elements at:
     - picture
     - #SIvCob
    For details, see: https://dequeuniversity.com/rules/axe/4.8/region

7 Accessibility issues detected.
Testing complete of 1 pages

Please note that only 20% to 50% of all accessibility issues can automatically be detected. 
Manual testing is always required. For more information see:
https://dequeuniversity.com/curriculum/courses/testingmethods

https://github.com/dequelabs/axe-core-npm/assets/47409579/8bce4c72-5aa6-4dca-9db0-c507a9ca1819

Environment:

Label Value
Product axe-core-npm/cli
Version 4.8.5
OS-Details MAC- Intel Core i7 - 11.6.8 && Windows 11
BrowserDetails Chrome Version 122.0.6261.112 && Firefox 123.0.1