skills/visual-regression-testing/SKILL.md
Detect unintended visual changes in UI by comparing screenshots across versions. Use for visual regression, screenshot diff, Percy, Chromatic, UI testing, and visual validation.
npx skillsauth add aj-geddes/useful-ai-prompts visual-regression-testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Visual regression testing captures screenshots of UI components and pages, then compares them across versions to detect unintended visual changes. This automated approach catches CSS bugs, layout issues, and design regressions that traditional functional tests miss.
Minimal working example:
// tests/visual/homepage.spec.ts
import { test, expect } from "@playwright/test";
test.describe("Homepage Visual Tests", () => {
test("homepage matches baseline", async ({ page }) => {
await page.goto("/");
// Wait for images to load
await page.waitForLoadState("networkidle");
// Full page screenshot
await expect(page).toHaveScreenshot("homepage-full.png", {
fullPage: true,
maxDiffPixels: 100, // Allow small differences
});
});
test("responsive design - mobile", async ({ page }) => {
await page.setViewportSize({ width: 375, height: 667 }); // iPhone SE
await page.goto("/");
await expect(page).toHaveScreenshot("homepage-mobile.png");
});
test("responsive design - tablet", async ({ page }) => {
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents | |---|---| | Playwright Visual Testing | Playwright Visual Testing | | Percy Visual Testing | Percy Visual Testing | | Chromatic for Storybook | Chromatic for Storybook | | Cypress Visual Testing | Cypress Visual Testing | | BackstopJS Configuration | BackstopJS Configuration | | Handling Dynamic Content | Handling Dynamic Content | | Testing Responsive Components | Testing Responsive Components |
development
Implement Zero Trust security model with identity verification, microsegmentation, least privilege access, and continuous monitoring. Use when building secure cloud-native applications.
development
Prevent Cross-Site Scripting (XSS) attacks through input sanitization, output encoding, and Content Security Policy. Use when handling user-generated content in web applications.
tools
Create wireframes and interactive prototypes to visualize user interfaces and gather feedback early. Use tools and techniques to communicate design ideas before development.
development
Implement real-time bidirectional communication with WebSockets including connection management, message routing, and scaling. Use when building real-time features, chat systems, live notifications, or collaborative applications.