Multi-remote snapshot throws an internal error when one instance has no element
I maintainer di solito rispondono entro 1 giorno
@theluckystrike ci sta già lavorando.
Dal 8/10/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- testing-qa
Direzione di ricerca
Inizia da src/matchers/snapshot.ts, in particolare da getMultiRemoteOuterHTML, e confronta il suo comportamento con getElementsPerInstance e getInstanceOrUndefined in src/util/multiRemoteUtils.ts. Aggiungi la copertura di unit test richiesta per gli elementi $() multi-remote mancanti in un'istanza, in toMatchSnapshot e toMatchInlineSnapshot; il lavoro è completo quando entrambi producono un errore del matcher che indica l'istanza mancante, senza registrare uno snapshot.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
toMatchSnapshot and toMatchInlineSnapshot throw an internal WebdriverIO error when a multi-remote element ($()) has no element on one instance. The other matchers give a correct matcher failure for the same subject.
Example: browserA and browserC find 3 header a links, and browserB finds 2. Then links[2] has no element on browserB.
const links = multiRemoteBrowser.$$('header a')
await expect(links[2]).toMatchInlineSnapshot('"x"')
// Error: Multi-remote object has no instance named "browserB"
Matcher on links[2] |
Result |
|---|---|
toHaveText('1') |
Matcher failure: "browserB": undefined |
toExist() |
Matcher failure: "browserB": "not exist" |
.not.toExist() |
Matcher failure: browserA and browserC "exist" |
toMatchInlineSnapshot('"x"') |
Error: Multi-remote object has no instance named "browserB" |
Seen in an e2e run with WebdriverIO v10 (webdriverio/webdriverio#15846) and expect-webdriverio 8.0.0-alpha.2, in Chrome and Firefox.
Cause
getMultiRemoteOuterHTML calls getInstance(instance) for a single multi-remote element, and does not catch the error (line 104). getInstance() throws when the instance has no element.
The $$() path does not have this problem: it uses getElementsPerInstance, which catches the error with getInstanceOrUndefined.
Versions
main(8.0.0-alpha.2, e53a374d) with WebdriverIOv10: seen in an e2e run.v7.0.1with WebdriverIOv9: the same code is ingetMultiRemoteOuterHTML, and the v9getInstance()also throws (Multiremote object has no instance named). The v9$$()givesundefinedfor an instance with fewer elements. I found this in the code, but I did not run it.
Proposal
Get the element of each instance with getInstanceOrUndefined. For an instance without an element, fail the assertion with a matcher message that names the instance, as toExist() does. Do not write a snapshot in this case, because the first run would then record a missing element as the expected value.
Add a unit test for a multi-remote $() that has no element on one instance, for toMatchSnapshot and toMatchInlineSnapshot.
When this is released, the multi-remote expect e2e spec of WebdriverIO v10 can cover this case.
- Lingua principale
- TypeScript
- Stelle
- 86
- Fork
- 67
- Merge medio
- 9h 57m
- PR unite (30g)
- 27
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di webdriverio/expect-webdriverio
-
[v8] Do not re-fetch the result of `$$().filter()`: false pass, and the user's array is changedForse di nuovo libera @plum117 l’ha presa 48 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
webdriverio/expect-webdriverio#2301 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di webdriverio/expect-webdriverio
Issue simili
-
Postgres upgrade golden leaves fixture URL query parameters in the expected output comparisonAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
garrytan/gbrain#10437 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Bedrock "Too many tokens" throttle is not auto-retried, unlike "Too many requests"Forse già presa @acmerfight l’ha presa oggi. Apertauntriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
earendil-works/pi#12573 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
agentes-chat/agentes-chat#1506 ·
I maintainer di solito rispondono entro 1 giorno
-
comp/desktop desktop/files os/windows P2 type/perf
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
NousResearch/hermes-agent#160359 ·
I maintainer di solito rispondono entro 1 giorno
-
Missing repro Platform: Android
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
software-mansion/react-native-reanimated#11554 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno