import { defineConfig, devices } from '@playwright/test'; // https://playwright.dev/docs/test-configuration export default defineConfig({ testDir: './playwright/e2e', fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, reporter: process.env.CI ? 'github' : 'list', timeout: 30_000, use: { baseURL: 'http://localhost:4173', trace: 'on-first-retry', screenshot: 'only-on-failure', }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, ], webServer: { // Serve the production build (vite preview) with the /api proxy enabled. command: 'npm run build && npm run preview -- --strictPort', url: 'http://localhost:4173', reuseExistingServer: !process.env.CI, timeout: 120_000, }, });