From f0a2c067e2143bf6d36ca6ce72a9e24a5ccaf6ef Mon Sep 17 00:00:00 2001 From: Szymon Chmal Date: Sun, 25 Oct 2026 14:50:48 +0100 Subject: [PATCH 1/2] =?UTF-8?q?test:=20reproduce=20#1006=20=E2=80=94=20the?= =?UTF-8?q?=20keyboard-scroll=20test=20notes=20the=20row=20in=20view=20bef?= =?UTF-8?q?ore=20the=20history's=20end=20row=20moves=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- e2e/console/activity.spec.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/e2e/console/activity.spec.ts b/e2e/console/activity.spec.ts index e9ab7e685..818e6471b 100644 --- a/e2e/console/activity.spec.ts +++ b/e2e/console/activity.spec.ts @@ -375,6 +375,19 @@ test.describe("the Activity page", () => { }) => { const host = await startDaemon("worker", { driverScript: { ios: IOS } }); try { + let release = () => {}; + const gate = new Promise((resolve) => { + release = resolve; + }); + // why: the real daemon answers the page before the oldest held only once the test has noted + // the row in view, as on a loaded runner (#1006); its end row then shrinks the box. + await page.route( + (url) => url.pathname === "/v1/events" && url.searchParams.has("before"), + async (route: Route) => { + await gate; + await route.continue(); + }, + ); for (let index = 0; index < 6; index += 1) await lease(host, `console-e2e-scroll-${index}`); await openEvents(page, host); await expect.poll(() => rows(page).count()).toBeGreaterThan(5); @@ -389,6 +402,8 @@ test.describe("the Activity page", () => { ) .toBeLessThan(2); const inView = await firstRowInView(page); + release(); + await expect(page.getByText("Start of the history (", { exact: false })).toBeVisible(); await lease(host, "console-e2e-scroll-new"); const more = page.getByRole("button", { name: /^\d+ new events?$/ }); await expect(more).toBeVisible(); From 584719d63546e8f5c37c2347710337e396d6747c Mon Sep 17 00:00:00 2001 From: Szymon Chmal Date: Sun, 25 Oct 2026 14:54:59 +0100 Subject: [PATCH 2/2] fix(e2e): the keyboard-scroll test notes the row in view after the history's end row has moved it (#1006) --- e2e/console/activity.spec.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/e2e/console/activity.spec.ts b/e2e/console/activity.spec.ts index 818e6471b..922279806 100644 --- a/e2e/console/activity.spec.ts +++ b/e2e/console/activity.spec.ts @@ -379,8 +379,8 @@ test.describe("the Activity page", () => { const gate = new Promise((resolve) => { release = resolve; }); - // why: the real daemon answers the page before the oldest held only once the test has noted - // the row in view, as on a loaded runner (#1006); its end row then shrinks the box. + // why: the real daemon answers the page before the oldest late, as on a loaded runner (#1006); the + // test notes the row in view only after the end row has moved it. await page.route( (url) => url.pathname === "/v1/events" && url.searchParams.has("before"), async (route: Route) => { @@ -396,14 +396,13 @@ test.describe("the Activity page", () => { await page.keyboard.press("End"); await expect.poll(() => feed(page).evaluate((box) => box.scrollTop)).toBeGreaterThan(0); - await expect - .poll(() => - feed(page).evaluate((box) => box.scrollHeight - box.scrollTop - box.clientHeight), - ) - .toBeLessThan(2); - const inView = await firstRowInView(page); + const atEnd = () => + feed(page).evaluate((box) => box.scrollHeight - box.scrollTop - box.clientHeight); + await expect.poll(atEnd).toBeLessThan(2); release(); await expect(page.getByText("Start of the history (", { exact: false })).toBeVisible(); + await expect.poll(atEnd).toBeLessThan(2); + const inView = await firstRowInView(page); await lease(host, "console-e2e-scroll-new"); const more = page.getByRole("button", { name: /^\d+ new events?$/ }); await expect(more).toBeVisible();