-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)webdriverio
Description
Describe the bug
It's common that locators can resolve to several elements. When calling element() on it, it errors accordingly, providing a useful feedback to the user.
However when using an interaction method instead, vitest doesn't error. This can be confusing to the developer, by interacting with an unexpected control.
Reproduction
See the testcase in https://github.com/julienw/vitest-multiple-results-issue
Run:
npm i
npm test
Notice that the second test fails. The test checks that .click() errors.
System Info
System:
OS: Linux 6.12 Debian GNU/Linux 13 (trixie) 13 (trixie)
CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11900H @ 2.50GHz
Memory: 37.99 GB / 62.53 GB
Container: Yes
Shell: 5.2.37 - /bin/bash
Binaries:
Node: 24.12.0 - /home/julien/.nvm/versions/node/v24.12.0/bin/node
Yarn: 1.22.22 - /usr/bin/yarn
npm: 11.6.2 - /home/julien/.nvm/versions/node/v24.12.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
Browsers:
Chrome: 144.0.7559.109
Chromium: 144.0.7559.96
Firefox: 140.7.0esr
Firefox Developer Edition: 140.7.0esr
npmPackages:
@vitejs/plugin-react: ^5.1.3 => 5.1.3
@vitest/browser: ^4.0.18 => 4.0.18
@vitest/browser-webdriverio: ^4.0.18 => 4.0.18
vite: ^7.3.1 => 7.3.1
vitest: ^4.0.18 => 4.0.18
vitest-browser-react: ^2.0.5 => 2.0.5Used 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)webdriverio
Type
Projects
Status
Approved