From: Alexander Moisseev Date: Thu, 11 Dec 2025 18:28:54 +0000 (+0300) Subject: [Test] Skip unnecessary waiting in initial scan counter read X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=953c31f00c4c810be11d40567acba309c2562ed3;p=thirdparty%2Frspamd.git [Test] Skip unnecessary waiting in initial scan counter read Since the test starts already on the Status tab, the gotoTab("status") doesn't trigger a new request, and we're just waiting for the autorefresh to happen, causing unnecessary delay. --- diff --git a/test/playwright/tests/scan.spec.mjs b/test/playwright/tests/scan.spec.mjs index 9451a2744d..6947263a98 100644 --- a/test/playwright/tests/scan.spec.mjs +++ b/test/playwright/tests/scan.spec.mjs @@ -14,10 +14,12 @@ test.describe.serial("Scan flow across WebUI tabs", () => { return parseInt(text.replace(/\D/g, ""), 10); } - async function readScanTab() { + async function readScanTab(skipNavigation = false) { // Status tab → scanned widget - await gotoTab("status"); - await page.waitForResponse((resp) => resp.url().includes("/stat") && resp.status() === 200); + if (!skipNavigation) { + await gotoTab("status"); + await page.waitForResponse((resp) => resp.url().includes("/stat") && resp.status() === 200); + } const scannedWidget = page.locator("#statWidgets .widget[title*='scanned']"); await expect(scannedWidget).toBeVisible(); const scannedTitle = await scannedWidget.getAttribute("title"); @@ -108,7 +110,7 @@ test.describe.serial("Scan flow across WebUI tabs", () => { test.describe("Phase 1: before scanning", () => { test("Read current Scanned counters", async () => { - scannedBefore.scanTab = await readScanTab(); + scannedBefore.scanTab = await readScanTab(true); scannedBefore.throughput = await readThroughput(); }); });