]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Test] Skip unnecessary waiting in initial scan counter read 5795/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Thu, 11 Dec 2025 18:28:54 +0000 (21:28 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Thu, 11 Dec 2025 18:28:54 +0000 (21:28 +0300)
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.

test/playwright/tests/scan.spec.mjs

index 9451a2744d39342e279e19904bd7518f69999cc1..6947263a986ca7bfbd1755a9f9a2a3d8f0f39ef7 100644 (file)
@@ -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();
         });
     });