From 1b9682869aa2007c8711ff1b37c8b4866e2878a3 Mon Sep 17 00:00:00 2001 From: Valere Date: Wed, 22 Apr 2026 17:25:14 +0200 Subject: [PATCH] adjust timeouts --- playwright/widget/federated-call.test.ts | 11 ++++++----- playwright/widget/huddle-call.test.ts | 4 +++- playwright/widget/pip-call.test.ts | 4 +++- playwright/widget/simple-create.spec.ts | 8 ++++++-- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/playwright/widget/federated-call.test.ts b/playwright/widget/federated-call.test.ts index 2b17a706..7685e486 100644 --- a/playwright/widget/federated-call.test.ts +++ b/playwright/widget/federated-call.test.ts @@ -59,13 +59,14 @@ modePairs.forEach(([rtcMode1, rtcMode2]) => { const frame = user.page .locator('iframe[title="Element Call"]') .contentFrame(); - await expect(frame.getByTestId("videoTile")).toHaveCount(2); + await expect(frame.getByTestId("videoTile")).toHaveCount(2, { + timeout: 10000, + }); - // There are no other options than to wait for all media to be ready? - // Or it is too flaky :/ - await user.page.waitForTimeout(3000); // No one should be waiting for media - await expect(frame.getByText("Waiting for media...")).not.toBeVisible(); + await expect(frame.getByText("Waiting for media...")).not.toBeVisible({ + timeout: 10000, + }); // There should be 2 video elements, visible and autoplaying const videoElements = await frame.locator("video").all(); diff --git a/playwright/widget/huddle-call.test.ts b/playwright/widget/huddle-call.test.ts index ce4b9be7..ec3c816a 100644 --- a/playwright/widget/huddle-call.test.ts +++ b/playwright/widget/huddle-call.test.ts @@ -63,7 +63,9 @@ widgetTest("Create and join a group call", async ({ addUser, browserName }) => { .contentFrame(); await expect( frame.getByRole("switch", { name: "Stop video", checked: true }), - ).toBeVisible(); + ).toBeVisible({ + timeout: 10000, + }); }), ); diff --git a/playwright/widget/pip-call.test.ts b/playwright/widget/pip-call.test.ts index def2c088..4abee3cf 100644 --- a/playwright/widget/pip-call.test.ts +++ b/playwright/widget/pip-call.test.ts @@ -64,8 +64,10 @@ widgetTest("Put call in PIP", async ({ addUser, browserName }) => { const frame = valere.page .locator('iframe[title="Element Call"]') .contentFrame(); + + await expect(frame.locator("video")).toHaveCount(1, { timeout: 10000 }); + const videoElements = await frame.locator("video").all(); - expect(videoElements.length).toBe(1); const pipVideo = videoElements[0]; await expect(pipVideo).toHaveCSS("object-fit", "cover"); diff --git a/playwright/widget/simple-create.spec.ts b/playwright/widget/simple-create.spec.ts index a7ad8208..86324eeb 100644 --- a/playwright/widget/simple-create.spec.ts +++ b/playwright/widget/simple-create.spec.ts @@ -83,6 +83,10 @@ widgetTest("Start a new call as widget", async ({ asWidget, browserName }) => { .getByTestId("incall_leave") .click({ timeout: 15000 }); - await expect(whistler.page.locator(".mx_BasicMessageComposer")).toBeVisible(); - await expect(brooks.page.locator(".mx_BasicMessageComposer")).toBeVisible(); + await expect(whistler.page.locator(".mx_BasicMessageComposer")).toBeVisible({ + timeout: 10000, + }); + await expect(brooks.page.locator(".mx_BasicMessageComposer")).toBeVisible({ + timeout: 10000, + }); });