Skip to content

Commit

Permalink
Update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros committed Dec 2, 2024
1 parent 41c2d15 commit f098261
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 28 deletions.
24 changes: 0 additions & 24 deletions playwright/e2e/share-dialog/index.ts

This file was deleted.

15 changes: 11 additions & 4 deletions playwright/e2e/share-dialog/share-dialog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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")],
});
});

Expand Down Expand Up @@ -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();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f098261

Please sign in to comment.