/qa-testing:percy-visual-regression-testingfrom qa-testing
Integrates Percy visual regression testing with Playwright and Cypress. Covers snapshot strategy, responsive widths, dynamic-content stabilization, and CI gating to catch UI regressions without approval fatigue.
Ships in qa-testing. 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 front-end QA engineer specializing in Percy (BrowserStack). When the user asks you to add visual testing, integrate Percy with an E2E suite, or fix noisy visual diffs, follow these instructions.
npm i -D @percy/cli @percy/playwright
export PERCY_TOKEN=... # project token from percy.io
import { test } from '@playwright/test';
import percySnapshot from '@percy/playwright';
test('checkout states', async ({ page }) => {
await page.goto('/checkout');
await page.waitForLoadState('networkidle');
await percySnapshot(page, 'Checkout - empty cart');
await addItemsViaApi(page, 3);
await page.reload();
await page.getByTestId('cart-total').waitFor();
await percySnapshot(page, 'Checkout - 3 items', { widths: [375, 768, 1280] });
await page.getByRole('button', { name: 'Apply coupon' }).click();
await page.getByRole('dialog').waitFor();
await percySnapshot(page, 'Checkout - coupon modal');
});
npx percy exec -- npx playwright test e2e/visual.spec.ts
Cypress equivalent: @percy/cypress, cy.percySnapshot('name', { widths: [...] }). Storybook: @percy/storybook snapshots every story, the highest-leverage entry point for design systems.
| Layer | What to snapshot | Cadence |
|---|---|---|
| Design system | Every component story (via Storybook) | Every PR |
| Money-path pages | Each state of checkout, auth, pricing | Every PR |
| Marketing/content pages | Above-the-fold at 3 widths | Nightly |
| Full-page long-tail | Top 20 templates, not every URL | Nightly |
Name snapshots as stable identifiers ("Checkout - coupon modal"), never with timestamps or data values; renamed snapshots orphan their baselines. Standard widths: 375 (mobile), 768 (tablet), 1280 (desktop); add 1920 only where layout actually changes.
/* percy.css (applied only in Percy's rendering) */
.timestamp, .relative-time { visibility: hidden !important; }
.avatar-random { background: #ccc !important; }
* { animation: none !important; transition: none !important; caret-color: transparent !important; }
# .percy.yml
version: 2
snapshot:
percy-css: |
@import url("./percy.css");
widths: [375, 1280]
discovery:
network-idle-timeout: 500
Additional stabilizers: seed test data (fixed names, fixed prices); freeze the clock in the app under test where dates render; mock third-party embeds (maps, ads, chat widgets) at the network layer; wait for fonts (document.fonts.ready) before snapshotting; scope flaky regions with per-snapshot percyCSS rather than growing the global file forever.
# .github/workflows/visual.yml
- name: Percy visual tests
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
run: npx percy exec -- npx playwright test e2e/visual/
# parallel shards: run percy exec on each shard with PERCY_PARALLEL_TOTAL set,
# so Percy assembles one build from all shards
Budget note: Percy prices by screenshots (snapshots x widths x browsers); the strategy table above exists to keep the count intentional. Track monthly usage; a usage spike usually means someone looped snapshots over a data set.
Choose Percy when you want managed rendering, cross-browser visual diffs, and a mature review UI tightly integrated with PR checks. Consider Playwright's built-in toHaveScreenshot() when budget is zero and one rendering environment is acceptable (you own baseline storage and flake management); Chromatic when your whole visual surface lives in Storybook; Applitools when AI-based region matching is worth the price for highly dynamic UIs.
networkidle alone; wait for the specific element/fonts, spinners pass networkidleWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
percy, visual-regression, snapshot-testing, ui-testing, playwright, cypress
npx claudepluginhub hackernoon/cuttlefish-agent-skills --plugin qa-testing422 skills in this plugin
/a-b-test-validationA/B Test ValidationValidating A/B test implementations including traffic splitting accuracy, statistical significance calculation, metric tracking, and experiment cleanup./accessibility-a11y-enhancedAccessibility A11y EnhancedComprehensive WCAG compliance and accessibility testing covering ARIA, keyboard navigation, screen readers, color contrast, and automated a11y validation./add-seed-skillsUse when adding or editing QA skills in seed-skills/ or getting them onto the live qaskills.sh catalog, e.g. "add N new skills", "create a seed skill for X", "seed the database", "the skill page is empty", "skill 404s on the site".