From f6bad9eb58441dd1d7bb4173933fef674b4d0cac Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Sat, 24 Oct 2026 02:35:58 -0400 Subject: [PATCH] test(e2e): #212 waits for the timeline to settle before scrolling up The wheel ran as soon as the composer appeared; when it landed during the room's initial jump-to-bottom it was snapped back and "Jump to Latest" never showed. Seen ~1 in 5 runs since matrix-js-sdk 44 shifted the load timing (failed the post-merge e2e run of #447 on lotus). Wait for the newest message, then retry the scroll until the button appears. 10/10 locally. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5 --- e2e/local-homeserver.spec.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/e2e/local-homeserver.spec.ts b/e2e/local-homeserver.spec.ts index bae50395d..5dda97090 100644 --- a/e2e/local-homeserver.spec.ts +++ b/e2e/local-homeserver.spec.ts @@ -109,9 +109,17 @@ test.describe('local homeserver regression', () => { ); await loginUI(page, alice); await openRoom(page, room); + // Wait for the timeline to settle at the newest message first: a wheel + // during the initial jump-to-bottom gets snapped back (test race, seen + // ~1 in 5 runs once matrix-js-sdk 44 changed the load timing). + await expect(page.getByText('filler 39')).toBeInViewport(); await page.mouse.move(600, 350); - await page.mouse.wheel(0, -600); - await expect(page.getByRole('button', { name: /Jump to Latest/ })).toBeVisible(); + await expect(async () => { + await page.mouse.wheel(0, -600); + await expect(page.getByRole('button', { name: /Jump to Latest/ })).toBeVisible({ + timeout: 2000, + }); + }).toPass({ timeout: 20_000 }); await page.locator('[data-slate-editor]').first().click(); await page.keyboard.type('sent while scrolled up'); await page.keyboard.press('Enter');