From 482a8c20e324b702739d326ab2d8ef6233925594 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Mon, 17 Aug 2026 15:30:56 +0200 Subject: [PATCH] test(e2e): make lazy-widgets spec resilient to parallel load The clock widget can be rendered transiently twice while the board hydrates under 4-worker parallel load. Pin the assertion to a visible instance and give the post-login redirect a longer window. --- e2e/lazy-widgets.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/lazy-widgets.spec.ts b/e2e/lazy-widgets.spec.ts index 61dd87ff3..4ae7d4f72 100644 --- a/e2e/lazy-widgets.spec.ts +++ b/e2e/lazy-widgets.spec.ts @@ -78,7 +78,7 @@ describe("lazy widget application graph", () => { await page.goto(`${baseUrl}/auth/login`); await page.getByLabel("Username").fill(adminCredentials.username); await page.locator("#password").fill(adminCredentials.password); - const signedIn = page.waitForURL(baseUrl, { waitUntil: "commit", timeout: 15_000 }); + const signedIn = page.waitForURL(baseUrl, { waitUntil: "commit", timeout: 60_000 }); await page.locator("css=button[type='submit']").click(); await signedIn; @@ -86,7 +86,7 @@ describe("lazy widget application graph", () => { const clockWidget = page.locator( `[data-id="${itemId}"] .clock-widget-container, [data-grid-item-id="${itemId}"] .clock-widget-container`, ); - await expect(clockWidget).toBeVisible({ timeout: 15_000 }); + await expect(clockWidget.filter({ visible: true }).first()).toBeVisible({ timeout: 30_000 }); await expect(page.locator("[data-homarr-dev-benchmark-spotlight-preloaded]")).toHaveCount(1, { timeout: 15_000, @@ -109,7 +109,7 @@ describe("lazy widget application graph", () => { .toBe(`${baseUrl}/`); await page.reload(); - await expect(clockWidget).toBeVisible({ timeout: 15_000 }); + await expect(clockWidget.filter({ visible: true }).first()).toBeVisible({ timeout: 30_000 }); expect(pageErrors).toEqual([]); } finally { await browser.close();