Timeout Configuration in Playwright

From the Playwright cheat sheet ยท Retries & Timeouts ยท verified Jul 2026

Timeout Configuration

Set timeouts for tests, actions, navigation, and assertions

typescript
import { defineConfig } from '@playwright/test';

export default defineConfig({
  timeout: 30_000,               // Per-test timeout (30s)
  expect: { timeout: 5_000 },   // Assertion timeout (5s)
  use: {
    actionTimeout: 10_000,       // Click/fill/etc timeout
    navigationTimeout: 30_000,   // page.goto timeout
  },
});
๐Ÿ’ก test.slow() triples the timeout โ€” use for known slow tests instead of hardcoding a number
โšก The 4 timeout layers: test > action > navigation > expect โ€” each independently configurable
๐Ÿ“Œ Per-assertion timeout overrides expect.timeout โ€” useful for elements that load asynchronously
๐ŸŸข Default test timeout is 30s โ€” increase for E2E flows, decrease for unit-style tests
timeoutslowconfiguration

More Playwright tasks

Back to the full Playwright cheat sheet