import { defineConfig, devices } from '@playwright/test'; const OPERATOR_URL = 'http://localhost:3000'; const ADMIN_URL = 'http://localhost:3001'; export const ADMIN_BASE = ADMIN_URL; export default defineConfig({ testDir: './tests', fullyParallel: false, // sequential — tests share state (DB, MinIO) forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, workers: 1, reporter: [['list'], ['html', { open: 'never' }]], use: { baseURL: OPERATOR_URL, trace: 'retain-on-failure', screenshot: 'only-on-failure', }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, ], webServer: [ { command: 'pnpm --filter @repo/operator-pwa dev', cwd: '..', url: OPERATOR_URL, reuseExistingServer: !process.env.CI, timeout: 120_000, stdout: 'pipe', stderr: 'pipe', env: { AUTH_DEV_AUTOLOGIN: 'true' }, }, { command: 'pnpm --filter @repo/admin-web dev', cwd: '..', url: ADMIN_URL, reuseExistingServer: !process.env.CI, timeout: 120_000, stdout: 'pipe', stderr: 'pipe', env: { AUTH_DEV_AUTOLOGIN: 'true' }, }, ], });