browser-webdriverio makes it impossible to set --enable-gpu when using headless Chrome (original) (raw)
Describe the bug
Right now enabling headless mode in Chrome also sets the --disable-gpu flag. There is no way to configure Chrome like this:
{ browser: 'chrome', headless: true, name: 'Chrome', provider: webdriverio({ capabilities: { 'goog:chromeOptions': { args: ['--enable-gpu'] } } }) }
Since the --disable-gpu will be added automatically when setting headless to true it will override the --enable-gpu flag.
It is of course possible to achieve the desired result when doing all the config via 'goog:chromeOptions'. The following works:
{ browser: 'chrome', name: 'Chrome', provider: webdriverio({ capabilities: { 'goog:chromeOptions': { args: ['--headless', '--enable-gpu'] } } }) }
However I think this is not really obvious without knowing the source code. I can't find it anymore but I believe using the --headless flag directly was also discouraged somewhere in the docs.
Do you remember why --disable-gpu was hard-coded in the first place? Maybe it's possible to just drop it.
Reproduction
As mentioned above configuring Chrome like this is impossible:
{ browser: 'chrome', headless: true, name: 'Chrome', provider: webdriverio({ capabilities: { 'goog:chromeOptions': { args: ['--enable-gpu'] } } }) }
It will not enable GPU rendering.
System Info
npmPackages: @vitest/browser-webdriverio: ^4.1.5 => 4.1.5 vitest: ^4.1.5 => 4.1.5
Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.