From 5027b9d28d2a1e4d2314380ce39047ed7a2a5b33 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Mon, 16 Nov 2026 09:08:20 +0900 Subject: [PATCH] test(e2e): poll the URL a localized refresh lands on In Next dev mode the HTML refresh can abort the localized document before it loads, and waitForURL then fails with net::ERR_ABORTED. Poll the page URL instead, which survives an aborted navigation. Co-Authored-By: Claude Opus 5.5 --- e2e/landing-dev.spec.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/e2e/landing-dev.spec.ts b/e2e/landing-dev.spec.ts index 99484cf16..383a32484 100644 --- a/e2e/landing-dev.spec.ts +++ b/e2e/landing-dev.spec.ts @@ -49,14 +49,17 @@ const routes = [ * its dev modules, and Chromium never reports some of the requests it aborts as * finished, so Playwright counts them against the English document and * networkidle never fires there. Follow the refresh, then settle the target in - * a fresh document. + * a fresh document. The refresh can also abort the localized document before it + * loads, which fails `waitForURL`, so poll the URL instead. */ async function open(page: Page, route: string, target: string) { if (route === target) { return page.goto(route, { waitUntil: 'networkidle' }) } const response = await page.goto(route, { waitUntil: 'commit' }) - await page.waitForURL(`http://localhost:3098${target}`, { waitUntil: 'load' }) + await expect(page).toHaveURL(`http://localhost:3098${target}`, { + timeout: 60_000, + }) await page.goto('about:blank') await page.goto(target, { waitUntil: 'networkidle' }) return response