import { defineConfig, type TestConfig } from '@playwright/test'; /** * E2E config for X-Haven (PLAN.md Phase 7). * * Each test boots its own real Dart game server (fresh saves dir, free port) * through the `table` fixture in `helpers/table.ts` — there is no shared * `webServer` because the resilience specs restart the server mid-test and * every spec needs isolated state. */ const config: TestConfig = { testDir: './tests', timeout: 180_000, // The server boot + a full round is the slow part; give the whole suite // room without making a hang look like a pass. expect: { timeout: 10_000 }, // One worker: the specs drive real browser tabs against one server each, // and a single worker keeps the ports and temp dirs from colliding. workers: 1, retries: 0, reporter: [['list']], use: { // No baseURL: the server port is chosen per test. viewport: { width: 400, height: 820 }, // Keep the failure artifacts small (we drive full state over WS). trace: 'retain-on-failure', }, }; export default defineConfig(config);