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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user