feat: Multi-remote number, size and object matchers and toBeElementsArrayOfSize - #2231
Merged
dprevost-LMI merged 8 commits intoSep 26, 2026
Conversation
…rrayOfSize Part 4/4 of the multi-remote support split from webdriverio#2172. - `toHaveWidth`, `toHaveHeight` and `toHaveChildren` support multi-remote elements, with one number or NumberMatcher for every instance or one per instance (`expect.multiRemote()` or plain object shorthand) - `toHaveSize`, `toHaveStyle` and `toHaveElementProperty` keep a plain object as a literal value: per-instance values require `expect.multiRemote()` - `toBeElementsArrayOfSize` counts the elements per instance, against a single size or one size per instance - A plain object passed as per-instance styles is a mismatch instead of a crash - Types, type tests, docs and multi-remote playground specs Fixes webdriverio#106 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dprevost-LMI
marked this pull request as ready for review
September 25, 2026 23:05
Calling through the context resolves the matcher overloads, so the tests are type-checked against the real signatures, and invalid inputs are flagged with @ts-expect-error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
…entsArrayOfSize Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e $$() in toBeElementsArrayOfSize An empty regular ElementArray, or an empty array in a regular (non multi-remote) session, now rejects per-instance sizes like a non-empty one, instead of passing against the instance names taken from the expected value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…i-remote instance names
An object such as { eq: 2, firefox: 3 } was read as NumberOptions, silently dropping the
other keys. It now throws, pointing to expect.multiRemote(), which is also required when
instances are named like an option key. featureFlags is added to the NumberOptions keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
@greptileai, can you review again thoroughly? |
dprevost-LMI
commented
Sep 26, 2026
dprevost-LMI
commented
Sep 26, 2026
…ber matchers A plain object is a legacy NumberOptions for toHaveWidth, toHaveHeight, toHaveChildren and toBeElementsArrayOfSize, so telling it apart from per-instance values relied on guessing from the key names (instance names colliding with option keys, mixed objects, missing keys). Per-instance numbers now require expect.multiRemote(), which is never ambiguous. The plain object shorthand is kept for the other matchers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… assertions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The diff of a multi-remote failure now shows `Multi-remote values {` instead of `Object {`
for the per-instance values, so they are not mistaken for an object expected value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 4/4 of the multi-remote support split from #2172.
toHaveWidth,toHaveHeightandtoHaveChildrensupport multi-remote elements, with one number or NumberMatcher for every instance or one per instance (expect.multiRemote()or plain object shorthand)toHaveSize,toHaveStyleandtoHaveElementPropertykeep a plain object as a literal value: per-instance values requireexpect.multiRemote()toBeElementsArrayOfSizecounts the elements per instance, against a single size or one size per instanceFixes #106
Fixes #1966