Add playwright test for hotswatpping transport

This commit is contained in:
Timo K
2026-01-16 14:27:32 +01:00
parent 5c366320cb
commit 22c1948a82
3 changed files with 132 additions and 5 deletions

View File

@@ -207,14 +207,29 @@ export class TestHelpers {
* Opens the widget and then goes to the settings to set the RTC mode.
* then closes the widget lobby.
*
* intended to be used before joining!
*
* WORKS IF A ROOM IS CURRENTLY OPENED IN THE PAGE
*/
public static async setEmbeddedElementCallRtcMode(
public static async openWidgetSetEmbeddedElementCallRtcModeCloseWidget(
page: Page,
mode: RtcMode,
): Promise<void> {
await page.getByRole("button", { name: "Video call" }).click();
await page.getByRole("menuitem", { name: "Element Call" }).click();
await TestHelpers.setEmbeddedElementCallRtcMode(page, mode);
await page.getByRole("button", { name: "Close lobby" }).click();
}
/**
* Goes to the settings to set the RTC mode.
* then closes the settings modal.
*
* WORKS IF A ROOM IS CURRENTLY SHOWING THE EC WIDGET
*/
public static async setEmbeddedElementCallRtcMode(
page: Page,
mode: RtcMode,
): Promise<void> {
const iframe = page.locator('iframe[title="Element Call"]').contentFrame();
await iframe.getByRole("button", { name: "Settings" }).click();
@@ -234,7 +249,6 @@ export class TestHelpers {
await iframe.getByText("Compatibility: state events").click();
}
await iframe.getByTestId("modal_close").click();
await page.getByRole("button", { name: "Close lobby" }).click();
}
/**