import { defineConfig, devices } from '@playwright/test'; const WEB_PORT = 3000; const API_PORT = 4000; const baseURL = `http://localhost:${WEB_PORT}`; export default defineConfig({ testDir: './e2e', fullyParallel: true, forbidOnly: Boolean(process.env.CI), retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, reporter: process.env.CI ? 'github' : 'list', use: { baseURL, trace: 'on-first-retry', }, projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }], webServer: [ { command: 'pnpm --filter @ketopath/api dev', url: `http://localhost:${API_PORT}/health`, reuseExistingServer: !process.env.CI, timeout: 120_000, cwd: '../..', }, { command: 'pnpm dev', url: baseURL, reuseExistingServer: !process.env.CI, timeout: 120_000, }, ], });