From 0dabb43e0fc4d619304a7d9ce4c554e0ddcdd833 Mon Sep 17 00:00:00 2001 From: Valere Date: Tue, 31 Mar 2026 14:56:25 +0200 Subject: [PATCH 1/3] Workaround: EW has not yet merged the download file permission for EC --- playwright/widget/test-helpers.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/playwright/widget/test-helpers.ts b/playwright/widget/test-helpers.ts index 630681bd..38d34304 100644 --- a/playwright/widget/test-helpers.ts +++ b/playwright/widget/test-helpers.ts @@ -34,6 +34,9 @@ export class TestHelpers { ).toBeVisible(); await page.getByRole("menuitem", { name: "Element Call" }).click(); + + // TODO: Remove as soon as web merges https://github.com/element-hq/element-web/pull/32755 + await this.dismissFileDialogPermissionIfNeeded(page); } public static async joinCallFromLobby(page: Page): Promise { @@ -60,6 +63,9 @@ export class TestHelpers { await expect(page.getByText(label)).toBeVisible(); await expect(page.getByRole("button", { name: "Join" })).toBeVisible(); await page.getByRole("button", { name: "Join" }).click(); + + // TODO: Remove as soon as web merges https://github.com/element-hq/element-web/pull/32755 + await this.dismissFileDialogPermissionIfNeeded(page); } /** @@ -235,9 +241,30 @@ export class TestHelpers { ): Promise { await page.getByRole("button", { name: "Video call" }).click(); await page.getByRole("menuitem", { name: "Element Call" }).click(); + + // TODO: Remove as soon as web merges https://github.com/element-hq/element-web/pull/32755 + await this.dismissFileDialogPermissionIfNeeded(page); + await TestHelpers.setEmbeddedElementCallRtcMode(page, mode); await page.getByRole("button", { name: "Close lobby" }).click(); } + + // TODO: Remove as soon as web merges https://github.com/element-hq/element-web/pull/32755 + private static async dismissFileDialogPermissionIfNeeded( + page: Page, + ): Promise { + const dialogHeading = page.getByRole("heading", { + name: "Approve widget permissions", + }); + + try { + await expect(dialogHeading).toBeVisible({ timeout: 3000 }); + await page.getByRole("button", { name: "Approve" }).click(); + } catch { + // Dialog did not appear, that's fine + } + } + /** * Goes to the settings to set the RTC mode. * then closes the settings modal. From c9242148f99218da2a13fa3fcfd43db884a6ef11 Mon Sep 17 00:00:00 2001 From: Valere Date: Tue, 31 Mar 2026 15:24:12 +0200 Subject: [PATCH 2/3] add missing dismiss dialog test --- playwright/widget/test-helpers.ts | 2 +- playwright/widget/voice-call-dm.spec.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/playwright/widget/test-helpers.ts b/playwright/widget/test-helpers.ts index 38d34304..31247e1a 100644 --- a/playwright/widget/test-helpers.ts +++ b/playwright/widget/test-helpers.ts @@ -250,7 +250,7 @@ export class TestHelpers { } // TODO: Remove as soon as web merges https://github.com/element-hq/element-web/pull/32755 - private static async dismissFileDialogPermissionIfNeeded( + public static async dismissFileDialogPermissionIfNeeded( page: Page, ): Promise { const dialogHeading = page.getByRole("heading", { diff --git a/playwright/widget/voice-call-dm.spec.ts b/playwright/widget/voice-call-dm.spec.ts index a4e6255b..f5152e1f 100644 --- a/playwright/widget/voice-call-dm.spec.ts +++ b/playwright/widget/voice-call-dm.spec.ts @@ -45,6 +45,8 @@ widgetTest( await expect(whistler.page.getByText("Incoming voice call")).toBeVisible(); await whistler.page.getByRole("button", { name: "Accept" }).click(); + await TestHelpers.dismissFileDialogPermissionIfNeeded(whistler.page); + await expect( whistler.page.locator('iframe[title="Element Call"]'), ).toBeVisible(); @@ -138,6 +140,8 @@ widgetTest( await expect(whistler.page.getByText("Incoming video call")).toBeVisible(); await whistler.page.getByRole("button", { name: "Accept" }).click(); + await TestHelpers.dismissFileDialogPermissionIfNeeded(whistler.page); + await expect( whistler.page.locator('iframe[title="Element Call"]'), ).toBeVisible(); From d5ec3c342c6bd08c2bbe6453de171bce1963e7ff Mon Sep 17 00:00:00 2001 From: Valere Date: Tue, 31 Mar 2026 16:06:56 +0200 Subject: [PATCH 3/3] reuse exisiting helpers to join call --- playwright/widget/simple-create.spec.ts | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/playwright/widget/simple-create.spec.ts b/playwright/widget/simple-create.spec.ts index 8c889892..4686e99d 100644 --- a/playwright/widget/simple-create.spec.ts +++ b/playwright/widget/simple-create.spec.ts @@ -8,6 +8,7 @@ Please see LICENSE in the repository root for full details. import { expect, test } from "@playwright/test"; import { widgetTest } from "../fixtures/widget-user.ts"; +import { TestHelpers } from "./test-helpers.ts"; // Skip test, including Fixtures widgetTest.skip( @@ -20,19 +21,7 @@ widgetTest("Start a new call as widget", async ({ asWidget, browserName }) => { const { brooks, whistler } = asWidget; - await expect( - brooks.page.getByRole("button", { name: "Video call" }), - ).toBeVisible(); - await brooks.page.getByRole("button", { name: "Video call" }).click(); - - await expect( - brooks.page.getByRole("menuitem", { name: "Legacy Call" }), - ).toBeVisible(); - await expect( - brooks.page.getByRole("menuitem", { name: "Element Call" }), - ).toBeVisible(); - - await brooks.page.getByRole("menuitem", { name: "Element Call" }).click(); + await TestHelpers.startCallInCurrentRoom(brooks.page, false); await expect( brooks.page @@ -56,11 +45,7 @@ widgetTest("Start a new call as widget", async ({ asWidget, browserName }) => { ).toBeVisible(); // Join from the other side - await expect(whistler.page.getByText("Video call started")).toBeVisible(); - await expect( - whistler.page.getByRole("button", { name: "Join" }), - ).toBeVisible(); - await whistler.page.getByRole("button", { name: "Join" }).click(); + await TestHelpers.joinCallInCurrentRoom(whistler.page); // Currently disabled due to recent Element Web is bypassing Lobby // await expect(