From 953c31f00c4c810be11d40567acba309c2562ed3 Mon Sep 17 00:00:00 2001 From: Alexander Moisseev Date: Thu, 11 Dec 2025 21:28:54 +0300 Subject: [PATCH] [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. --- test/playwright/tests/scan.spec.mjs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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(); }); }); -- 2.47.3