From f0bd1ff2abd1b530fcf822109a5522c24926a63d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 20 Jun 2024 16:12:34 +0100 Subject: [PATCH] Update playwright/e2e/crypto/crypto.spec.ts Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- playwright/e2e/crypto/crypto.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/playwright/e2e/crypto/crypto.spec.ts b/playwright/e2e/crypto/crypto.spec.ts index 69981eafe8d..4ce2f44306a 100644 --- a/playwright/e2e/crypto/crypto.spec.ts +++ b/playwright/e2e/crypto/crypto.spec.ts @@ -472,8 +472,9 @@ test.describe("Cryptography", function () { // Reload to work around a Rust crypto bug where it can hold onto the indexeddb even after logout // https://github.com/element-hq/element-web/issues/25779 await page.addInitScript(() => { - // Clear localStorage as the user/pageWithCredentials fixtures will re-inject them on reload otherwise - // and by logging out we just invalidated the token that will be injected, causing a 401 unauth error. + // When we reload, the initScript created by the `user`/`pageWithCredentials` fixtures + // will re-inject the original credentials into localStorage, which we don't want. + // To work around, we add a second initScript which will clear localStorage again. window.localStorage.clear(); }); await page.reload();