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.
This commit is contained in:
Thomas Camlong committed 2026-08-17 15:30:56 +02:00
1 parent f1295f4d28
commit 482a8c20e3
1 file changed
+3 -3
+3 -3
View File
@@ -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();