Playwright · sdk · fg-0323

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

page.waitForLoadState: Timeout 30000ms exceeded

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

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()

Affects: All Playwright versions, page.goto, page.waitForLoadState, page.waitForNavigation

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp