diff --git a/e2e/measurement-flow.spec.ts b/e2e/measurement-flow.spec.ts index 39e20f7db..11672cf53 100644 --- a/e2e/measurement-flow.spec.ts +++ b/e2e/measurement-flow.spec.ts @@ -16,6 +16,16 @@ import { openMenu } from "./open-menu"; test.describe("add measurement flow", () => { test.use({ storageState: STORAGE_STATE_PATH }); + // This journey lands on the dashboard, which is the most expensive page in + // the product to render cold: the route segment suspends behind the server + // render and shows `loading.tsx` until it resolves. On a shared runner with + // the whole suite in flight that has overrun the 30 s default, and the test + // then died on the quick-add trigger rather than on anything it is about. + // The subject here is the add-then-appears round trip, not the dashboard's + // cold-start latency, so the budget is the page's and the assertions stay + // exactly as tight as they were. + test.setTimeout(90_000); + test("creating a weight reading surfaces it in the list", async ({ page, }) => { @@ -104,6 +114,13 @@ test.describe("add measurement flow", () => { ); await page.goto("/", { waitUntil: "domcontentloaded" }); + // Past the route-level skeleton first. `networkidle` says nothing about + // whether the suspended segment resolved, and every locator below lives + // inside the content that replaces it. + await expect(page.locator('[data-slot="dashboard-loading"]')).toHaveCount( + 0, + { timeout: 60_000 }, + ); await page.waitForLoadState("networkidle"); // Open the "Add" dropdown — the dashboard's quick-entry trigger sits