From b1d8a45347043db35a78f3653c8bdfb2b986abf3 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Mon, 4 May 2026 19:35:27 +0530 Subject: [PATCH] fix: update Playwright test email domain in E2E tests --- .github/workflows/e2e-tests.yml | 2 +- surfsense_web/tests/auth.setup.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 3d2bcac07..aa6a0a8f4 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -31,7 +31,7 @@ jobs: NEXT_PUBLIC_FASTAPI_BACKEND_URL: http://localhost:8000 NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE: LOCAL # Playwright - PLAYWRIGHT_TEST_EMAIL: e2e-test@surfsense.test + PLAYWRIGHT_TEST_EMAIL: e2e-test@surfsense.net PLAYWRIGHT_TEST_PASSWORD: E2eTestPassword123! services: diff --git a/surfsense_web/tests/auth.setup.ts b/surfsense_web/tests/auth.setup.ts index 865fd1bb9..e5d31a257 100644 --- a/surfsense_web/tests/auth.setup.ts +++ b/surfsense_web/tests/auth.setup.ts @@ -17,7 +17,7 @@ import { expect, test as setup } from "@playwright/test"; const authFile = path.join(__dirname, "..", "playwright", ".auth", "user.json"); -const TEST_USER_EMAIL = process.env.PLAYWRIGHT_TEST_EMAIL || "test@surfsense.test"; +const TEST_USER_EMAIL = process.env.PLAYWRIGHT_TEST_EMAIL || "test@surfsense.net"; const TEST_USER_PASSWORD = process.env.PLAYWRIGHT_TEST_PASSWORD || "TestPassword123!"; const BACKEND_URL = process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL || "http://localhost:8000"; const STORAGE_KEY = "surfsense_bearer_token"; @@ -50,8 +50,9 @@ setup("authenticate", async ({ page, request }) => { { key: STORAGE_KEY, token: access_token } ); - await page.goto("/dashboard"); - await expect(page).toHaveURL(/\/dashboard/); + // Use a public page so the init script can write localStorage without + // racing the dashboard auth redirect. + await page.goto("/login", { waitUntil: "domcontentloaded" }); await page.context().storageState({ path: authFile }); });