diff --git a/e2e/cycle-insights-mobile.spec.ts b/e2e/cycle-insights-mobile.spec.ts index cb278f5d0..a247bbddd 100644 --- a/e2e/cycle-insights-mobile.spec.ts +++ b/e2e/cycle-insights-mobile.spec.ts @@ -175,6 +175,14 @@ test.describe("cycle + insights mobile smoke", () => { ); }); + // These handlers call route.fetch(), which needs a live page. Teardown can + // close the context while one is still in flight, and the rejected fetch + // then fails a test that had already passed. Drop the handlers first so + // nothing is left racing the close. + test.afterEach(async ({ page }) => { + await page.unrouteAll({ behavior: "ignoreErrors" }); + }); + test("/insights has no horizontal scroll on Pixel-5", async ({ page }) => { await page.goto("/insights", { waitUntil: "domcontentloaded" }); await page.waitForLoadState("networkidle");