Skip to content

BUG: @vitest/browser-webdriverio fails with Safari when BiDi commands are used despite enforcing WebDriver Classic #9244

@mccmrunal

Description

@mccmrunal

Describe the bug

Original Report: webdriverio/webdriverio#14927
Reproduction Repo: https://github.com/chrisguttandin/vitest-webdriverio

Root Cause
The @vitest/browser-webdriverio package's setViewport method unconditionally uses a WebDriver BiDi command without checking if BiDi is actually available:

Why This Fails
Safari on GitHub Actions may not support WebDriver BiDi yet OR the BiDi session wasn't established
User sets 'wdio:enforceWebDriverClassic': true to explicitly disable BiDi
WebdriverIO respects this and doesn't create a BiDi session (no webSocketUrl in capabilities)
Vitest's provider ignores this and tries to use BiDi commands anyway
Result: Command fails because no BiDi session exists

we need to check BiDi availability before using BiDi commands, and fall back to WebDriver Classic commands when BiDi isn't available.

Reproduction

Original Report: webdriverio/webdriverio#14927
Reproduction Repo: https://github.com/chrisguttandin/vitest-webdriverio

System Info

Original Report: https://github.com/webdriverio/webdriverio/issues/14927
Reproduction Repo: https://github.com/chrisguttandin/vitest-webdriverio

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions