Create new snapshot tests

This commit is contained in:
Half-Shot 2025-06-23 08:57:19 +01:00
parent 782921f5ac
commit 2c416f7e7b
2 changed files with 34 additions and 1 deletions

View File

@ -11,7 +11,7 @@ import { test, expect } from "../../element-web-test";
test.describe("Create Room", () => {
test.use({ displayName: "Jim" });
test("should allow us to create a public room with name, topic & address set", async ({ page, user, app }) => {
test("should allow us to create a public room with name, topic & address set", { tag: "@screenshot" }, async ({ page, user, app }) => {
const name = "Test room 1";
const topic = "This room is dedicated to this test and this test only!";
@ -26,6 +26,8 @@ test.describe("Create Room", () => {
await dialog.getByRole("textbox", { name: "Room address" }).fill("test-room-1");
// Submit
await dialog.getByRole("button", { name: "Create room" }).click();
await expect(dialog).toMatchScreenshot("create-room.png");
await expect(page).toHaveURL(new RegExp(`/#/room/#test-room-1:${user.homeServer}`));
const header = page.locator(".mx_RoomHeader");

View File

@ -0,0 +1,31 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2023 Suguru Hirahara
Copyright 2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE files in the repository root for full details.
*/
import { test, expect } from "../../element-web-test";
test.describe("Decline and block invite dialog", function () {
test.use({
displayName: "Hanako",
botCreateOpts: {
displayName: "BotAlice",
},
});
const botName = "BotAlice";
test("should support rejecting a user invite", { tag: "@screenshot" }, async ({ page, app, user, bot }) => {
// Create and view a room
await bot.createRoom({ name: "Test Room", invite: [user.userId] });
await app.viewRoomByName("Test Room");
await page.getByRole("button", { name: "Decline and block" }).click();
// Take a snapshot of the invite dialog with a user pill
await expect(page.locator(".mx_Dialog")).toMatchScreenshot("decline-and-block-invite-empty.png");
});
});