Skip to content

Commit

Permalink
web: Wait until the player is fully ready, for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinnerbone committed May 28, 2024
1 parent dda7411 commit 1712cd6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions web/packages/selfhosted/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@ export async function playAndMonitor(
await browser.waitUntil(
async () =>
(await hasError(browser)) ||
// @ts-expect-error TS2341
(await browser.execute((player) => player.instance, player)),
(await browser.execute(
(player) =>
// https://github.com/webdriverio/webdriverio/issues/6486
// TODO: How can we import ReadyState enum?
(player as unknown as RufflePlayer).readyState === 2,
player,
)),
{
timeoutMsg: "Expected player to have initialized",
},
Expand Down

0 comments on commit 1712cd6

Please sign in to comment.