In lifecycle tests, dismiss the Verify toast if it appears (#252)

Depend on @element-hq/element-web-playwright-common v3.1.0 to provide the `toasts` fixture.
This commit is contained in:
Andy Balaam
2026-04-14 14:36:53 +01:00
committed by GitHub
parent 37e939f96c
commit ddb873a370
@@ -63,7 +63,9 @@ test.describe("Widget Lifecycle", () => {
},
});
test("auto-approves preload and identity", async ({ page, user, homeserver }, testInfo) => {
test("auto-approves preload and identity", async ({ page, user, homeserver, toasts }, testInfo) => {
toasts.rejectToastIfExists("Verify this device");
// A bot creates a room with the widget pinned to the top panel, then invites the test user.
// Because the widget was added by a different user (the bot), Element would normally show a
// preload consent dialog before loading it — this test verifies that dialog is skipped.
@@ -119,7 +121,9 @@ test.describe("Widget Lifecycle", () => {
).toBeVisible();
});
test("prompts for capabilities not in the allowlist", async ({ page, user, homeserver }, testInfo) => {
test("prompts for capabilities not in the allowlist", async ({ page, user, homeserver, toasts }, testInfo) => {
toasts.rejectToastIfExists("Verify this device");
const bot = await homeserver.registerUser(`bot_${testInfo.testId}`, "password", "Bot");
const { room_id: roomId } = await homeserver.csApi.request<{ room_id: string }>(
"POST",
@@ -180,7 +184,10 @@ test.describe("Widget Lifecycle", () => {
page,
user,
homeserver,
toasts,
}, testInfo) => {
toasts.rejectToastIfExists("Verify this device");
const bot = await homeserver.registerUser(`bot_${testInfo.testId}`, "password", "Bot");
const { room_id: roomId } = await homeserver.csApi.request<{ room_id: string }>(
"POST",