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.
This commit is contained in:
chevron7
2026-06-02 18:44:29 -05:00
parent 1a9f6f418a
commit 6b435e4167
+6 -1
View File
@@ -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");