diff --git a/playwright/spa-helpers.ts b/playwright/spa-helpers.ts index 648f6e6e..e909cb6a 100644 --- a/playwright/spa-helpers.ts +++ b/playwright/spa-helpers.ts @@ -119,11 +119,10 @@ async function setRtcModeFromSettings( async function expectVideoTilesCount(page: Page, count: number): Promise { await expect(page.getByTestId("videoTile")).toHaveCount(2); - // There are no other options than to wait for all media to be ready? - // Or it is too flaky :/ - await page.waitForTimeout(3000); // No one should be waiting for media - await expect(page.getByText("Waiting for media...")).not.toBeVisible(); + await expect(page.getByText("Waiting for media...")).not.toBeVisible({ + timeout: 10000, + }); // There should be 5 video elements, visible and autoplaying const videoElements = await page.locator("video").all(); diff --git a/playwright/widget/simple-create.spec.ts b/playwright/widget/simple-create.spec.ts index c8fb8013..b01bdd3b 100644 --- a/playwright/widget/simple-create.spec.ts +++ b/playwright/widget/simple-create.spec.ts @@ -81,7 +81,7 @@ widgetTest("Start a new call as widget", async ({ asWidget, browserName }) => { .locator('iframe[title="Element Call"]') .contentFrame() .getByTestId("incall_leave") - .click(); + .click({ timeout: 10000 }); await expect(whistler.page.locator(".mx_BasicMessageComposer")).toBeVisible(); await expect(brooks.page.locator(".mx_BasicMessageComposer")).toBeVisible(); diff --git a/playwright/widget/test-helpers.ts b/playwright/widget/test-helpers.ts index e37e4b5b..9f60e2d5 100644 --- a/playwright/widget/test-helpers.ts +++ b/playwright/widget/test-helpers.ts @@ -59,7 +59,9 @@ export class TestHelpers { ): Promise { // This is the header button that notifies about an ongoing call const label = audioOnly ? "Voice call started" : "Video call started"; - await expect(page.getByText(label)).toBeVisible(); + await expect(page.getByText(label)).toBeVisible({ + timeout: 10000, + }); await expect(page.getByRole("button", { name: "Join" })).toBeVisible(); await page.getByRole("button", { name: "Join" }).click(); } @@ -97,7 +99,9 @@ export class TestHelpers { const page = await userContext.newPage(); await page.goto(host); - await page.getByRole("link", { name: "Sign in" }).click(); + await page.getByRole("link", { name: "Sign in" }).click({ + timeout: 10000, + }); await page.getByRole("textbox", { name: "Username" }).fill(username); await page.getByRole("textbox", { name: "Password" }).fill(PASSWORD);