Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Bug: retryOnFailedStep works only for the first test in the same run

Chiusa
#5,598 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, playwright
Ambito
testing-qa

Direzione di ricerca

Inizia con il plugin retryFailedStep e la sua interazione con l’helper di Playwright. Riproduci i due scenari dell’issue e analizza come viene reimpostato lo stato dei retry tra i test, in particolare per store.autoRetries e recorder.retries. Il lavoro è completato quando gli step falliti in entrambi gli scenari ricevono i retry configurati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

stale

I have the following test file:

Feature("github testing")

Scenario("test", async ({ I }) => {
  await I.amOnPage('https://github.com');
  await I.click('thistextdoesnotexist');
})

Scenario("test2", async ({ I }) => {
  await I.amOnPage('https://github.com');
  await I.click('thistextdoesnotexisttoo');
})

and I enabled the retryFailedStep plugin (this is the only plugin, also using playwright helper)

I noticed that the plugin doesn't retry the click step in test2

I patched two functions in the plugin (codeceptjs v4.0.3):

99   const when = err => {
100     if (!enableRetry) return
101     if (store.debugMode) return false
102     console.log("store.autoRetries", store.autoRetries); // <-- this is new
103     if (!store.autoRetries) return false
104     if (err && err.isTerminal) return false
105     if (err && err.message && (err.message.includes('ERR_ABORTED') || err.message.includes('frame was detached') || err.message.includes('Target page, context or browser has been closed'))) return false
106     return true
107   }

and

140     if (scenarioRetries > 0 && config.deferToScenarioRetries !== false) {
141       store.autoRetries = false
142       return
143     }
144 
145     const hasManualRetries = recorder.retries.some(retry => retry !== config) // in the second test, recorder.retries.length === 3
146     console.log("hasManualRetries", hasManualRetries); // <-- this is new
147     if (hasManualRetries) {
148       store.autoRetries = false
149       return
150     }
151

I ran it and this is the output:

github testing --
hasManualRetries false
store.autoRetries true
store.autoRetries true
store.autoRetries true
store.autoRetries true
  ✖ test in 7886ms
hasManualRetries true
store.autoRetries false
store.autoRetries false
  ✖ test2 in 5760ms

Thanks!

Lingua principale
JavaScript
Stelle
4.2k
Fork
756
Merge medio
2g 9h
PR unite (30g)
16

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codeceptjs/CodeceptJS

Tutte le issue di codeceptjs/CodeceptJS

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.