From 8317d38383d03bf28cfc899e50403db5ed1ff1c5 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 7 Oct 2026 18:16:04 +0800 Subject: [PATCH] gui tests: routing-failed-open measures the 400's row once the live page has followed the newest request and drawn its story MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In WebKit the live cases read the row's top as soon as the list was there, before the page had followed the newest request and drawn its story above the list (.rt-log grows 17 → 104px), so the row was 87px lower by the click and "picking the request moved the page" failed — with the test's own commit's assets too (d6096e2f), so it is the test's timing, not a regression. The test now waits for the newest row to be pressed and the story's steps, then for the row's top to hold still, before clicking. Before: webkit en/zh live failed 2 of 2 (row 524 → 611). After: 8 of 8 (chromium and webkit, en and zh, live and kept day), three runs. --- internal/gui/tests/routing-failed-open.test.cjs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/gui/tests/routing-failed-open.test.cjs b/internal/gui/tests/routing-failed-open.test.cjs index 98c562cb..2649c8ba 100644 --- a/internal/gui/tests/routing-failed-open.test.cjs +++ b/internal/gui/tests/routing-failed-open.test.cjs @@ -79,7 +79,17 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", const row = page.locator(".rt-req").nth(1); assert.match(await row.textContent(), /400/); - const was = await row.evaluate((e) => e.getBoundingClientRect().top); + // Live, the page follows the newest request and draws its story above + // the list once the trace is in; measure after that, not mid-load. + if (live) await page.locator(".rt-req").nth(0).and(page.locator('[aria-pressed="true"]')).waitFor(); + await page.locator(".rt-steps li").first().waitFor(); + let was = await row.evaluate((e) => e.getBoundingClientRect().top); + for (let i = 0, same = 0; i < 40 && same < 3; i++) { + await page.waitForTimeout(50); + const now = await row.evaluate((e) => e.getBoundingClientRect().top); + same = Math.abs(now - was) <= 1 ? same + 1 : 0; + was = now; + } await row.click(); await page.waitForTimeout(400); assert(Math.abs((await row.evaluate((e) => e.getBoundingClientRect().top)) - was) <= 1, "picking the request moved the page");