A Playwright timeout means the test or action reached its time limit. Read the call log to see what it was waiting for.
Test timeout of 30000ms exceeded.
Error: locator.click: Test timeout of 30000ms exceeded.
Call log:
- waiting for getByRole('button', { name: 'Save' })
For an error about multiple matching elements, read Playwright strict mode violation.
Before you raise the limit, read the last action in the call log. If the app reaches the expected state late, check how the test waits. If the app never reaches that state, a longer wait can hide the real problem.
Check which timeout stopped the test
If the message says Test timeout of 30000ms exceeded, the test reached its time limit. The 30,000ms value matches Playwright Test's default.
A retrying assertion defaults to 5,000ms. Both limits can change, so the number alone does not identify the timeout. Read the error's wording and check your project's settings.
The Playwright timeout guide describes these defaults:
| Category | Default in Playwright Test |
|---|---|
| Test | 30,000ms |
Retrying assertion (expect) |
5,000ms |
| Action | No separate limit |
| Navigation | No separate limit |
Whole test run (globalTimeout) |
No limit |
beforeAll / afterAll hook |
Matches the test timeout, with a separate allowance for each hook |
| Fixture | Shares the test timeout unless given a separate limit |
A fixture prepares resources for a test. Hooks run setup or cleanup code. Test time includes fixture setup and beforeEach. Fixture cleanup and afterEach share a separate allowance of the same duration.
"No separate limit" for actions does not disable the enclosing test timeout.
Start with playwright.config.ts or playwright.config.js. Check the selected entry under projects too.
timeoutsets the default test limit.expect.timeoutsets the default limit for retrying assertions.use.actionTimeoutsets the default action limit.use.navigationTimeoutsets the default navigation limit.globalTimeoutlimits the whole test run.
See the test configuration reference for these settings.
Then check the test code for overrides. These include test.setTimeout(), test.slow() and test.describe.configure(). Individual actions and assertions can also receive { timeout: ... }. The test API reference explains the test overrides.
Page and browser-context settings can change action and navigation limits too. Look for setDefaultTimeout() and setDefaultNavigationTimeout(). See the action and navigation settings.
Read the call log first
This is the part people scroll past, and it is the answer:
Call log:
- waiting for getByRole('button', { name: 'Save' })
Playwright is telling you the exact locator it sat waiting on. Before changing any config, ask one question: why would that locator never resolve?
A richer call log tells you even more:
Call log:
- waiting for getByRole('button', { name: 'Save' })
- locator resolved to <button disabled>Save</button>
- element is not enabled
- retrying click action
That is not a timing problem at all. The element was found immediately. It is disabled, and it stayed disabled. No extra seconds will help. Something earlier in the flow failed to enable it, and that is the real bug.
What Playwright waits for before it acts
Playwright does not click the moment it finds an element. Before an action it checks the element is:
- attached to the DOM
- visible
- stable, meaning it has stopped moving
- enabled
- able to receive events, meaning nothing covers it
It retries these checks until they all pass. So a timeout means at least one of those never became true. The call log usually names which.
This is worth knowing because it reframes the error. It is not "Playwright was too slow". It is "this element never became usable, and here is the check that failed".
The five real causes
1. The element never appears
The selector is wrong, or the element genuinely never renders. Confirm the selector against the real page before assuming timing.
npx playwright test --debug
The debugger lets you step and try locators live, which settles this in seconds.
2. The element exists but stays disabled or covered
The call log says "element is not enabled" or "intercepts pointer events". Check whether a banner or overlay blocks the element. For a disabled button, check which earlier step should enable it.
3. The locator matches something invisible
Responsive layouts often render a mobile and a desktop copy of the same control, hiding one. If your locator matched the hidden copy, it will never become visible.
// Ask for the one a user can actually see.
page.getByRole('button', { name: 'Save' }).filter({ visible: true });
4. The page never finished what it started
A failed network request, an error swallowed in the console, or a spinner that never resolves. The application is broken, and your test is correctly reporting it. This is a real bug, not a test problem.
5. The whole test is simply long
Many steps, each legitimately slow. Here, and only here, raising the test timeout is the correct fix.
test('long checkout journey', async ({ page }) => {
test.setTimeout(60_000); // this specific test genuinely needs longer
});
Raise it for the one test that needs it. Raising the global default hides real failures across the whole suite.
Why raising the timeout is usually the wrong first move
If an element never becomes usable, waiting longer changes nothing except how long you wait to find out. You turn a fast failure into a slow one, and slow failures make a suite people stop trusting.
There is a second cost. A global timeout raise masks genuine regressions. A page that used to respond in two seconds and now takes twenty is a real problem, and a 60 second timeout hides it until a customer complains.
Raise a timeout when the work is genuinely slower. Fix the cause when the element is not usable. The call log tells you which situation you are in.
Do not fix it with waitForTimeout
await page.waitForTimeout(5000); // please do not
The Playwright documentation is direct about this: it exists for debugging and should not be used in production tests. It is wrong in both directions, wasting time when the page is ready and still failing when it is slow.
Use a web-first assertion instead. It retries until the condition is true, then continues at once:
await expect(page.getByTestId('toast')).toBeVisible();
That waits for the real condition, so it is both faster and more reliable than any fixed number.
Use the trace, it removes the guessing
This is Playwright's real advantage over reading logs.
// playwright.config.ts
use: { trace: 'on-first-retry' },
Then open the trace from the failed run:
npx playwright show-trace trace.zip
You get the DOM at the moment of failure, every action with timings, the network, and the console. Instead of guessing why an element never became visible, you look at the page as it was and see the overlay sitting on top of it.
For a failure you did not watch happen, especially in CI, this is the fastest route to the cause.
Remember this
Read the timeout name, then check the configured limit. Use the call log to find what Playwright was waiting for. Increase the relevant limit only when the work needs more time.
The Playwright track goes deeper on where auto-waiting stops helping you: the limits of auto-waiting.
A slow save and a missing confirmation need different responses. Give the working app time to finish. Keep the check that fails if the confirmation never appears. The problem "The save test is flaky" practises this distinction in Playwright.
Reference: Playwright timeouts.