arrow-left Back to topicQuizTimeoutsCheck yourself1.A test fails with: 'Error: expect(received).toHaveText(expected) with timeout 5000ms'. The API response takes 8 seconds. What's the right fix?Add retries: 2 to the config — retrying the test will eventually passIncrease expect.timeout to 10_000 in config, or pass { timeout: 10_000 } to the specific assertionIncrease the test timeout to 60_000 — more test time means more time for assertions2.You have a worker-scoped fixture that seeds a test database — it takes up to 45 seconds. Tests themselves take 5-10 seconds. How do you prevent the seed from eating the test timeout?Set the global test timeout to 120_000 — enough for seed + testGive the fixture its own timeout: { scope: 'worker', timeout: 60_000 }Move the seed to globalSetup — it runs outside test timeouts3.What is the default test timeout in Playwright?10 seconds30 seconds60 secondsNo timeout — tests run until they finish4.How does test.slow() work and when should you use it?It sets the test timeout to 60 seconds unconditionallyIt triples the current test timeout — useful for tests that are inherently slow without hardcoding a specific numberIt slows down every action by 3× to make the test more stableIt marks the test as slow in the reporter but does not change the timeout5.What is the default expect timeout and what does it control?30 seconds — same as the test timeout, controlling how long the whole test assertion block can take5 seconds — how long an auto-retrying assertion like expect(locator).toBeVisible() keeps retrying before giving up1 second — assertions check once and fail immediately if the condition is not metNo default — each assertion requires an explicit timeout parameter6.How do you set a global action timeout so every click(), fill(), and goto() fails after 10 seconds if not complete?Set timeout: 10_000 at the top level of defineConfigSet actionTimeout: 10_000 inside the use: {} blockCall page.setDefaultTimeout(10_000) in a beforeEach hookSet clickTimeout: 10_000 and fillTimeout: 10_000 individually in the use block7.What happens when the test timeout fires during a page.goto() call?The goto() is cancelled and the test continues with the next lineThe test is marked as failed with a timeout error; teardown and fixture cleanup still runThe worker is killed immediately with no cleanupPlaywright retries the goto() call automatically8.Which config option sets a safety-net timeout for the entire test suite run — not for individual tests?timeout — the top-level test timeout optionsuiteTimeout — a dedicated option for the whole runglobalTimeout — stops the entire run if it exceeds the valuemaxTime — only available as a CLI flagSubmit answersarrow-left PreviousRetriesFixturesNext arrow-right