diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d9df3b..253a052 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,13 +75,11 @@ jobs: node-version: 24 cache: pnpm - run: pnpm install --frozen-lockfile - - run: pnpm exec playwright install chromium + - run: pnpm exec playwright install --with-deps chromium - run: pnpm test:e2e - uses: actions/upload-artifact@v7 - if: failure() + if: ${{ !cancelled() }} with: name: playwright-report - path: | - e2e/results/ - playwright-report/ - retention-days: 7 + path: playwright-report/ + retention-days: 30 diff --git a/e2e/integration.test.ts b/e2e/integration.test.ts index e4c4e95..3cd00bc 100644 --- a/e2e/integration.test.ts +++ b/e2e/integration.test.ts @@ -12,17 +12,15 @@ import { test, expect } from "@playwright/test"; const JOURNAL = "http://localhost:3000"; const PLANNER = "http://localhost:3001"; -// Helper: check if DB is available +// Helper: check if DB is available (checks Planner API) async function isDbAvailable(): Promise { try { - const resp = await fetch(`${JOURNAL}/api/auth/login`, { + const resp = await fetch(`${PLANNER}/api/sessions`, { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ step: "magic-link", email: "nonexistent@test.com" }), + body: JSON.stringify({}), }); - // If we get a JSON response (even error), DB is available - const body = await resp.json(); - return body.error !== undefined || body.step !== undefined; + return resp.ok; // 201 = DB available, 503 = DB unavailable } catch { return false; } diff --git a/playwright.config.ts b/playwright.config.ts index 8e9e87a..75733f5 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -6,7 +6,7 @@ export default defineConfig({ fullyParallel: true, retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, - reporter: process.env.CI ? "github" : "list", + reporter: process.env.CI ? [["github"], ["html", { open: "never" }]] : "list", use: { baseURL: "http://localhost:3000", trace: "on-first-retry",