From 900cb2a24df7ee90ef89570f1fb0ac9dfac6948a Mon Sep 17 00:00:00 2001 From: Philipp Hofer Date: Thu, 20 Nov 2025 18:43:06 +0100 Subject: [PATCH] try to fix ci --- frontend/tests/cox.spec.ts | 2 ++ frontend/tests/helpers.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/tests/cox.spec.ts b/frontend/tests/cox.spec.ts index dea3eb8..f31c0a1 100644 --- a/frontend/tests/cox.spec.ts +++ b/frontend/tests/cox.spec.ts @@ -117,6 +117,7 @@ test.describe("cox can edit trips", () => { // Someone registers... await page.goto("/auth/logout"); + await page.waitForURL("/auth"); await login(page, "rower", "rower"); await page.goto("/planned"); @@ -124,6 +125,7 @@ test.describe("cox can edit trips", () => { // Login as cox again await page.goto("/auth/logout"); + await page.waitForURL("/auth"); await login(page, "cox", "cox"); await page.goto("/planned"); diff --git a/frontend/tests/helpers.ts b/frontend/tests/helpers.ts index 2bd18f1..ce590d3 100644 --- a/frontend/tests/helpers.ts +++ b/frontend/tests/helpers.ts @@ -12,7 +12,10 @@ export async function login(page: Page, username: string, password: string): Pro // Clear cookies to ensure clean state await page.context().clearCookies(); - await page.goto("/auth"); + // Navigate to auth page and wait for it to fully load + await page.goto("/auth", { waitUntil: 'load' }); + await page.waitForLoadState('networkidle'); + await page.getByPlaceholder("Name").click(); await page.getByPlaceholder("Name").fill(username); await page.getByPlaceholder("Passwort").click();