gui tests: routing-failed-open measures the 400's row once the live page has followed the newest request and drawn its story
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.
This commit is contained in:
1 parent
6d1d202b7f
commit
8317d38383
1 file changed
+11
-1
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user