import { defineConfig, devices } from '@playwright/test' const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? 'http://localhost:3000' const frontendPort = new URL(baseURL).port || (baseURL.startsWith('https:') ? '443' : '80') export default defineConfig({ testDir: './tests', fullyParallel: false, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, reporter: 'html', use: { baseURL, trace: 'on-first-retry', }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, ], webServer: { command: `npm run dev -- --port ${frontendPort}`, url: baseURL, reuseExistingServer: !process.env.CI, }, })