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

[Feature]: Allow individual test steps to be retried

Aperta
#41,298 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
testing-qa

Direzione di ricerca

Inizia esaminando l’API esistente test.step e expect().toPass(), che l’issue identifica come workaround attuale. Definisci il comportamento dei retry, la gestione del timeout e le opzioni di step necessarie per un retry completo a livello di transazione, dove «done» significa che le azioni raggruppate possono essere ritentate senza usare un’asserzione.

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

Descrizione

feature-test-runner
🚀 Feature Request

I'd like to propose adding an option retry: boolean to test steps.
This way a whole group of actions could be retried instead of only individual ones, using steps would also enforcing a title on what they're doing.
If retry is set to true playwright would automatically retry the whole step until it passes or the timeout is exceeded.

Example
test("Reply to message", async ({ page }) => {
  // If clicking the element fails, hovering will be retried as well
  test.step("Reply to message", async () => {
    const messageItem = page.getByText("Test Message");
    await messageItem.hover({ timeout: 2_000 });
    await messageItem.getByRole("button", { name: "Reply" }).click({ timeout: 2_000 });
  }, { box: true, retry: true, timeout: 20_000 });
});
Motivation

I recently came across the issue that I needed to hover an element and then click a button inside the tooltip which would appear during hover. However, in some cases it could happen that the hovered element would move, closing the tooltip. Playwrights automatic retries are amazing for making single interactions retrieable but lack the option to create custom "transactions" containing multiple actions.

Creating such transactions is already possible by utilizing expect().toPass(), but it always feels "hacky" to use an assertion just to retry something.

With this proposal creating transactions would be possible without the need to create an assertion for them.
Please let me know what you think, I'm also open for other syntax suggestions on how this might be archived. :)

Lingua principale
TypeScript
Stelle
98k
Fork
6.6k
Merge medio
17h 7m
PR unite (30g)
321

Preparare l'ambiente

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 microsoft/playwright

Tutte le issue di microsoft/playwright

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.