]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Test] WebUI: fix race in scan reconnect E2E test
authorAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 24 Jul 2026 11:19:29 +0000 (14:19 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 24 Jul 2026 11:19:29 +0000 (14:19 +0300)
After login, #navBar loses d-none from the /auth "complete"
callback, which can fire before Bootstrap has finished the async
fade-out of #connectDialog. The lingering .show then intercepts the
immediate nav click, exhausting the 30s budget on WebKit under CI
load. Wait for the dialog to be fully hidden before interacting with
the nav, mirroring the explicit-wait pattern from 735609c1.

test/playwright/tests/scan.spec.mjs

index c573f6d7a819e686cb13ca81b88ab1b844916bcf..049d3aba920ad0e393c1ac27d66e8670828f14ef 100644 (file)
@@ -248,6 +248,11 @@ test.describe.serial("Scan flow across WebUI tabs", () => {
             // Login as read-only
             await login(page2, readOnlyPassword);
             await page2.waitForSelector("#navBar:not(.d-none)");
+            // Bootstrap dismisses #connectDialog asynchronously (fade transition).
+            // navBar loses d-none from the /auth "complete" callback, which can fire
+            // before the modal finishes closing — the lingering .show then intercepts
+            // nav clicks (seen on WebKit under CI load).
+            await expect(page2.locator("#connectDialog")).toBeHidden({timeout: 10000});
 
             // Go to Scan in RO
             await gotoTabLocal("scan");
@@ -264,6 +269,7 @@ test.describe.serial("Scan flow across WebUI tabs", () => {
             );
             await page2.locator("#connectButton").click();
             await page2.waitForSelector("#navBar:not(.d-none)");
+            await expect(page2.locator("#connectDialog")).toBeHidden({timeout: 10000});
             await p;
 
             // Expect classifiers to be populated