From 6b435e41670abcba59aaa8babd04ba216d3a6a86 Mon Sep 17 00:00:00 2001 From: chevron7 Date: Tue, 2 Jun 2026 18:44:29 -0500 Subject: [PATCH] test(e2e): wait for playback to start before asserting transport in smoke The smoke spec asserted the play/pause button state immediately after Play all, racing the first audio load on a cold container (player stayed 'Not Playing'). Poll audio currentTime > 0 first. Surfaced while running the suite pre-v1.7.16. --- frontend/tests/e2e/smoke.spec.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/tests/e2e/smoke.spec.ts b/frontend/tests/e2e/smoke.spec.ts index b315a4d..49a1282 100644 --- a/frontend/tests/e2e/smoke.spec.ts +++ b/frontend/tests/e2e/smoke.spec.ts @@ -28,7 +28,12 @@ test("core smoke: login → play album → play/pause/next/prev", async ({ page // Start playback await page.getByLabel("Play all").click(); - // Mini player should reflect playing state + // Wait for playback to actually start before asserting transport state -- a + // freshly-booted container can lag the first audio load past the locator's + // default wait, which left the player "Not Playing" and flaked this test. + await expect.poll(() => getAudioCurrentTime(page), { timeout: 15_000 }).toBeGreaterThan(0); + + // Player should reflect playing state const playPause = page.locator('button[title="Pause"], button[title="Play"]').first(); await expect(playPause).toHaveAttribute("title", "Pause");