import { defineConfig, devices } from '@playwright/test'; const apiPort = process.env.PORT ?? '4000'; const webPort = process.env.WEB_PORT ?? '5173'; export default defineConfig({ testDir: './tests/e2e', timeout: 45_000, expect: { timeout: 10_000 }, fullyParallel: false, reporter: [ ['list'], ['html', { outputFolder: 'playwright-report', open: 'never' }] ], use: { baseURL: `http://127.0.0.1:${webPort}`, trace: 'on-first-retry' }, webServer: [ { command: `npm run dev -w @fan-passport/api`, url: `http://127.0.0.1:${apiPort}/api/health`, reuseExistingServer: !process.env.CI, timeout: 120_000 }, { command: `npm run dev -w @fan-passport/web -- --host 127.0.0.1 --port ${webPort}`, url: `http://127.0.0.1:${webPort}`, reuseExistingServer: !process.env.CI, timeout: 120_000 } ], projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] } }, { name: 'mobile-chrome', use: { ...devices['Pixel 5'] } } ] });