Skip to content

Commit 2606f35

Browse files
committed
test(e2e): add example tests
1 parent e8ed3a1 commit 2606f35

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright 2025 New Vector Ltd.
3+
*
4+
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
5+
* Please see LICENSE files in the repository root for full details.
6+
*/
7+
8+
import { type Page } from "@playwright/test";
9+
10+
import { test, expect } from "../../../element-web-test";
11+
12+
test.describe("Room list", () => {
13+
test.use({
14+
// labsFlags: ["feature_new_room_list"],
15+
});
16+
17+
/**
18+
* Get the room list
19+
* @param page
20+
*/
21+
function getRoomList(page: Page) {
22+
return page.getByTestId("room-list");
23+
}
24+
25+
test.beforeEach(async ({ page, app, user }) => {
26+
// The notification toast is displayed above the search section
27+
await app.closeNotificationToast();
28+
for (let i = 0; i < 30; i++) {
29+
await app.client.createRoom({ name: `room${i}` });
30+
}
31+
});
32+
33+
test("should render the legacy room list", { tag: "@screenshot" }, async ({ page, app, user }) => {
34+
const roomListView = page.locator(".mx_LeftPanel_roomListWrapper");
35+
await expect(roomListView).toMatchScreenshot("room-list-legacy.png");
36+
});
37+
38+
test.describe("Room list search", () => {
39+
test.use({ labsFlags: ["feature_new_room_list"] });
40+
41+
test("should render the room list", { tag: "@screenshot" }, async ({ page, app, user }) => {
42+
const roomListView = getRoomList(page);
43+
await expect(roomListView).toMatchScreenshot("room-list.png");
44+
});
45+
});
46+
});
20.8 KB
Loading
1.7 KB
Loading

0 commit comments

Comments
 (0)