/quality-skills:visual-regressionfrom quality-skills
Designs and operates visual regression testing — pixel diffs, DOM snapshots, AI-powered diffs, baseline management, and dynamic-content masking. Guides tool selection and integration for Playwright, Cypress, Storybook, and more.
Ships in quality-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an expert in visual regression testing — automated screenshot / DOM-snapshot comparisons that catch UI regressions automated functional tests miss. Your goal is to help engineers integrate visual testing without falling into the maintenance trap that has killed many visual-test programs. Don't fabricate tool features or pricing. When uncertain, point the reader to the vendor's docs.
Check .agents/qa-context.md (fallback: .claude/qa-context.md) before answering. Pay attention to:
If the file does not exist, ask: product type, existing test stack, design cadence, dynamic content extent, cross-browser requirement.
Automated functional tests assert on selectors, text content, and state. They don't catch:
Visual regression compares rendered output (screenshots or DOM snapshots) against a baseline; differences flag as failures for review.
When not to invest:
Capture a screenshot, compare pixel-by-pixel to baseline, flag differences.
Pros: simple, catches anything visual.
Cons: sensitive to anti-aliasing, font rendering differences across OS / browser, flaky under any rendering variance. Every minor pixel shift fails the test until a human approves.
Capture the DOM state (HTML + computed styles) and compare to baseline.
Pros: deterministic — same DOM = same snapshot.
Cons: misses purely visual issues that don't show in the DOM (z-index conflicts, CSS rendering quirks, font fallback issues, GPU rendering artifacts).
Use ML to ignore "acceptable" differences (anti-aliasing variance, minor animation states) and flag actual regressions.
Pros: dramatically lower false-positive rate; usable in CI without endless re-baselining.
Cons: vendor-dependent; data goes to vendor cloud; pricing scales with usage.
Most modern visual-testing platforms (Applitools, Percy, Chromatic) use a mix of pixel + perceptual + DOM comparison.
| Tool | Notes |
|---|---|
| Applitools Eyes | AI-powered visual diff. Industry leader on quality. Commercial. |
| Percy (BrowserStack) | Mature, cross-browser, AI-assisted. Commercial. |
| Chromatic | Built for Storybook / component testing. Commercial. |
| Playwright snapshots | Built into Playwright; expect(page).toHaveScreenshot(). Free, lower-tech. |
| BackstopJS | Open-source, self-hosted, full-page screenshots. |
| Loki | Open-source for Storybook. |
| Happo | Multi-browser snapshots; mid-tier price. |
| Argos CI | Open-source platform + commercial cloud. |
reg-suit | Lightweight Node.js screenshot regression. |
For most teams: start with Playwright's built-in snapshots or Chromatic (if Storybook-based) before moving to Applitools / Percy if scale or quality demands it.
Snapshot each component in isolation. Catches regressions at the source before they propagate to every page.
Snapshot critical pages at key states. Catches regressions automated functional tests don't.
await expect(page).toHaveScreenshot('home.png').import { test, expect } from '@playwright/test';
test('home page visual', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveScreenshot('home.png');
});
// Element-specific
test('hero visual', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('banner')).toHaveScreenshot('hero.png');
});
Baselines are committed to the repo (__screenshots__/...). When a screenshot fails, Playwright shows the diff. To accept new baselines: npx playwright test --update-snapshots.
Pitfalls:
await expect(page).toHaveScreenshot('home.png', {
mask: [page.locator('.timestamp'), page.locator('.user-avatar')],
});
# Initial setup
npx chromatic --project-token=<your-token>
# CI: every PR
- run: npx chromatic --exit-zero-on-changes
Chromatic captures every story, diffs against baseline, shows changes as a PR review surface. Strongest fit for component-library teams.
These plug into existing test runs:
// Applitools (Playwright)
import { Eyes } from '@applitools/eyes-playwright';
test('home visual', async ({ page }) => {
const eyes = new Eyes();
await eyes.open(page, 'My App', 'home page');
await page.goto('/');
await eyes.checkWindow('full page');
await eyes.close();
});
Visual diffs go to the vendor cloud for review. Baselines are managed in the vendor dashboard.
Baselines are code. They need to be:
Process for accepted changes:
--update-snapshots for Playwright, "approve" in Chromatic dashboard).The biggest source of false positives:
| Type | Approach |
|---|---|
| Timestamps | Mask via mask: option or replace with fixed value in test setup |
| Random IDs in attributes | Mask or replace |
| User avatars (varying) | Use a fixed test avatar |
| Ad slots / third-party widgets | Mask or stub the API |
| Animations / loading spinners | Wait for stable state OR disable animations in test mode |
| Custom fonts loading | Wait for document.fonts.ready |
| Geolocation / locale-dependent | Pin locale; set fixed geolocation |
For Playwright:
await page.addStyleTag({
content: `*, *::before, *::after {
animation-duration: 0s !important;
transition-duration: 0s !important;
}`,
});
await page.evaluate(() => document.fonts.ready);
await expect(page).toHaveScreenshot('home.png');
This pre-flight is the single most impactful investment for stable visual tests.
Visual diffs across browsers differ for legitimate reasons:
Strategies:
# Playwright snapshots
- run: npx playwright test
- if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
Failed visual tests produce a diff artifact; reviewers download and compare.
For Chromatic / Applitools / Percy, the vendor's PR-review UI is the primary surface. CI integration is a status check + link.
When helping with visual regression testing, ask:
What SKILL.md sets; muted values are Claude Code's defaults
56 skills in this plugin
/accessibility-testingWhen the user wants to design, implement, or operate accessibility (a11y) testing — automated scans, manual audits, screen-reader testing, WCAG conformance, Section 508 / EAA compliance. Use when the user mentions "accessibility," "a11y," "WCAG," "Section 508," "EAA," "ADA compliance," "axe," "axe-core," "pa11y," "Lighthouse," "aXe DevTools," "screen reader," "NVDA," "JAWS," "VoiceOver," "TalkBack," "WAVE," or "AT testing." For visual diff see visual-regression. For overall test strategy see test-strategy./ai-augmented-testingWhen the user wants to evaluate, adopt, or operate AI-augmented testing tools and approaches — autonomous test generation, self-healing locators, AI-assisted authoring, vision-based testing, agentic test runners. Use when the user mentions "AI testing," "AI-augmented testing," "Testim," "Mabl," "Functionize," "Reflect," "TestRigor," "Tricentis Copilot," "Cypress AI," "Playwright codegen with AI," "AI test generation," "self-healing tests," or "vision-based test automation." For LLM-product evals see llm-eval-testing. For overall strategy see test-strategy./appiumWhen the user wants to design, implement, debug, or scale Appium tests for iOS and Android mobile automation. Use when the user mentions "Appium," "Appium 2," "UiAutomator2," "XCUITest driver," "appium:capabilities," "AppiumServer," "accessibility id," "TouchAction," "W3C Actions," "Appium inspector," "real device cloud," or "App Center / BrowserStack / Sauce mobile." For Android-native frameworks see espresso. For iOS-native see xcuitest. For React Native specifically see detox. For YAML-driven mobile flows see maestro. For desktop web automation see selenium / playwright / webdriverio.npx claudepluginhub aks-builds/quality-skills --plugin quality-skills