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