Skip to content

Commit

Permalink
Apply longer event timeouts on Ad test
Browse files Browse the repository at this point in the history
  • Loading branch information
wvanhaevre committed Nov 22, 2024
1 parent d5ecfb3 commit 2e45f48
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions e2e/src/tests/Ads.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,21 @@ export default function (spec: TestScope) {
spec.describe('Set source with ads and auto-play', function () {
spec.it('dispatches sourcechange, play, playing and ad events', async function () {
const player = await getTestPlayer();
const playEventsPromise = waitForPlayerEventTypes(player, [PlayerEventType.SOURCE_CHANGE, PlayerEventType.PLAY, PlayerEventType.PLAYING]);

const adEventsPromise = waitForPlayerEvents(player, [
{ type: PlayerEventType.AD_EVENT, subType: AdEventType.AD_BREAK_BEGIN } as AdEvent,
{ type: PlayerEventType.AD_EVENT, subType: AdEventType.AD_BEGIN } as AdEvent,
]);
const playEventsPromise = waitForPlayerEventTypes(
player,
[PlayerEventType.SOURCE_CHANGE, PlayerEventType.PLAY, PlayerEventType.PLAYING],
true,
{ timeout: 60000 },
);
const adEventsPromise = waitForPlayerEvents(
player,
[
{ type: PlayerEventType.AD_EVENT, subType: AdEventType.AD_BREAK_BEGIN } as AdEvent,
{ type: PlayerEventType.AD_EVENT, subType: AdEventType.AD_BEGIN } as AdEvent,
],
true,
{ timeout: 60000 },
);

// Start autoplay
player.autoplay = true;
Expand Down

0 comments on commit 2e45f48

Please sign in to comment.