import { defineConfig, devices } from "@playwright/test"; // E2E journeys run against the REAL Rust backend (deterministic e2e seed) // and the production Next build — no network interception anywhere. export default defineConfig({ testDir: "./tests/e2e", timeout: 30_000, fullyParallel: false, // One worker: journeys share one backend + database; parallel spec files // would interleave sessions and approval queues across tests. workers: 1, retries: process.env.CI ? 1 : 0, reporter: process.env.CI ? "github" : "list", use: { baseURL: "http://127.0.0.1:3100", trace: "retain-on-failure", }, projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }], webServer: [ { command: "bash ../scripts/e2e-backend.sh", url: "http://127.0.0.1:18080/healthz", reuseExistingServer: !process.env.CI, timeout: 180_000, }, { command: "npm run build && npx next start -p 3100", url: "http://127.0.0.1:3100/login", reuseExistingServer: !process.env.CI, timeout: 180_000, env: { API_ORIGIN: "http://127.0.0.1:18080" }, }, ], });