From ab90654a62f7cc9a42eaffcf1c053f75977e6cc9 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 6 Jul 2026 18:09:45 +0100 Subject: [PATCH] Deflake dercryption failure test It sometimes raced and clicked the wrong toast. --- .../e2e/crypto/decryption-failure-messages.spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/playwright/e2e/crypto/decryption-failure-messages.spec.ts b/apps/web/playwright/e2e/crypto/decryption-failure-messages.spec.ts index 50e655f462f..bffa7ff539f 100644 --- a/apps/web/playwright/e2e/crypto/decryption-failure-messages.spec.ts +++ b/apps/web/playwright/e2e/crypto/decryption-failure-messages.spec.ts @@ -48,7 +48,11 @@ test.describe("Cryptography", function () { // Log in again, and see how the message looks. await logIntoElement(page, credentials); // Dismiss the "Back up your chats" toast, otherwise it gets in the way of clicking the room list - await page.getByRole("button", { name: "Dismiss" }).click(); + await page + .getByRole("alert") + .filter({ hasText: "Back up your chats" }) + .getByRole("button", { name: "Dismiss" }) + .click(); await app.viewRoomByName("Test room"); const lastTile = page.locator(".mx_EventTile").last(); await expect(lastTile).toContainText("Historical messages are not available on this device");