trails/playwright.config.ts
Ullrich Schäfer 7d273b73c0
Fix CI E2E: check Planner DB, add Playwright HTML report
- Integration test DB check now hits Planner API (not Journal)
  so it correctly skips when no PostgreSQL in CI
- Playwright uploads HTML report artifact on all runs (not just failures)
- Install Chromium with --with-deps for CI compatibility
- Report retained for 30 days

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 23:47:43 +01:00

52 lines
1.2 KiB
TypeScript

import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "./e2e",
outputDir: "./e2e/results",
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? [["github"], ["html", { open: "never" }]] : "list",
use: {
baseURL: "http://localhost:3000",
trace: "on-first-retry",
screenshot: "only-on-failure",
},
projects: [
{
name: "journal",
testMatch: "journal.test.ts",
use: {
...devices["Desktop Chrome"],
baseURL: "http://localhost:3000",
},
},
{
name: "planner",
testMatch: "planner.test.ts",
use: {
...devices["Desktop Chrome"],
baseURL: "http://localhost:3001",
},
},
{
name: "integration",
testMatch: "integration.test.ts",
use: {
...devices["Desktop Chrome"],
},
},
],
webServer: [
{
command: "pnpm --filter @trails-cool/journal dev",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
},
{
command: "pnpm --filter @trails-cool/planner dev",
url: "http://localhost:3001",
reuseExistingServer: !process.env.CI,
},
],
});