Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headless mode is not working for WebDriverIO #3930

Closed
6 tasks done
twinprime opened this issue Aug 11, 2023 · 1 comment · Fixed by #4364
Closed
6 tasks done

Headless mode is not working for WebDriverIO #3930

twinprime opened this issue Aug 11, 2023 · 1 comment · Fixed by #4364
Labels
feat: browser Issues and PRs related to the browser runner pr welcome

Comments

@twinprime
Copy link

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

@sheremet-va sheremet-va added bug feat: browser Issues and PRs related to the browser runner and removed pending triage labels Aug 11, 2023
@lsim
Copy link

lsim commented Aug 14, 2023

My CI is failing with the same issue - webdriverio now attempts to start graphical chrome in a headless environment.

Perhaps webdriverio should have bumped a major with a breaking change like that?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: browser Issues and PRs related to the browser runner pr welcome
Projects
None yet
3 participants