From 1ddc15750e0ffb205ffdd160935bbc4f82e10528 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Sun, 8 Nov 2026 06:36:23 -0500 Subject: [PATCH] Wait for real playback before seeking near a segment's end The busy-day timeline contract set currentTime=29.8 as soon as the video reported paused=false. paused flips when play() is requested, before the next segment's metadata loads, and the player then seeks to the timeline cursor, overwriting the test's seek. The 1440px case lost that race on main (965df7a) and on #930. Wait for HAVE_CURRENT_DATA with time advancing first. Co-Authored-By: Claude Opus 5.5 --- tests/contracts/timelineWorkflow.ui.spec.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/contracts/timelineWorkflow.ui.spec.ts b/tests/contracts/timelineWorkflow.ui.spec.ts index e16620f60..a40f82cfc 100644 --- a/tests/contracts/timelineWorkflow.ui.spec.ts +++ b/tests/contracts/timelineWorkflow.ui.spec.ts @@ -79,6 +79,9 @@ for(const width of [390,1440]) { await page.locator('#play-button').click(); await expect.poll(()=>video.evaluate(v=>(v as HTMLVideoElement).currentSrc)).toContain('/1001?'); await expect.poll(()=>video.evaluate(v=>(v as HTMLVideoElement).paused)).toBe(false); + // paused flips as soon as play() is requested; the player seeks to the cursor once the + // new segment's metadata loads, so only jump near its end after playback is under way. + await expect.poll(()=>video.evaluate(v=>{const e=v as HTMLVideoElement;return e.readyState>=2&&e.currentTime>0;})).toBe(true); await video.evaluate(v=>{(v as HTMLVideoElement).currentTime=29.8;}); await expect.poll(()=>video.evaluate(v=>(v as HTMLVideoElement).currentSrc)).toContain('/1002?'); await expect.poll(()=>video.evaluate(v=>(v as HTMLVideoElement).paused)).toBe(false);