diff --git a/playwright/spa-helpers.ts b/playwright/spa-helpers.ts index 1756959e..7a839791 100644 --- a/playwright/spa-helpers.ts +++ b/playwright/spa-helpers.ts @@ -124,7 +124,7 @@ async function expectVideoTilesCount(page: Page, count: number): Promise { timeout: 10000, }); - // There should be 5 video elements, visible and autoplaying + // There should be `count` video elements, visible and autoplaying await expect(page.locator("video")).toHaveCount(count); await expect diff --git a/playwright/widget/huddle-call.test.ts b/playwright/widget/huddle-call.test.ts index 7faba352..04418dcf 100644 --- a/playwright/widget/huddle-call.test.ts +++ b/playwright/widget/huddle-call.test.ts @@ -78,10 +78,13 @@ widgetTest("Create and join a group call", async ({ addUser, browserName }) => { await expect(frame.getByTestId("videoTile")).toHaveCount(5, { timeout: 15000, }); - for (const participant of [valere, timo, robin, halfshot, florian]) { - // Check the names are correct - await expect(frame.getByText(participant.displayName)).toBeVisible(); - } + + await Promise.all([ + [valere, timo, robin, halfshot, florian].map(async (user) => { + // Check the names are correct + expect(frame.getByText(participant.displayName)).toBeVisible(); + }), + ]); // No one should be waiting for media await expect(frame.getByText("Waiting for media...")).not.toBeVisible({ @@ -121,9 +124,6 @@ widgetTest("Create and join a group call", async ({ addUser, browserName }) => { }); // out of 5 ONLY 4 are visible (display:block) !! - // XXX we need to be better at our HTML markup and accessibility, it would make - // this kind of stuff way easier to test if we could look out for aria attributes. - // ✅ Retryable assertion for visible videos await TestHelpers.expectVisibleVideoCount(frame, 4); } }); diff --git a/playwright/widget/test-helpers.ts b/playwright/widget/test-helpers.ts index 4dd14fb1..b47588ce 100644 --- a/playwright/widget/test-helpers.ts +++ b/playwright/widget/test-helpers.ts @@ -365,7 +365,8 @@ export class TestHelpers { frame: FrameLocator, count: number, ): Promise { - // ✅ Retryable assertion for visible videos + // XXX we need to be better at our HTML markup and accessibility, it would make + // this kind of stuff way easier to test if we could look out for aria attributes. await expect .poll( async () => {