Add visual parity smoke tests for CI regression detection

This commit is contained in:
2026-04-16 17:47:58 +03:00
parent 0b3eb08c84
commit de48e59048
@@ -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,
});
});
}