34 lines
1,023 B
TypeScript
34 lines
1,023 B
TypeScript
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,
|
|
});
|