From b68f4d5fa5976648f050962653c0f1c690370eff Mon Sep 17 00:00:00 2001 From: Valere Date: Tue, 29 Apr 2025 16:08:45 +0200 Subject: [PATCH] test: Temporary disable widget test on firefox --- playwright/widget/simple-create.spec.ts | 179 +++++++++++++----------- 1 file changed, 95 insertions(+), 84 deletions(-) diff --git a/playwright/widget/simple-create.spec.ts b/playwright/widget/simple-create.spec.ts index 3712f5c4..e496b603 100644 --- a/playwright/widget/simple-create.spec.ts +++ b/playwright/widget/simple-create.spec.ts @@ -9,89 +9,100 @@ import { expect, test } from "@playwright/test"; import { widgetTest } from "../fixtures/widget-user.ts"; -widgetTest("Start a new call as widget", async ({ asWidget, browserName }) => { - test.skip( - browserName === "firefox", - "This test is not working on firefox, after hangup brooks is locked in a strange state with a blank widget", +test.describe("chromium only", () => { + test.skip(({ browserName }) => browserName !== "chromium", "Chromium only!"); + + widgetTest( + "Start a new call as widget", + async ({ asWidget, browserName }) => { + test.skip( + browserName === "firefox", + "This test is not working on firefox, after hangup brooks is locked in a strange state with a blank widget", + ); + + 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 expect( + brooks.page + .locator('iframe[title="Element Call"]') + .contentFrame() + .getByTestId("lobby_joinCall"), + ).toBeVisible(); + + await brooks.page + .locator('iframe[title="Element Call"]') + .contentFrame() + .getByTestId("lobby_joinCall") + .click(); + + // Check the join indicator on the room list + await expect( + brooks.page.locator("div").filter({ hasText: /^Joined • 1$/ }), + ).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 expect( + whistler.page + .locator('iframe[title="Element Call"]') + .contentFrame() + .getByTestId("lobby_joinCall"), + ).toBeVisible(); + + await whistler.page + .locator('iframe[title="Element Call"]') + .contentFrame() + .getByTestId("lobby_joinCall") + .click(); + + await expect( + whistler.page.locator("div").filter({ hasText: /^Joined • 2$/ }), + ).toBeVisible(); + + await expect( + brooks.page.locator("div").filter({ hasText: /^Joined • 2$/ }), + ).toBeVisible(); + + // Whistler leaves + await whistler.page.waitForTimeout(1000); + await whistler.page + .locator('iframe[title="Element Call"]') + .contentFrame() + .getByTestId("incall_leave") + .click(); + + // Brooks leaves + await brooks.page + .locator('iframe[title="Element Call"]') + .contentFrame() + .getByTestId("incall_leave") + .click(); + + await expect( + whistler.page.locator(".mx_BasicMessageComposer"), + ).toBeVisible(); + await expect( + brooks.page.locator(".mx_BasicMessageComposer"), + ).toBeVisible(); + }, ); - - 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 expect( - brooks.page - .locator('iframe[title="Element Call"]') - .contentFrame() - .getByTestId("lobby_joinCall"), - ).toBeVisible(); - - await brooks.page - .locator('iframe[title="Element Call"]') - .contentFrame() - .getByTestId("lobby_joinCall") - .click(); - - // Check the join indicator on the room list - await expect( - brooks.page.locator("div").filter({ hasText: /^Joined • 1$/ }), - ).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 expect( - whistler.page - .locator('iframe[title="Element Call"]') - .contentFrame() - .getByTestId("lobby_joinCall"), - ).toBeVisible(); - - await whistler.page - .locator('iframe[title="Element Call"]') - .contentFrame() - .getByTestId("lobby_joinCall") - .click(); - - await expect( - whistler.page.locator("div").filter({ hasText: /^Joined • 2$/ }), - ).toBeVisible(); - - await expect( - brooks.page.locator("div").filter({ hasText: /^Joined • 2$/ }), - ).toBeVisible(); - - // Whistler leaves - await whistler.page.waitForTimeout(1000); - await whistler.page - .locator('iframe[title="Element Call"]') - .contentFrame() - .getByTestId("incall_leave") - .click(); - - // Brooks leaves - await brooks.page - .locator('iframe[title="Element Call"]') - .contentFrame() - .getByTestId("incall_leave") - .click(); - - await expect(whistler.page.locator(".mx_BasicMessageComposer")).toBeVisible(); - await expect(brooks.page.locator(".mx_BasicMessageComposer")).toBeVisible(); });