import { defineConfig, devices } from "@playwright/test"; /** * AI Software Factory — Playwright config for the RELEASE v1.0 FINAL FLOW * (TASK-0135, docs/tasks/phase-15-production.md L242–266). * * Invoked by .github/workflows/release.yml stage 10: * pnpm --dir tests/e2e exec playwright test --config playwright.final-flow.config.ts * * Deliberately separate from playwright.config.ts (the dev/CI suite): * - ONE spec (final-flow), ONE browser context, workers 1 + fullyParallel * false + retries 0 — the flow is a single sequential story; parallelism * and retries would mask state-carrying regressions. * - No webServer block (same contract as the main config): the full stack * is started EXTERNALLY before the suite runs (CI: release.yml services; * local: `pnpm dev`). global-setup still fail-fasts on an unreachable API. * - E2E_STAGING=1 (release.yml) targets deployed staging and enables the * four staging-only steps; without it they no-op locally (spec header). */ export default defineConfig({ // The config lives in tests/e2e; the spec is in ./specs. testDir: "./specs", testMatch: "final-flow.spec.ts", globalSetup: require.resolve("./global-setup"), fullyParallel: false, workers: 1, retries: 0, forbidOnly: !!process.env.CI, // `open: "never"` always: in non-CI a failed run would otherwise serve the // HTML report and keep the runner process alive indefinitely ("Press Ctrl+C // to quit"), which reads as a hung test. reporter: [["list"], ["html", { open: "never" }]], // The 13-step flow's budget is ~6 min (spec L245); the test also sets its // own 10-min timeout — the config default must not be lower than any // single step's headroom (search-index waits alone take up to ~30 s each). timeout: 600_000, expect: { timeout: 15_000 }, use: { baseURL: process.env.E2E_BASE_URL ?? "http://localhost:3000", actionTimeout: 20_000, navigationTimeout: 45_000, trace: "retain-on-failure", screenshot: "only-on-failure", }, projects: [ { name: "chromium-desktop", use: { ...devices["Desktop Chrome"], viewport: { width: 1440, height: 900 }, }, }, ], outputDir: "test-results-final-flow", });