← ClaudeAtlas

visual-regression-baselineslisted

Playwright screenshot tests scoped to stable containers with an explicitly chosen tolerance, dynamic content frozen rather than masked, and a first run treated as baseline creation. Use when screenshot tests need to survive a second week — an unstated tolerance and a first run counted as green are why most visual suites get deleted.
QAIA-Project/QAIA · ★ 0 · Testing & QA · score 70
Install: claude install-skill QAIA-Project/QAIA
# Visual Regression > **Standalone adaptation.** Self-contained version of the `visual-check` skill from > [QAIA](https://github.com/QAIA-Project/QAIA) (MIT). QAIA is pre-alpha and says so. ## 1. One snapshot per key screen, with the tolerance stated ```js await expect(locator).toHaveScreenshot('<screen>.png', { maxDiffPixelRatio: 0.002 }); ``` **That number decides pass or fail, so it is stated rather than left blank.** `0.002` — 0.2 % of pixels — absorbs anti-aliasing and font-hinting differences between runs on the same machine without hiding a real change: a moved button, a wrong colour or a shifted layout each move far more than 0.2 % of a screen. Raise it only with a stated reason — a target rendering text differently across OS versions, say — and **never to make a failing test pass**. Prefer masking or freezing the unstable region. If a screen genuinely needs a different tolerance, record **which screen and why**. ## 2. The first run is not a pass The first run **creates** the baselines. It will report failures, and that is correct behaviour, not a problem to work around. **State this explicitly in the report.** A reader who sees only the green second run learns the wrong thing about what a first run means. Commit the baselines deliberately, after looking at them — they are now the definition of correct. ## 3. Scope each snapshot to a stable container A container, not the whole viewport. Whole-page snapshots fail on a footer counter and teach the team to rais