import { defineConfig, devices } from '@playwright/test'; import { resolve } from 'node:path'; const apiDirectory = resolve(process.env.MODEL_API_DIR ?? '../delivery-app-api'); export default defineConfig({ testDir: './tests/e2e', timeout: 45000, expect: { timeout: 15000 }, fullyParallel: false, workers: 1, reporter: 'list', use: { baseURL: 'http://localhost:4174', trace: 'retain-on-failure', screenshot: 'only-on-failure', serviceWorkers: 'allow' }, projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }], webServer: [ { command: `pnpm --dir "${apiDirectory}" start`, url: 'http://127.0.0.1:3002/ready', env: { API_PORT: '3002', DB_NAME: 'model_delivery_test', APP_ORIGINS: 'http://localhost:4174', LOCAL_ADMIN_SETUP_TOKEN: 'isolated-test-bootstrap', OIDC_ALLOW_HTTP: 'true' }, reuseExistingServer: false, timeout: 30000 }, { command: 'pnpm preview --port 4174', url: 'http://localhost:4174', env: { API_PORT: '3002' }, reuseExistingServer: false, timeout: 30000 }, { command: 'node tests/helpers/mock-oidc.mjs', url: 'http://localhost:4005/.well-known/openid-configuration', reuseExistingServer: false, timeout: 30000 }, ], });