From: Vsevolod Stakhov Date: Wed, 22 Jul 2026 09:09:55 +0000 (+0100) Subject: Revert "[Test] Fix race in history reset e2e test" X-Git-Tag: 4.1.3~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=40d83b44e9c83e58f2e43b98cabce59027ea02c4;p=thirdparty%2Frspamd.git Revert "[Test] Fix race in history reset e2e test" This reverts commit 8d934a9790956fd21b89532e5ecfe2e00115285c. --- diff --git a/test/playwright/tests/scan.spec.mjs b/test/playwright/tests/scan.spec.mjs index 425710d8a7..47a1b4e99b 100644 --- a/test/playwright/tests/scan.spec.mjs +++ b/test/playwright/tests/scan.spec.mjs @@ -175,23 +175,18 @@ test.describe.serial("Scan flow across WebUI tabs", () => { // Reset history const resetBtn = page.locator("#resetHistory"); await expect(resetBtn).toBeVisible(); + page.once("dialog", (dialog) => dialog.accept()); + await resetBtn.click(); // The reload disables #updateHistory only for the duration of the // fast, local history request, which is too brief to assert on the // DOM. Wait for the reset and the subsequent reload responses instead. - // Register the waits before clicking: on localhost the responses can - // arrive before a listener registered after the click would see them. - const resetResponse = page.waitForResponse((r) => r.url().includes("historyreset"), {timeout: 10000}); - const reloadResponse = page.waitForResponse( + await page.waitForResponse((r) => r.url().includes("historyreset"), {timeout: 10000}); + await page.waitForResponse( (r) => r.url().includes("history") && r.url().includes("from="), {timeout: 10000} ); - page.once("dialog", (dialog) => dialog.accept()); - await resetBtn.click(); - await resetResponse; - await reloadResponse; - const updateHistoryBtn = page.locator("#updateHistory"); await expect(updateHistoryBtn).toBeEnabled();