import { defineConfig } from '@playwright/test'; import { fileURLToPath } from 'node:url'; import * as path from 'node:path'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); // Allow overriding via env for remote testing (e.g. against deployed instance). const BASE_URL = process.env.PLAYWRIGHT_BASE_URL || undefined; export default defineConfig({ testDir: '.', fullyParallel: true, forbidOnly: false, retries: 1, workers: 1, use: { trace: 'on-first-retry', screenshot: 'only-on-failure', baseURL: BASE_URL, }, webServer: BASE_URL ? undefined : { command: 'npx sirv build --port 18080', port: 18080, reuseExistingServer: true, cwd: path.resolve(__dirname, '../../'), stdout: 'ignore', stderr: 'pipe', }, projects: [ { name: 'chromium', use: { browserName: 'chromium' }, }, ], });