diff --git a/playwright/e2e/share-dialog/index.ts b/playwright/e2e/share-dialog/index.ts deleted file mode 100644 index 5a7cc9edb1d..00000000000 --- a/playwright/e2e/share-dialog/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2024 New Vector Ltd. - * - * SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only - * Please see LICENSE files in the repository root for full details. - */ - -import { test as base } from "../../element-web-test"; - -/** - * Set up for share dialog tests. - */ -export const test = base.extend<{ - roomName?: string; -}>({ - displayName: "Alice", - botCreateOpts: { displayName: "Other User" }, - - roomName: "Alice room", - room: async ({ roomName: name, app, user, bot }, use) => { - const roomId = await app.client.createRoom({ name, invite: [bot.credentials.userId] }); - await use({ roomId }); - }, -}); diff --git a/playwright/e2e/share-dialog/share-dialog.spec.ts b/playwright/e2e/share-dialog/share-dialog.spec.ts index 694639846e1..2999b74ca03 100644 --- a/playwright/e2e/share-dialog/share-dialog.spec.ts +++ b/playwright/e2e/share-dialog/share-dialog.spec.ts @@ -5,10 +5,17 @@ * Please see LICENSE files in the repository root for full details. */ -import { test } from "./index.ts"; -import { expect } from "../../element-web-test"; +import { test, expect } from "../../element-web-test"; test.describe("Share dialog", () => { + test.use({ + displayName: "Alice", + room: async ({ app, user, bot }, use) => { + const roomId = await app.client.createRoom({ name: "Alice room" }); + await use({ roomId }); + }, + }); + test("should share a room", async ({ page, app, room }) => { await app.viewRoomById(room.roomId); await app.toggleRoomInfoPanel(); @@ -18,7 +25,7 @@ test.describe("Share dialog", () => { await expect(dialog.getByText(`https://matrix.to/#/${room.roomId}`)).toBeVisible(); expect(dialog).toMatchScreenshot("share-dialog-room.png", { // QRCode and url changes at every run - mask: [page.locator(".mx_ShareDialog_top")], + mask: [page.locator(".mx_QRCode"), page.locator(".mx_ShareDialog_top > span")], }); }); @@ -52,7 +59,7 @@ test.describe("Share dialog", () => { await expect(dialog.getByRole("checkbox", { name: "Link to selected message" })).toBeChecked(); expect(dialog).toMatchScreenshot("share-dialog-event.png", { // QRCode and url changes at every run - mask: [page.locator(".mx_ShareDialog_top")], + mask: [page.locator(".mx_QRCode"), page.locator(".mx_ShareDialog_top > span")], }); await dialog.getByRole("checkbox", { name: "Link to selected message" }).click(); await expect(dialog.getByRole("checkbox", { name: "Link to selected message" })).not.toBeChecked(); diff --git a/playwright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-event-linux.png b/playwright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-event-linux.png index 8841810e32a..2f703cfc8ac 100644 Binary files a/playwright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-event-linux.png and b/playwright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-event-linux.png differ diff --git a/playwright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-room-linux.png b/playwright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-room-linux.png index ee0db924180..725e095f6f9 100644 Binary files a/playwright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-room-linux.png and b/playwright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-room-linux.png differ