Skip to content

Commit 6769430

Browse files
stefanhuberCopilot
andauthored
Update test/specs/player.spec.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 763179e commit 6769430

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

test/specs/player.spec.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,26 @@ describe('Player controls', () => {
1717

1818
it('activates second item after clicking next', async () => {
1919
await playerPage.clickNext();
20-
await browser.pause(500);
20+
await browser.waitUntil(
21+
async () => await playerPage.isItemActive(1),
22+
{
23+
timeout: 5000,
24+
timeoutMsg: 'Expected second item to become active after clicking next',
25+
}
26+
);
2127
const isActive = await playerPage.isItemActive(1);
2228
expect(isActive).toBe(true);
2329
});
2430

2531
it('activates first item again after clicking prev', async () => {
2632
await playerPage.clickPrev();
27-
await browser.pause(500);
33+
await browser.waitUntil(
34+
async () => await playerPage.isItemActive(0),
35+
{
36+
timeout: 5000,
37+
timeoutMsg: 'Expected first item to become active again after clicking prev',
38+
}
39+
);
2840
const isActive = await playerPage.isItemActive(0);
2941
expect(isActive).toBe(true);
3042
});

0 commit comments

Comments
 (0)