diff --git a/internal/gui/tests/account-mask.test.cjs b/internal/gui/tests/account-mask.test.cjs index 67671a3b9..9ae79e133 100644 --- a/internal/gui/tests/account-mask.test.cjs +++ b/internal/gui/tests/account-mask.test.cjs @@ -63,9 +63,9 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", await page.goto(url); return page; }; + // a new context's storage is empty: no reload to clear it, which + // would cancel the page's first reads, each a page error in WebKit (#1350) const page = await open("http://magpie.test/?view=usage"); - await page.evaluate(() => localStorage.removeItem("magpie.maskEmails")); - await page.reload(); await page.waitForSelector(".subscription-account .user"); const btn = page.locator("#usageMask"); assert.equal((await btn.textContent()).trim(), w.hide); diff --git a/internal/gui/tests/usage-fold.test.cjs b/internal/gui/tests/usage-fold.test.cjs index 246412b30..a436cfe00 100644 --- a/internal/gui/tests/usage-fold.test.cjs +++ b/internal/gui/tests/usage-fold.test.cjs @@ -84,9 +84,11 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", await page.goto(url); return page; }; + // a new context's storage is empty: nothing to clear and reload. A + // reload at once lands while the page's first reads are on their way, + // and WebKit reports each one it cancels as a page error, "Fetch API + // cannot load … due to access control checks" (#1350) const page = await open("http://magpie.test/?view=usage"); - await page.evaluate(() => { localStorage.removeItem("magpie.usageOpen"); localStorage.removeItem("magpie.usageAccounts"); localStorage.removeItem("magpie.maskEmails"); }); - await page.reload(); await page.waitForSelector(".subscription-account .user", { state: "attached" }); let got = await cards(page);