Skip to content
Playwright · error message

Playwright: Test timeout of 30000ms exceeded

ConfigurationPlaywright Test runner

Last verified

The exact message
Test timeout of 30000ms exceeded.

What it means

Playwright Test gives every test, including its beforeEach and afterEach hooks and fixtures, 30 seconds by default. When that budget runs out, the runner aborts the test and reports this message. Because actions in Playwright Test have no separate timeout by default, a single click waiting on an element that never becomes actionable will often consume the whole test budget, and the error you see is this one rather than an action timeout.

The runner usually prints a second error below it, for example the action that was still pending or Target page, context or browser has been closed because the page was torn down mid-action. That second error and its call log tell you where the time went.

What is not wrong: the 30-second value is a default, not a limit imposed by the browser. Long end-to-end flows legitimately need more.

What it looks like

// playwright.config.ts
export default defineConfig({
  timeout: 60_000,
  expect: { timeout: 10_000 },
  use: { actionTimeout: 15_000, navigationTimeout: 30_000 },
});

// In a single long test
test('exports a large report', async ({ page }) => {
  test.slow();
  // ...
});

Why it happens

  • An action is waiting forever on a locator that never matches or never becomes actionable.
  • A legitimately long flow (multi-page checkout, file processing) needs more than 30 seconds.
  • A slow beforeEach hook or fixture (login, database seeding) eats most of the budget.
  • Slow CI hardware or many parallel workers stretch every step.
  • A page.waitForTimeout() or polling loop adds fixed delays.

How to fix it

  1. Read the error printed after the timeout and its call log to find the stuck step.
  2. Set actionTimeout and navigationTimeout in config so stuck actions fail fast with a specific message.
  3. Raise the budget only for slow tests with test.slow() (triples it) or test.setTimeout(ms).
  4. Move login into a setup project with storageState so each test does not repeat it.
  5. Replace fixed waits with web-first assertions.

How to stop it recurring

Give actions their own timeout so the test timeout is a safety net, not the first signal. Keep authentication and seeding out of individual tests with setup projects and storageState. Watch per-test duration in reports; a test that creeps toward the limit is a flaky test waiting to happen.

Official documentation: playwright.dev/docs/test-timeouts. See all Playwright error messages.

Related errors

Definitions

Quick answers

What does "Test timeout of 30000ms exceeded" mean in Playwright?

Playwright Test gives every test, including its beforeEach and afterEach hooks and fixtures, 30 seconds by default. When that budget runs out, the runner aborts the test and reports this message.

How do I fix "Test timeout of 30000ms exceeded"?

1. Read the error printed after the timeout and its call log to find the stuck step. 2. Set actionTimeout and navigationTimeout in config so stuck actions fail fast with a specific message. 3. Raise the budget only for slow tests with test.slow() (triples it) or test.setTimeout(ms). 4. Move login into a setup project with storageState so each test does not repeat it. 5. Replace fixed waits with web-first assertions.

Run browser automation you can watch and take over

Autonoly runs each job in a real cloud Chromium browser driven by Playwright. Timeouts and detached elements still happen; the difference is that you can watch the run live, see the step that failed, and take control of the browser to finish it.

Also see Live browser control.