Skip to content
Latchkey

Playwright "page.goto: Timeout 30000ms exceeded" in CI

Playwright opened the URL but the navigation did not reach its wait condition (load by default) within the navigation timeout. The connection succeeded; the page just never settled in time, which is common on a cold or under-resourced CI server.

What this error means

A test fails with "page.goto: Timeout 30000ms exceeded" and "navigating to ..., waiting until 'load'". Unlike ERR_CONNECTION_REFUSED, the server did answer.

playwright
Error: page.goto: Timeout 30000ms exceeded.
Call log:
  - navigating to "http://localhost:3000/dashboard", waiting until "load"

Common causes

The page never reaches the load state

A long-polling request or a never-completing resource keeps the load event from firing, so goto waits forever and times out.

A slow first response on a cold CI server

Just-in-time compilation or a cold cache makes the first navigation far slower in CI than locally, exceeding 30s.

How to fix it

Wait for a less strict load state

Use domcontentloaded when full load is gated by background requests that never finish in CI.

tests/dashboard.spec.ts
await page.goto('/dashboard', { waitUntil: 'domcontentloaded' });

Raise the navigation timeout for CI

Increase navigationTimeout so a slow cold start does not fail an otherwise healthy page.

playwright.config.ts
use: { navigationTimeout: 60_000 },

How to prevent it

  • Choose a waitUntil state the page actually reaches in CI.
  • Warm the server (a health-check hit) before the suite starts.
  • Set navigation timeouts to reflect cold CI performance, not local speed.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →