Skip to content

When browser.viewport is set and with the webdriver backend, sometimes parts of the app are unreachable #8723

@julienw

Description

@julienw

Describe the bug

I got this issue in the context of Webdriver + Firefox, where a button was in the viewport but not visible. In that case the click on the button succeeded but no action really appeared.

I can see several issues:

  1. Chrome is launched fullscreen but Firefox is launched as a window, so the issue can happen much more easily in Firefox.
  2. With playwright the application is "zoomed out" so that the viewport fits in the available space, but in webdriver the zoom level is always 100% (both in Chrome and Firefox). I don't know if that's a issue with webdriver or vitest or vitest's configuration of webdriver.
  3. Part of the issue, I think, is also that vitest's interface can not be scrolled.
  4. In Chrome, when running the test after reducing the window size, I get an error but in Firefox there's no error making the issue silent -- This is probably rather a bug in Firefox and I'll report it there too (bug 1994715).

Reproduction

You can find a testcase in this repository: https://github.com/julienw/vitest-browser-mode-viewport-click
The main branch uses webdriver while the playwright branch uses playwright so that it's easy to compare.

System Info

System:
    OS: Linux 6.7 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11900H @ 2.50GHz
    Memory: 29.55 GB / 62.54 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 24.8.0 - /home/julien/.nvm/versions/node/v24.8.0/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 11.6.0 - /home/julien/.nvm/versions/node/v24.8.0/bin/npm
    pnpm: 10.9.0 - /home/julien/.local/share/pnpm/pnpm
    bun: 1.0.29 - /home/julien/.bun/bin/bun
    Deno: 2.0.0 - /home/julien/.cargo/bin/deno
    Watchman: 4.9.0 - /usr/bin/watchman
  Browsers:
    Chrome: 139.0.7258.127
    Chromium: 139.0.7258.127
    Firefox: 128.13.0esr
    Firefox Developer Edition: 128.13.0esr
  npmPackages:
    @vitest/browser: ^3.2.4 => 3.2.4 
    playwright: ^1.49.1 => 1.56.0 
    vite: ^7.1.10 => 7.1.10 
    vitest: ^3.2.4 => 3.2.4 
    webdriverio: ^9.20.0 => 9.20.0

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: browserIssues and PRs related to the browser runnerp3-minor-bugAn edge case that only affects very specific usage (priority)webdriverio

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions