[bug] Retry + assert in async scenario does not work
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js, playwright
- Ambito
- testing-qa
Direzione di ricerca
Riprodurre i due scenari async dell’issue con CodeceptJS 3.0.5 o 3.0.6, Node.js 14.16.1 e Playwright, confrontando le esecuzioni con retry e senza retry. Tracciare la gestione dei retry dello scenario async a partire da questa riproduzione; il lavoro è completato quando l’assertion imprevista rimane un errore del test dopo i retry e l’output finale segnala un test fallito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What are you trying to achieve?
Assertion like the doc example (but with an unexpected value in the assertion):
const assert = require('assert')
Scenario.only('test page title 1', async ({ I }) => {
I.amOnPage('https://www.google.com')
const title = await I.grabTitle()
assert.strictEqual(title, 'Bad value')
}).retry(2)
Scenario('test page title 2', { retry: 2 }, async ({ I }) => {
I.amOnPage('https://www.google.com')
const title = await I.grabTitle()
assert.strictEqual(title, 'Bad value')
})
What do you get instead?
With retry option, the test does not fail (ok at the end), it's unexpected:
> codeceptjs run --steps "--verbose"
CodeceptJS v3.0.5
Using test root "---"
Helpers: Playwright, Context, Network
Plugins: screenshotOnFail, retryFailedStep, tryTo
US checkout / LP0001 --
[1] Starting recording promises
› [Session] Starting singleton browser session
test page title 1
I am on page "https://www.google.com"
I grab title
[1] Error | AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected
+ 'Google'
- 'Bad value'
[1] Starting <teardown> session
[1] <teardown> Stopping recording promises
› <screenshotOnFail> Test failed, try to save a screenshot
› Screenshot is saving to /----/codecept/output/test_page_title_1.failed.png
[2] Starting recording promises
› [Session] cleaning cookies and localStorage
OK | 0 passed // 2s
Without the retry, it's good, the test fails as expected:
> lv-front@1.0.2 codecept
> codeceptjs run --steps
CodeceptJS v3.0.5
Using test root "-----"
US checkout / LP0001 --
test page title 1
I am on page "https://www.google.com"
I grab title
✖ FAILED in 1059ms
-- FAILURES:
1) US checkout / LP0001
test page title 1:
Expected values to be strictly equal:
+ actual - expected
+ 'Google'
- 'Bad value'
+ expected - actual
-Google
+Bad value
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected
Artifacts:
- screenshot: /----/codecept/output/test_page_title_1.failed.png
FAIL | 0 passed, 1 failed // 1s
Details
- CodeceptJS version: 3.0.5 (but 3.0.6 tested too with the same bug)
- NodeJS Version: 14.16.1
- Operating System: macosX
- playwright
- 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
- 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 codeceptjs/CodeceptJS
-
stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
codeceptjs/CodeceptJS#5420 · 1 commento ·
-
stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
codeceptjs/CodeceptJS#5358 · 1 commento ·
-
stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
codeceptjs/CodeceptJS#4958 · 10 commenti · 2 reazioni ·
-
stale
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
codeceptjs/CodeceptJS#4778 · 3 commenti ·
-
stale
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
codeceptjs/CodeceptJS#5618 · 1 commento ·
Tutte le issue di codeceptjs/CodeceptJS
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Theme loads third-party resources on every page (jsdelivr web font, cdnjs Font Awesome) – GDPR Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
docToolchain/docToolchain#1705 ·
-
Timezone select lists one option per character; duplicate "Failed" reason; shared tracker popover id Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
nightscout/nocturne#1414 ·
-
bug v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
modelcontextprotocol/inspector#2458 · 1 commento ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
carbon-design-system/ibm-products#9907 ·