Merge branch 'livekit' into valere/fix/stop_calling_msc4143_in_widget

This commit is contained in:
Valere
2026-03-31 17:15:08 +02:00
3 changed files with 34 additions and 18 deletions

View File

@@ -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(

View File

@@ -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<void> {
@@ -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<void> {
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
public static async dismissFileDialogPermissionIfNeeded(
page: Page,
): Promise<void> {
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.

View File

@@ -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();