Skip to content

Headless mode is not working for WebDriverIO #3930

@twinprime

Description

@twinprime

Describe the bug

The current code for setting the headless option for WebDriverIO is not working, i.e. the option is ignored and browser still opens:

      capabilities: {
        'browserName': this.browser,
        'wdio:devtoolsOptions': { headless: options.headless },
      },

Based on current WebDriverIO documentation, it is now dependent on the browser selected. For example, for Chrome, it should be

'goog:chromeOptions': {
    args: ['headless', 'disable-gpu']
}

I verified by modifying the code in the node_module/vitest/dist/vendor-node.caa511fc.js of my project and it works after the change.

Reproduction

None

System Info

System:
    OS: macOS 13.4.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 45.28 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.1 - /usr/local/opt/node@18/bin/node
    npm: 9.5.1 - /usr/local/opt/node@18/bin/npm
  Browsers:
    Chrome: 115.0.5790.170
    Edge: 115.0.1901.203
    Safari: 16.5.2
  npmPackages:
    @vitejs/plugin-react: ^4.0.1 => 4.0.3
    @vitest/browser: ^0.34.1 => 0.34.1
    @vitest/coverage-istanbul: ^0.34.1 => 0.34.1
    @vitest/ui: ^0.34.1 => 0.34.1
    vite: ^4.4.0 => 4.4.7
    vitest: ^0.34.1 => 0.34.1

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions