dequelabs / axe-cli

[Deprecated] A command-line interface for the aXe accessibility testing engine
Mozilla Public License 2.0
430 stars 35 forks source link

Allow inclusion of user selected webdriver arguments #65

Closed wagoodman closed 5 years ago

wagoodman commented 6 years ago

Currently there isn't a way to pass webdriver arguments to augment capabilities. To change these capabilities you have to edit this line https://github.com/dequelabs/axe-cli/blob/develop/lib/webdriver.js#L23 to include the arguments (which requires opening the source code for axe-cli, which is not desirable).

For example, if I wanted to use the --no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage switches on the chromewebdriver I have to open up webdriver.js and add the capabilities manually:

 const chromeCapabilities = Capabilities.chrome();
 chromeCapabilities.set('chromeOptions', {
      'args': ['--headless',
              "--no-sandbox",
                  "--disable-setuid-sandbox",
                  "--disable-dev-shm-usage"]
    })

I've found it necessary to add/remove capabilities when running axe-cli in a containerized environment.

One possible way to pass these flags on to the webdriver is axe-cli <the-url> --webdriver-args "--no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage" and let axe-cli split the string accordingly and pass this to the driver. I'm sure there is another [better] way to express these arguments.