import { defineConfig } from '@playwright/test'; // Deterministic e2e: the dev webServer runs with LLM_STUB=1 so the Express backend // uses the canned, deterministic turn simulator (no live LLM in e2e — see // server/stub.ts). Dev ports default to the spec values but can be overridden via // VITE_PORT / HISTORY_API_PORT so the run can dodge a port another project holds. const vitePort = Number(process.env.VITE_PORT ?? 5173); const apiPort = Number(process.env.HISTORY_API_PORT ?? 4321); const devUrl = `http://localhost:${vitePort}`; export default defineConfig({ testDir: './e2e', fullyParallel: false, workers: 1, timeout: 60000, expect: { timeout: 10000 }, use: { baseURL: devUrl, headless: true, }, webServer: { command: 'npm run dev', url: devUrl, reuseExistingServer: true, timeout: 120000, env: { LLM_STUB: '1', DATA_DIR: 'data/e2e', VITE_PORT: String(vitePort), HISTORY_API_PORT: String(apiPort), }, }, });