From de48e59048ee71d037afea1d019c8f270a3e436e Mon Sep 17 00:00:00 2001 From: gnezim Date: Thu, 16 Apr 2026 17:47:58 +0300 Subject: [PATCH] Add visual parity smoke tests for CI regression detection --- .../cross-app/20-visual-parity-smoke.spec.ts | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/e2e-angular/cross-app/20-visual-parity-smoke.spec.ts diff --git a/tests/e2e-angular/cross-app/20-visual-parity-smoke.spec.ts b/tests/e2e-angular/cross-app/20-visual-parity-smoke.spec.ts new file mode 100644 index 00000000..f3bff1d7 --- /dev/null +++ b/tests/e2e-angular/cross-app/20-visual-parity-smoke.spec.ts @@ -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, + }); + }); +}