mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-08 20:09:19 +00:00
Merge pull request #3830 from element-hq/valere/tmp_fix_download_file_permission
Workaround: EW has not yet merged the download file permission for EC
This commit is contained in:
@@ -8,6 +8,7 @@ Please see LICENSE in the repository root for full details.
|
|||||||
import { expect, test } from "@playwright/test";
|
import { expect, test } from "@playwright/test";
|
||||||
|
|
||||||
import { widgetTest } from "../fixtures/widget-user.ts";
|
import { widgetTest } from "../fixtures/widget-user.ts";
|
||||||
|
import { TestHelpers } from "./test-helpers.ts";
|
||||||
|
|
||||||
// Skip test, including Fixtures
|
// Skip test, including Fixtures
|
||||||
widgetTest.skip(
|
widgetTest.skip(
|
||||||
@@ -20,19 +21,7 @@ widgetTest("Start a new call as widget", async ({ asWidget, browserName }) => {
|
|||||||
|
|
||||||
const { brooks, whistler } = asWidget;
|
const { brooks, whistler } = asWidget;
|
||||||
|
|
||||||
await expect(
|
await TestHelpers.startCallInCurrentRoom(brooks.page, false);
|
||||||
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 expect(
|
await expect(
|
||||||
brooks.page
|
brooks.page
|
||||||
@@ -56,11 +45,7 @@ widgetTest("Start a new call as widget", async ({ asWidget, browserName }) => {
|
|||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
|
||||||
// Join from the other side
|
// Join from the other side
|
||||||
await expect(whistler.page.getByText("Video call started")).toBeVisible();
|
await TestHelpers.joinCallInCurrentRoom(whistler.page);
|
||||||
await expect(
|
|
||||||
whistler.page.getByRole("button", { name: "Join" }),
|
|
||||||
).toBeVisible();
|
|
||||||
await whistler.page.getByRole("button", { name: "Join" }).click();
|
|
||||||
|
|
||||||
// Currently disabled due to recent Element Web is bypassing Lobby
|
// Currently disabled due to recent Element Web is bypassing Lobby
|
||||||
// await expect(
|
// await expect(
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ export class TestHelpers {
|
|||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
|
||||||
await page.getByRole("menuitem", { name: "Element 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async joinCallFromLobby(page: Page): Promise<void> {
|
public static async joinCallFromLobby(page: Page): Promise<void> {
|
||||||
@@ -60,6 +63,9 @@ export class TestHelpers {
|
|||||||
await expect(page.getByText(label)).toBeVisible();
|
await expect(page.getByText(label)).toBeVisible();
|
||||||
await expect(page.getByRole("button", { name: "Join" })).toBeVisible();
|
await expect(page.getByRole("button", { name: "Join" })).toBeVisible();
|
||||||
await page.getByRole("button", { name: "Join" }).click();
|
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> {
|
): Promise<void> {
|
||||||
await page.getByRole("button", { name: "Video call" }).click();
|
await page.getByRole("button", { name: "Video call" }).click();
|
||||||
await page.getByRole("menuitem", { name: "Element 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 TestHelpers.setEmbeddedElementCallRtcMode(page, mode);
|
||||||
await page.getByRole("button", { name: "Close lobby" }).click();
|
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.
|
* Goes to the settings to set the RTC mode.
|
||||||
* then closes the settings modal.
|
* then closes the settings modal.
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ widgetTest(
|
|||||||
await expect(whistler.page.getByText("Incoming voice call")).toBeVisible();
|
await expect(whistler.page.getByText("Incoming voice call")).toBeVisible();
|
||||||
await whistler.page.getByRole("button", { name: "Accept" }).click();
|
await whistler.page.getByRole("button", { name: "Accept" }).click();
|
||||||
|
|
||||||
|
await TestHelpers.dismissFileDialogPermissionIfNeeded(whistler.page);
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
whistler.page.locator('iframe[title="Element Call"]'),
|
whistler.page.locator('iframe[title="Element Call"]'),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
@@ -138,6 +140,8 @@ widgetTest(
|
|||||||
await expect(whistler.page.getByText("Incoming video call")).toBeVisible();
|
await expect(whistler.page.getByText("Incoming video call")).toBeVisible();
|
||||||
await whistler.page.getByRole("button", { name: "Accept" }).click();
|
await whistler.page.getByRole("button", { name: "Accept" }).click();
|
||||||
|
|
||||||
|
await TestHelpers.dismissFileDialogPermissionIfNeeded(whistler.page);
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
whistler.page.locator('iframe[title="Element Call"]'),
|
whistler.page.locator('iframe[title="Element Call"]'),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
|||||||
Reference in New Issue
Block a user