import { defineConfig, devices } from '@playwright/test'; /** * Demo capture config — separate from regression on purpose. * * Regression answers "is the deployment correct?". This config answers "can a * human watch the proof?". Mixing them trains people to skip the fast suite, and * a slowMo'd, video-recording regression run is nobody's PR gate. * * What differs from playwright.config.ts: * - scoped to tests/e2e/demo, which only captures states the regression suite * has already asserted; * - a fixed 1600x900 viewport and pinned locale/timezone, so a capture is * reproducible and a re-capture diffs cleanly; * - video on, because "record the entire process" is the deliverable; * - screenshots written explicitly at named proof points rather than * on-failure, since the images ARE the artifact here; * - its own outputDir so a demo run never clobbers regression artifacts. * * slowMo is deliberately NOT set. Global slowMo stretches every action equally, * including the ones nobody needs to watch. Presentation pacing belongs to * Remotion, which can hold a proof state for as long as it needs to be read. */ export default defineConfig({ testDir: './tests/e2e/demo', globalSetup: './tests/e2e/support/env-bootstrap.ts', timeout: 240_000, expect: { timeout: 30_000 }, forbidOnly: !!process.env.CI, retries: 0, workers: 1, fullyParallel: false, reporter: [ ['list'], ['html', { open: 'never', outputFolder: 'playwright-report-demo' }], ['json', { outputFile: 'test-results/playwright-demo/capture-run.json' }], ], outputDir: 'test-results/playwright-demo', use: { actionTimeout: 30_000, navigationTimeout: 60_000, trace: 'retain-on-failure', screenshot: 'only-on-failure', video: { mode: 'on', size: { width: 1600, height: 900 } }, // Deterministic presentation surface. A capture that shifts with the // reviewer's locale cannot be re-audited by content hash. viewport: { width: 1600, height: 900 }, colorScheme: 'dark', locale: 'en-US', timezoneId: 'UTC', deviceScaleFactor: 2, }, projects: [ { name: 'demo-capture', use: { ...devices['Desktop Chrome'], viewport: { width: 1600, height: 900 } }, }, ], });