import { defineConfig } from '@playwright/test'; export default defineConfig({ testDir: './tests', timeout: 45000, workers: 1, fullyParallel: false, use: { baseURL: 'http://127.0.0.1:18089', browserName: 'chromium', channel: process.env.PLAYWRIGHT_CHANNEL || undefined, headless: true, screenshot: 'only-on-failure', trace: 'retain-on-failure', launchOptions: { args: [ '--use-angle=swiftshader', '--enable-unsafe-swiftshader', // The CI runner's headless page was getting treated as backgrounded/occluded, // which throttles requestAnimationFrame to ~1Hz or worse -- turning every // frame-driven client action (movement steering, gather/attack retries) into a // multi-second-per-tick crawl and blowing well past assertion timeouts even // though the server side was fine. These are the standard flags to keep a // headless/automated tab running at full rAF rate regardless of visibility. '--disable-background-timer-throttling', '--disable-backgrounding-occluded-windows', '--disable-renderer-backgrounding', ] } }, webServer: { command: 'node tools/dev-server.mjs', url: 'http://127.0.0.1:18089/readyz', timeout: 180000, reuseExistingServer: false, env: { PORT: '18089', E2E: 'true', WORLD_ID: 'e2e', DEV_SEASON_SECONDS: '3600', DEV_ADMIN: 'true' }, }, });