Test all pairs of rtc mode in federated calls
This commit is contained in:
@@ -8,10 +8,18 @@ Please see LICENSE in the repository root for full details.
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
import { widgetTest } from "../fixtures/widget-user";
|
||||
import { HOST1, HOST2, TestHelpers } from "./test-helpers";
|
||||
import { HOST1, HOST2, type RtcMode, TestHelpers } from "./test-helpers";
|
||||
|
||||
widgetTest(
|
||||
"Test federated call default rtc mode",
|
||||
const modePairs: [RtcMode, RtcMode][] = [
|
||||
["compat", "compat"],
|
||||
["legacy", "legacy"],
|
||||
["legacy", "compat"],
|
||||
["compat", "legacy"],
|
||||
];
|
||||
|
||||
modePairs.forEach(([rtcMode1, rtcMode2]) => {
|
||||
widgetTest(
|
||||
`Test federated call with rtc modes ${rtcMode1} and ${rtcMode2}`,
|
||||
async ({ addUser, browserName }) => {
|
||||
test.skip(
|
||||
browserName === "firefox",
|
||||
@@ -29,8 +37,8 @@ widgetTest(
|
||||
|
||||
await florian.page.pause();
|
||||
|
||||
await TestHelpers.setEmbeddedElementCallRtcMode(florian.page, "legacy");
|
||||
await TestHelpers.setEmbeddedElementCallRtcMode(timo.page, "compat");
|
||||
await TestHelpers.setEmbeddedElementCallRtcMode(florian.page, rtcMode1);
|
||||
await TestHelpers.setEmbeddedElementCallRtcMode(timo.page, rtcMode2);
|
||||
|
||||
await TestHelpers.startCallInCurrentRoom(florian.page, false);
|
||||
await TestHelpers.joinCallFromLobby(florian.page);
|
||||
@@ -68,4 +76,5 @@ widgetTest(
|
||||
|
||||
// await florian.page.pause();
|
||||
},
|
||||
);
|
||||
);
|
||||
});
|
||||
|
||||
@@ -18,6 +18,8 @@ const PASSWORD = "foobarbaz1!";
|
||||
export const HOST1 = "https://app.m.localhost/#/welcome";
|
||||
export const HOST2 = "https://app.othersite.m.localhost/#/welcome";
|
||||
|
||||
export type RtcMode = "legacy" | "compat" | "2_0";
|
||||
|
||||
export class TestHelpers {
|
||||
public static async startCallInCurrentRoom(
|
||||
page: Page,
|
||||
@@ -183,7 +185,7 @@ export class TestHelpers {
|
||||
*/
|
||||
public static async setEmbeddedElementCallRtcMode(
|
||||
page: Page,
|
||||
mode: "legacy" | "compat" | "2_0",
|
||||
mode: RtcMode,
|
||||
): Promise<void> {
|
||||
await page.getByRole("button", { name: "Video call" }).click();
|
||||
await page.getByRole("menuitem", { name: "Element Call" }).click();
|
||||
@@ -197,9 +199,9 @@ export class TestHelpers {
|
||||
|
||||
// Move to Developer tab now
|
||||
await iframe.getByRole("tab", { name: "Developer" }).click();
|
||||
if (mode === "legacy") {
|
||||
if (mode == "legacy") {
|
||||
await iframe.getByText("Legacy: state events").click();
|
||||
} else if (mode === "2_0") {
|
||||
} else if (mode == "2_0") {
|
||||
await iframe.getByText("Matrix 2.0").click();
|
||||
} else {
|
||||
// compat
|
||||
|
||||
Reference in New Issue
Block a user