Files
familienarchiv/frontend/playwright.config.ts
Marcel 03b180fe88
Some checks failed
CI / Unit & Component Tests (push) Failing after 4m29s
CI / OCR Service Tests (push) Successful in 55s
CI / Backend Unit Tests (push) Failing after 3m16s
CI / Unit & Component Tests (pull_request) Failing after 3m3s
CI / OCR Service Tests (pull_request) Successful in 39s
CI / Backend Unit Tests (pull_request) Failing after 3m4s
test(e2e): add transcribe-coach, richtlinien, and help-popover E2E specs; reducedMotion global default
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 21:39:03 +02:00

54 lines
1.7 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
testDir: './e2e',
// Auto-starts the SvelteKit dev server before E2E tests.
// Reuses the existing server if already running (e.g. during active development).
// The backend + DB + MinIO must be started separately (see README or CI workflow).
webServer: {
command: 'npm run dev -- --port 3000',
// Use the E2E_BASE_URL so that a pre-running server (e.g. the docker dev server
// on port 5173 during local development) is detected and reused without starting
// a new one. In CI the default is localhost:3000 where a fresh server is started.
url: process.env.E2E_BASE_URL ?? 'http://localhost:3000',
reuseExistingServer: true,
timeout: 120_000
},
fullyParallel: false, // tests share auth state → run sequentially within a worker
retries: process.env.CI ? 2 : 0,
workers: 1,
use: {
baseURL: process.env.E2E_BASE_URL ?? 'http://localhost:3000',
locale: 'de-DE', // ensures Accept-Language: de is sent so locale detection defaults to German
reducedMotion: 'reduce', // prevents SMIL/CSS animations from flaking tests
screenshot: 'on', // always capture screenshots
video: 'retain-on-failure',
trace: 'retain-on-failure'
},
projects: [
// 1. Auth setup: logs in and saves the session cookie to disk
{
name: 'setup',
testMatch: /auth\.setup\.ts/
},
// 2. All E2E tests, re-using the stored session
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
storageState: path.join(__dirname, 'e2e/.auth/user.json')
},
dependencies: ['setup']
}
],
outputDir: 'test-results/e2e'
});