arrow-left Back to topicQuizRetriesCheck yourself1.A test passes locally but fails intermittently on CI. After adding retries: 2, the HTML report shows it as 'flaky'. What does that mean?The test passed — 'flaky' is just an informational badge, not a failureThe test failed on the first run but passed after a retry — it's unreliable and should be investigatedThe test was skipped because it's marked as flaky2.When does test.describe.configure({ mode: 'serial' }) make sense?Always — serial mode makes tests more reliableWhen tests genuinely depend on each other — like a multi-step flow where step 2 needs step 1's outputOnly when running on CI to avoid parallel execution issues3.How do you set retries globally for all tests in a project?Add retries: 2 inside the use: {} block of playwright.config.tsSet retries: 2 at the top level of defineConfig in playwright.config.tsCall test.retry(2) at the top of every test filePass --retry=2 when running npm test4.What is the value of testInfo.retry on the very first run of a test (before any retries)?1 — the first attempt is retry number 10 — the first run is attempt 0; the first retry is 1undefined — it is only set when a retry actually happensnull — representing no retry yet5.What is the difference between retries and --repeat-each in Playwright?They are the same — both re-run a failing testretries only re-runs a test when it fails; --repeat-each runs every test N times regardless of pass or failretries is for the whole suite; --repeat-each is for a single test file--repeat-each is the CLI equivalent of retries in the config file6.When a test is retried, what state does it start with?The exact browser state from the end of the failed attempt — cookies, localStorage and allA completely fresh state — new worker process, new browser, all fixtures re-run from scratchThe same browser but with cookies clearedThe state depends on whether storageState is set in the config7.You want to override the global retries count for one specific describe block. Which API do you use?test.use({ retries: 3 }) inside the describe blocktest.describe.configure({ retries: 3 }) inside the describe blocktest.setTimeout(retries: 3) inside the describe blockIt is not possible to override retries per describe block8.A test creates a record in the database on the first run, then fails. On the retry, the test tries to create the same unique record and gets a duplicate key error. What is the best fix?Disable retries for tests that write to the databaseUse testInfo.retry > 0 to delete the record created by the previous attempt before re-running the test logicUse a random UUID for the record key so duplicates are impossibleMove the database write to a beforeEach hook so it does not run on retriesSubmit answersarrow-left PreviousAnnotationsTimeoutsNext arrow-right