diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 0000000..a04bce8 --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,34 @@ +import { defineConfig, devices } from '@playwright/test'; + +/** + * TST-020: Visual Regression Test Config — CC-047 + * + * Runs against ceo-web (Next.js 15). + * Usage: + * pnpm exec playwright test # run all + * pnpm exec playwright test --update-snapshots # update baselines + */ +export default defineConfig({ + testDir: './tests/visual', + fullyParallel: true, + retries: process.env.CI ? 2 : 0, + workers: process.env.CI ? 1 : undefined, + reporter: [['html', { outputFolder: 'playwright-report' }]], + use: { + baseURL: process.env.PLAYWRIGHT_BASE_URL ?? 'http://localhost:3000', + trace: 'on-first-retry', + screenshot: 'only-on-failure', + }, + projects: [ + { name: 'chromium', use: { ...devices['Desktop Chrome'] } }, + { name: 'mobile-chrome', use: { ...devices['Pixel 5'] } }, + ], + webServer: process.env.CI + ? { + command: 'pnpm build && pnpm start', + url: 'http://localhost:3000', + reuseExistingServer: false, + timeout: 120_000, + } + : undefined, +});