Add visual parity smoke tests for CI regression detection
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { test, expect } from '../support/cross-app-fixtures';
|
||||
|
||||
/**
|
||||
* Visual Parity Smoke Tests
|
||||
*
|
||||
* Uses Playwright's built-in toHaveScreenshot for CI-friendly
|
||||
* visual regression. On first run, creates baseline screenshots.
|
||||
* Subsequent runs compare against baselines.
|
||||
*
|
||||
* These are lightweight checks — the full multi-viewport comparison
|
||||
* pipeline (pnpm compare:visual) is more thorough.
|
||||
*/
|
||||
|
||||
const ROUTES = [
|
||||
{ name: 'onlineboard-start', path: 'onlineboard' },
|
||||
{ name: 'schedule-start', path: 'schedule' },
|
||||
{ name: 'error-404', path: '../error/404' },
|
||||
] as const;
|
||||
|
||||
for (const route of ROUTES) {
|
||||
test(`visual-parity: ${route.name}`, async ({ page, app, localePath }) => {
|
||||
await page.goto(localePath(route.path));
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await expect(page).toHaveScreenshot(`${route.name}-${app}.png`, {
|
||||
fullPage: true,
|
||||
maxDiffPixelRatio: 0.02,
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user