From c367b06142d1a79b4ba7c06a5e07ee6cbdde0594 Mon Sep 17 00:00:00 2001 From: Jacob Stephens Date: Wed, 21 Oct 2026 17:27:09 -0400 Subject: [PATCH] Wait for each Console page to load before reading its styles The accounts browser test clicked the Console log and Account links and read the body's background colour without waiting for the next page's load. When the stylesheet arrived late it read rgba(0, 0, 0, 0), as on PR #943's console-test run 39642022517. Co-Authored-By: Claude Opus 5.5 --- console/tests/accounts.test.cjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/console/tests/accounts.test.cjs b/console/tests/accounts.test.cjs index be9c3e4f4..2083792e3 100644 --- a/console/tests/accounts.test.cjs +++ b/console/tests/accounts.test.cjs @@ -57,10 +57,10 @@ test("sign-in and sign-out work on a phone without JavaScript using secure cooki assert.equal(session.sameSite, "Strict"); assert.ok(session.expires > Date.now() / 1000 + 29 * 86400); assert.equal((await context.request.post(`${origin}/sign-out`)).status(), 403); - await page.getByRole("link", { name: "Console log", exact: true }).click(); + await Promise.all([page.waitForURL(`${origin}/console-log`), page.getByRole("link", { name: "Console log", exact: true }).click()]); await page.getByText(/owner@example.test ยท sign-in/).waitFor(); assert.equal(await page.evaluate(() => getComputedStyle(document.body).backgroundColor), "rgb(18, 18, 20)"); - await page.getByRole("link", { name: "Account", exact: true }).click(); + await Promise.all([page.waitForURL(`${origin}/account`), page.getByRole("link", { name: "Account", exact: true }).click()]); assert.equal(await page.evaluate(() => getComputedStyle(document.body).backgroundColor), "rgb(18, 18, 20)"); await Promise.all([page.waitForURL(`${origin}/sign-in`), page.getByRole("button", { name: "Sign out this browser" }).click()]); await page.goto(origin);