From 452996eacf231a46a2ebd109caaf9a82df7f4bc3 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Wed, 30 Jul 2025 13:11:14 +0100 Subject: [PATCH] Playwright: clean up after verification test, to deflake later tests (#30425) --- playwright/e2e/crypto/device-verification.spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/playwright/e2e/crypto/device-verification.spec.ts b/playwright/e2e/crypto/device-verification.spec.ts index f325754326..eb21dfc909 100644 --- a/playwright/e2e/crypto/device-verification.spec.ts +++ b/playwright/e2e/crypto/device-verification.spec.ts @@ -124,6 +124,10 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => { const toasts = new Toasts(page); await toasts.rejectToast("Notifications"); await toasts.assertNoToasts(); + + // There may still be a `/sendToDevice/m.secret.request` in flight, which will later throw an error and cause + // a *subsequent* test to fail. Tell playwright to ignore any errors resulting from in-flight routes. + await page.unrouteAll({ behavior: "ignoreErrors" }); }); test("Verify device with QR code during login", async ({ page, app, credentials, homeserver }) => {