Skip to content

refactor!: remove the multi-remote WebdriverIO v9 fallbacks - #2265

Merged
dprevost-LMI merged 3 commits into
webdriverio:mainfrom
dprevost-LMI:v8/remove-multi-remote-fallbacks
Oct 6, 2026
Merged

dprevost-LMI merged 3 commits into
webdriverio:mainfrom
dprevost-LMI:v8/remove-multi-remote-fallbacks

Conversation

@dprevost-LMI

Copy link
Copy Markdown
Collaborator

Proposed changes

  • WebdriverIO v10 always returns a MultiRemoteElementArray from multi-remote $$() and sets only isMultiRemote: the refetch from the global multiRemoteBrowser, the empty plain-array cases and the isMultiremote check go. WDIO_ENABLE_MULTI_REMOTE_ELEMENT_ARRAY and WDIO_ENABLE_MULTI_REMOTE_SELECT are removed from docs.
  • Unit test mocks model the v10 runtime: no flag on/off duality, no browser.<instanceName>, v10 error text.
  • Browser getInstance() keeps its !: on the v10 branch it still returns Browser | undefined (fix: MultiRemote getInstance now throws instead of returning undefined webdriverio#15704 landed on main only). Element getInstance() throws, so || undefined goes.

Draft: merge only after the expect-webdriverio pre-release works in WebdriverIO v10, since this drops v9 support.

Not in this PR:

Refs #2255

How you tested

  • Unit tests: npx vitest --run --coverage.enabled=false: 2596 passed. The flag on/off runs are gone with the flag.
  • npx tsc --noEmit -p ., npm run test:types, npx eslint src test, multi-remote naming check, git grep WDIO_ENABLE_MULTI_REMOTE (no match)
  • Playground run: playgrounds/multi-remote-mocha against WebdriverIO v10, not on npm yet

🤖 Generated with Claude Code

@dprevost-LMI
dprevost-LMI force-pushed the v8/remove-multi-remote-fallbacks branch 2 times, most recently from d17e416 to f445214 Compare September 28, 2026 03:03
WebdriverIO v10 sets only `isMultiRemote`, and its `getInstance()` throws
for an unknown name and is typed `WebdriverIO.Browser`. So
`hasMultiRemoteFlag()` stops reading the v9 `isMultiremote`, and the
`!` and `|| undefined` after `getInstance()` go.

The unit test mocks now model WebdriverIO 10.0.0: instances are only
reachable with `getInstance()` (not as `browser.chrome` properties), an
unknown name throws the v10 error, and `select()` throws when no name is
valid.

BREAKING CHANGE: the v9 `isMultiremote` flag is no longer read.

Refs webdriverio#2255

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dprevost-LMI
dprevost-LMI force-pushed the v8/remove-multi-remote-fallbacks branch from f445214 to 3a277e6 Compare October 6, 2026 00:09
`hasMultiRemoteFlag()` read two flag names to support WebdriverIO v9 and
v10. It now reads only `isMultiRemote`, so the type guard is not needed:
optional chaining gives the same result for `null`, `undefined` and
primitives. The function stays, to keep in one place why the flag is
read without `in` (the `@wdio/globals` Proxy has only a `get` trap).

Refs webdriverio#2255

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dprevost-LMI
dprevost-LMI marked this pull request as ready for review October 6, 2026 00:13
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Removes WebdriverIO v9 compatibility from multi-remote handling.

No outstanding code issue was established; the planned v10 playground run is still needed before merging.

Summary

This PR removes v9 multi-remote fallbacks and updates the test mocks for v10.

  • The latest changes wait for the page to settle before visual snapshots and adjust image comparison for Firefox.
  • The playground run against WebdriverIO v10 remains unchecked.

Reviews (2) · Last reviewed commit: "test: take the multi-remote visual snaps..."

Comment thread test/__mocks__/@wdio/globals.ts
The test page changes 2 seconds after it loads: for example, it sets
`#selectbox` from 2 to 3. On CI, the first visual test is slow, so its
baseline showed 3, and the next test compared a screenshot that showed
2 (Firefox, 0.001% on Linux, 0.002% on Windows). The tests now wait for
`.lateElem`, which the same timer adds. A pause of 2.5 seconds in the
first test reproduces the failure locally, and the wait fixes it.

On Windows, Firefox also drew some text edges differently between two
page loads (39 pixels in the CI images), so the comparison ignores
anti-aliasing. The two tests where one browser differs still fail as
expected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dprevost-LMI
dprevost-LMI merged commit 5af6353 into webdriverio:main Oct 6, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants