web: Wait until the player is fully ready, for tests
This commit is contained in:
parent
dda7411589
commit
1712cd61e5
|
@ -74,8 +74,13 @@ export async function playAndMonitor(
|
||||||
await browser.waitUntil(
|
await browser.waitUntil(
|
||||||
async () =>
|
async () =>
|
||||||
(await hasError(browser)) ||
|
(await hasError(browser)) ||
|
||||||
// @ts-expect-error TS2341
|
(await browser.execute(
|
||||||
(await browser.execute((player) => player.instance, player)),
|
(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",
|
timeoutMsg: "Expected player to have initialized",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue