Skip to content

Commit 811f769

Browse files
authored
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.
1 parent dde357e commit 811f769

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

modules/widget-lifecycle/element-web/e2e/widget-lifecycle.spec.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ test.describe("Widget Lifecycle", () => {
6363
},
6464
});
6565

66-
test("auto-approves preload and identity", async ({ page, user, homeserver }, testInfo) => {
66+
test("auto-approves preload and identity", async ({ page, user, homeserver, toasts }, testInfo) => {
67+
toasts.rejectToastIfExists("Verify this device");
68+
6769
// A bot creates a room with the widget pinned to the top panel, then invites the test user.
6870
// Because the widget was added by a different user (the bot), Element would normally show a
6971
// preload consent dialog before loading it — this test verifies that dialog is skipped.
@@ -119,7 +121,9 @@ test.describe("Widget Lifecycle", () => {
119121
).toBeVisible();
120122
});
121123

122-
test("prompts for capabilities not in the allowlist", async ({ page, user, homeserver }, testInfo) => {
124+
test("prompts for capabilities not in the allowlist", async ({ page, user, homeserver, toasts }, testInfo) => {
125+
toasts.rejectToastIfExists("Verify this device");
126+
123127
const bot = await homeserver.registerUser(`bot_${testInfo.testId}`, "password", "Bot");
124128
const { room_id: roomId } = await homeserver.csApi.request<{ room_id: string }>(
125129
"POST",
@@ -180,7 +184,10 @@ test.describe("Widget Lifecycle", () => {
180184
page,
181185
user,
182186
homeserver,
187+
toasts,
183188
}, testInfo) => {
189+
toasts.rejectToastIfExists("Verify this device");
190+
184191
const bot = await homeserver.registerUser(`bot_${testInfo.testId}`, "password", "Bot");
185192
const { room_id: roomId } = await homeserver.csApi.request<{ room_id: string }>(
186193
"POST",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@action-validator/cli": "^0.6.0",
2828
"@action-validator/core": "^0.6.0",
2929
"@element-hq/element-web-module-api": "*",
30-
"@element-hq/element-web-playwright-common": "^3.0.0",
30+
"@element-hq/element-web-playwright-common": "^3.1.0",
3131
"@playwright/test": "^1.52.0",
3232
"@stylistic/eslint-plugin": "^5.0.0",
3333
"@types/node": "^22.12.0",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,10 +552,10 @@
552552
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz#bbe12dca5b4ef983a0d0af4b07b9bc90ea0ababa"
553553
integrity sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==
554554

555-
"@element-hq/element-web-playwright-common@^3.0.0":
556-
version "3.0.0"
557-
resolved "https://registry.yarnpkg.com/@element-hq/element-web-playwright-common/-/element-web-playwright-common-3.0.0.tgz#67537b55013275538765cb02add3d1d01b868f39"
558-
integrity sha512-oQFsfP1uVJTOGnbN/jzPpOfRAQ7las0Dsv7EsuKO3Iz+LnllEam5vXqvKAcXQyH7mj6csvSdRE75Dp6K0+ZS1g==
555+
"@element-hq/element-web-playwright-common@^3.1.0":
556+
version "3.1.0"
557+
resolved "https://registry.yarnpkg.com/@element-hq/element-web-playwright-common/-/element-web-playwright-common-3.1.0.tgz#fa80f14ec17a5ab77a9d8a0ab88458113d20bc4a"
558+
integrity sha512-5mChlmiYzEwDnak5tY9zTWFRzzmOI8DerLkGjsnbGcNGJFfJCCNP0IRCzBVIw2mn5UsainweZp3qfyUzowK9FQ==
559559
dependencies:
560560
"@axe-core/playwright" "^4.10.1"
561561
"@testcontainers/postgresql" "^11.0.0"

0 commit comments

Comments
 (0)