import { defineConfig, devices } from '@playwright/test' /** * Playwright configuration for ArchiefAssistent E2E tests * * Tests run against production at archief.support (or local dev server) */ export default defineConfig({ testDir: './e2e', /* Run tests in parallel */ fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code */ forbidOnly: !!process.env.CI, /* Retry on CI only */ retries: process.env.CI ? 2 : 0, /* Opt out of parallel tests on CI for stability */ workers: process.env.CI ? 1 : undefined, /* Reporter to use */ reporter: [ ['html', { outputFolder: 'playwright-report' }], ['json', { outputFile: 'playwright-results.json' }], ['list'], ], /* Shared settings for all projects */ use: { /* Base URL to use in actions like `await page.goto('/')` */ baseURL: process.env.BASE_URL || 'https://archief.support', /* Collect trace when retrying the failed test */ trace: 'on-first-retry', /* Take screenshot on failure */ screenshot: 'only-on-failure', /* Video on first retry */ video: 'on-first-retry', }, /* Configure projects for major browsers */ projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, { name: 'firefox', use: { ...devices['Desktop Firefox'] }, }, { name: 'webkit', use: { ...devices['Desktop Safari'] }, }, ], /* Timeout settings */ timeout: 60000, // 60s per test (RAG queries can be slow) expect: { timeout: 30000, // 30s for assertions }, })