Playwright test for history sharing on invite (#30948)

* Playwright: `getCurrentRoomIdFromUrl`

Helper function to fish a room ID out of the URL

* Playwright: use updated `Credentials` class from common lib

Pick up the extended `Credentials` interface that was added in
https://github.com/element-hq/element-modules/pull/80.

* Playwright: use `routeConfigJson` from common lib

https://github.com/element-hq/element-modules/pull/81 added a utility function
for building and routing `config.json`; we should use it.

* Playwright test for history sharing on invite

Fixes https://github.com/element-hq/element-meta/issues/2920

* Avoid use of CSS in playwright locators
This commit is contained in:
Richard van der Hoff
2025-10-08 10:49:11 +01:00
committed by GitHub
parent 0fcc4d15c8
commit 4a0e8d661f
9 changed files with 102 additions and 35 deletions
@@ -27,8 +27,7 @@ test.describe("Create Knock Room", () => {
await expect(page.locator(".mx_RoomHeader").getByText("Cybersecurity")).toBeVisible();
const urlHash = await page.evaluate(() => window.location.hash);
const roomId = urlHash.replace("#/room/", "");
const roomId = await app.getCurrentRoomIdFromUrl();
// Room should have a knock join rule
await waitForRoom(page, app.client, roomId, (room) => {
@@ -44,8 +43,7 @@ test.describe("Create Knock Room", () => {
await expect(page.locator(".mx_RoomHeader").getByText("Cybersecurity")).toBeVisible();
const urlHash = await page.evaluate(() => window.location.hash);
const roomId = urlHash.replace("#/room/", "");
const roomId = await app.getCurrentRoomIdFromUrl();
await app.settings.openRoomSettings("Security & Privacy");
@@ -70,8 +68,7 @@ test.describe("Create Knock Room", () => {
await expect(page.locator(".mx_RoomHeader").getByText("Cybersecurity")).toBeVisible();
const urlHash = await page.evaluate(() => window.location.hash);
const roomId = urlHash.replace("#/room/", "");
const roomId = await app.getCurrentRoomIdFromUrl();
// Room should have a knock join rule
await waitForRoom(page, app.client, roomId, (room) => {