Open robfentress opened 4 years ago
Thanks for the issue. We'll look into it.
Interestingly, it appears to work when you are running the command from the actual repository. So, if I clone axe-cli and run node index.js --chrome-options="no-sandbox,disable-setuid-sandbox,disable-dev-shm-usage" www.deque.com
, then it works. However, if I install axe-cli as a global package using npm install -g axe-cli
and try to run axe --chrome-options="no-sandbox,disable-setuid-sandbox,disable-dev-shm-usage" www.deque.com
it throws that WebDriverError.
After some investigation, I think the issue seems to be that lib/webdriver.js is different in the GitHub repository than in the package you install with node. In the node package, on line 23 it has the following:
args.push(config.chromeOptions);
In the version in the GitHub repository, on line 23 it instead has the following:
args.push(...config.chromeOptions);
Basically, the node package version isn't using the spread operator. Without it, an array is added to the arg, rather than a string, which is what chromedriver is expecting.
I don't know how this works, but can you push this change to npm?
Attempting to use you example of how to use the --chrome-options flag results in a WebDriverError. Here is the command and the output: