Playwright · sdk · fg-0323

waitForLoadState('networkidle') times out on pages with analytics, polling or websockets

If you see page.waitForLoadState: Timeout 30000ms exceeded, the cause and the fix for Playwright are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
page.waitForLoadState: Timeout 30000ms exceededgoto with waitUntil: 'networkidle' passes locally and times out in CIAdding a chat widget or analytics script makes unrelated tests fail
Cause
networkidle waits for 500 ms with zero open connections, which never happens on pages that poll or hold sockets. Playwright marks the option as discouraged for testing.
Fix
Remove networkidle and wait for the thing the test needs with a web-first assertion.
Apply
await page.goto('/dashboard') await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible()
Affected
All Playwright versions, page.goto, page.waitForLoadState, page.waitForNavigation
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun