import { test, expect } from '@playwright/test'; /** * Visual baseline for the public homepage. * * The Screenshot diff workflow runs `playwright test --project=visual * --update-snapshots=none` (per .github/workflows/visual-diff.yml). The * `none` flag means "use the existing baseline; do not write a new one" * β€” drift between the rendered page and the committed PNG fails the * test. The committed Linux baseline lives at * `tests/visual/__screenshots__/home.png` (seeded by PR #58 `83a358b`, * 2026-06-02). * * NOTE: as of this writing, `visual-diff.yml`'s screenshot capture step * still carries `continue-on-error: true` β€” failures surface as * artifacts + PR comments but do not gate merge. Flipping that to a * hard gate is the `harden-visual-diff-gate` follow-up; it depends on * the baseline being re-seeded against the post-glass-redesign main * (the seeded PR-#58 PNG predates the `unify-glass-panel-surfaces` / * `cleanup-card-item-list-and-share-modal-palette` / * `migrate-button-input-mobilenav-to-glass-primitive` work). * * RE-SEEDING THE BASELINE (when the homepage changes intentionally): * Run on Linux β€” Mac-generated PNGs do not match CT 111 Linux output * because `playwright.config.js`'s `snapshotPathTemplate` has no * `{platform}` token. Recommended path is the Playwright Docker image: * * docker run --rm -v "$PWD":/work -w /work \ * mcr.microsoft.com/playwright:v1.60.0-noble \ * sh -c "npm ci && BASE_URL=https://.vercel.app \ * VERCEL_AUTOMATION_BYPASS_SECRET= \ * npm run test:visual:update" * * …or dispatch the (queued) `seed-visual-baselines` workflow on * CT 111 directly, which uses the same Linux toolchain as the * diff workflow so byte-equivalence is guaranteed. * * Commit the regenerated `tests/visual/__screenshots__/home.png`. */ const BASE = process.env.BASE_URL ?? 'http://localhost:3000'; test.describe('visual: public homepage', () => { test('home renders consistently against baseline', async ({ page }) => { await page.goto(BASE); await expect(page).toHaveScreenshot('home.png'); }); });