Description
Product: CLI
Expectation: any options added to the --chrome-options
argument should be passed down to the ChromeDriver
Actual: options that require a comma on its value (like window-size=1920,1080
) causes ChromeDriver to fail initializing
Motivation: sometimes users might want to specify the window size to run tests on specific viewports
axe-core version: 4.4.1
@axe-core/cli: 4.4.3 (on fcfa36c2)
- Node version: v14.19.0
- Platform: Linux
This happens because the CLI is using a comma or a semicolon to split different options:
axe-core-npm/packages/cli/src/lib/utils.ts
Lines 112 to 114 in fcfa37c
This way, options which require a comma on its value are passed down as two options instead of one: window-size=1920
and 1080
(note both arg:
logs on the console)
If I change the RegExp to /[;]/
instead, everything works fine:
However, this would introduce a breaking change, so I'm unsure how to proceed. To be more generic and avoid future problems, we could add a --delimiter-character
argument and use that to split lists on the CLI (and have /[,;]/
as a fallback). Or we could have a --chrome-options-delimiter-character
argument, only changing the split behavior regarding the --chrome-options
argument.
I'm happy to open a PR if we're able to agree on how to solve this.