diff --git a/surfsense_web/playwright.config.ts b/surfsense_web/playwright.config.ts index a217a1424..511db6b09 100644 --- a/surfsense_web/playwright.config.ts +++ b/surfsense_web/playwright.config.ts @@ -19,7 +19,7 @@ const baseURL = process.env.PLAYWRIGHT_BASE_URL || `http://localhost:${PORT}`; export default defineConfig({ testDir: "./tests", timeout: 30_000, - expect: { timeout: 5_000 }, + expect: { timeout: 15_000 }, fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, @@ -53,10 +53,11 @@ export default defineConfig({ webServer: process.env.PLAYWRIGHT_NO_WEB_SERVER ? undefined : { - command: "pnpm dev", + // Pin to webpack dev (Turbopack has caused stale-lock panics in E2E). + command: "pnpm exec next dev", url: `http://localhost:${PORT}`, reuseExistingServer: !process.env.CI, - timeout: 120_000, + timeout: 180_000, env: { NEXT_PUBLIC_FASTAPI_BACKEND_URL: `http://localhost:${BACKEND_PORT}`, NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE: "LOCAL", diff --git a/surfsense_web/tests/dashboard.spec.ts b/surfsense_web/tests/dashboard.spec.ts deleted file mode 100644 index 406a0dbda..000000000 --- a/surfsense_web/tests/dashboard.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { expect, test } from "@playwright/test"; - -/** - * Tracer-bullet test: proves the entire E2E pipeline works end-to-end. - * - * Verifies: - * - Web server is reachable - * - Auth setup ran successfully (storageState contains valid token) - * - Dashboard route renders for an authenticated user - * - * Keep this test minimal. Product-specific behaviour belongs in dedicated - * spec files (new-chat, search-spaces, editor-panel, etc.). - */ -test.describe("Dashboard", () => { - test("loads dashboard with sidebar navigation for authenticated user", async ({ page }) => { - await page.goto("/dashboard"); - - await expect(page).toHaveURL(/\/dashboard/); - await expect(page.getByRole("navigation").first()).toBeVisible(); - }); -}); diff --git a/surfsense_web/tests/smoke/dashboard.spec.ts b/surfsense_web/tests/smoke/dashboard.spec.ts new file mode 100644 index 000000000..a6249ddfa --- /dev/null +++ b/surfsense_web/tests/smoke/dashboard.spec.ts @@ -0,0 +1,21 @@ +import { expect, test } from "@playwright/test"; + +/** + * Tracer-bullet smoke test: proves the entire E2E pipeline is wired up. + * + * Verifies: + * - Web server is reachable + * - tests/auth.setup.ts ran and stored a valid bearer token + * - Dashboard route renders for an authenticated user + * + * Keep minimal. Connector- or feature-specific behaviour belongs under + * tests/connectors/ or tests//. + */ +test.describe("Smoke", () => { + test("dashboard loads for authenticated user", async ({ page }) => { + await page.goto("/dashboard"); + + // Sidebar is