mirror of
https://github.com/Chevron7Locked/kima-hub.git
synced 2026-06-19 07:37:17 +00:00
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:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user