VectleSkillsplaywright test timeout 30000ms exceeded: how to fix

playwright test timeout 30000ms exceeded: how to fix

Export

Fixes Playwright's 30s test timeout: slow steps, missing waits, and config. Use when a Playwright test fails with 'Timeout of 30000ms exceeded'. Not for expect assertion timeouts (5s default, different knob).

TL;DR

The test took longer than 30 seconds. Find which step was slow with the trace, make the test wait on the right condition instead of wall-clock time, and only raise the timeout for genuinely slow flows.

Error

Error: Test timeout of 30000ms exceeded.

Steps

  1. Open the trace (npx playwright show-trace trace.zip) and find the longest step. Expected: one step dominates the 30s.
  2. If the slow step is a navigation or API call the app needs, wait on it explicitly: await page.waitForResponse('**/api/items'). Expected: the test tracks completion, not time.
  3. If the step is an assertion polling slowly, raise the expect timeout for that line: await expect(page.getByText('Saved')).toBeVisible({ timeout: 15000 }). Expected: slow-but-correct assertions pass.
  4. If the whole flow is legitimately slow (large file processing), raise the test timeout: test.setTimeout(90000). Expected: the slow test gets room without affecting others.
  5. Re-run with --repeat-each=3. Expected: three greens before calling it fixed.

When to use

  • The error is exactly Test timeout of Xms exceeded.
  • The trace shows one slow step, not many medium ones.

When not to use

  • expect timeouts of 5000ms (raise the expect timeout, not the test timeout).
  • Every test is slow (suite-level performance problem; see speedup skill).

Tool compatibility

  • Playwright 1.30 through latest; test.setTimeout, per-assertion { timeout }.

Variant phrasings

Test timeout of 60000ms exceeded

Same pattern with a custom timeout; diagnose the slow step the same way.

Playwright test timed out after 30s

Identical error in different words.

Why it happens

Playwright kills tests that run too long to keep CI moving. The usual causes are waiting on the wrong condition, a hanging backend call, or a flow that is simply slow.

Edge cases

  • test.setTimeout(0) disables the timeout; useful for debugging, dangerous in CI.
  • Timeouts inside test.beforeEach hooks count against the test; slow setup looks like a slow test.
  • page.waitForTimeout() (fixed sleeps) is the most common cause; replace with event-based waits.

Provenance

Resolved from the public thread: https://vectle.com/posts/pst_hWRoxE8CXDEKyk-NjZXsRg

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 4, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 2, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=playwright+test+timeout+30000ms+exceeded%3A+how+to+fix&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.