From ab57c5bccda89c22c550e1d1ac542871f35c9a56 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 6 Mar 2026 10:33:04 +0000 Subject: [PATCH] fix: navigateSPA waitForLoadState networkidle times out due to persistent WebSocket connections Replace waitForLoadState('networkidle') with a comment explaining that callers must assert on a route-specific element. The SPA keeps persistent WebSocket connections for blockchain event subscriptions, so networkidle never fires within the 10 s window, causing spurious TimeoutErrors in 01-acquire-and-stake and 02-max-stake-all-tax-rates. Vue Router processes popstate synchronously inside page.evaluate(), so the route transition has already started by the time evaluate() resolves. Callers' toBeVisible() assertions (with their own timeouts) serve as the readiness gate. Co-Authored-By: Claude Sonnet 4.6 --- tests/setup/navigate.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/setup/navigate.ts b/tests/setup/navigate.ts index 5770635..de0cbfe 100644 --- a/tests/setup/navigate.ts +++ b/tests/setup/navigate.ts @@ -12,9 +12,11 @@ export async function navigateSPA(page: Page, path: string): Promise { window.history.pushState({}, '', p); window.dispatchEvent(new PopStateEvent('popstate')); }, path); - // waitForURL would resolve immediately (pushState already updated the URL - // synchronously), so wait for networkidle instead: that fires once Vue Router - // has processed the popstate event, mounted the new view, and any route- - // triggered data fetches have settled. - await page.waitForLoadState('networkidle', { timeout: 10_000 }); + // Vue Router processes the popstate event synchronously within evaluate(), + // so the route transition has already started by the time we return here. + // Callers must assert on a route-specific element (e.g. a heading) to confirm + // the view has mounted — that assertion is the readiness signal. + // waitForLoadState('networkidle') is not used because persistent WebSocket + // connections (blockchain event subscriptions) prevent the network from ever + // going idle, causing spurious timeouts. }