import { defineConfig, devices } from '@playwright/test' // D2 identity E2E: drives REAL browser WebAuthn (Chromium virtual authenticator) against a // D2-enabled backend that serves the built React app. RP ID is 'localhost' here (see // e2e/d2-serve.sh); production-domain and physical-device coverage stay honestly PENDING. const PORT = process.env.D2_E2E_PORT || '8000' const ORIGIN = `http://localhost:${PORT}` export default defineConfig({ testDir: './e2e', testMatch: 'd2-identity.spec.ts', fullyParallel: false, workers: 1, timeout: 60_000, reporter: [['list'], ['html', { open: 'never', outputFolder: 'playwright-report-d2' }]], use: { baseURL: ORIGIN, trace: 'retain-on-failure', }, projects: [ { name: 'chromium-desktop', use: { ...devices['Desktop Chrome'] } }, { name: 'chromium-mobile', use: { ...devices['Pixel 5'] } }, ], // Reuse an already-running backend when one is up on the port (the CI job runs the built // Docker image and seeds invitations via `docker exec`); otherwise start one locally with // e2e/d2-serve.sh, which also seeds the invitation artifacts. webServer: { command: 'bash e2e/d2-serve.sh', url: `${ORIGIN}/healthz`, timeout: 180_000, reuseExistingServer: true, stdout: 'pipe', stderr: 'pipe', }, })