/playwright-visual:visual-testingfrom playwright-visual
Delegates visual test execution to the Playwright test runner with the correct flags for baseline consistency: `--project=visual` for single-browser runs, `--update-snapshots` mode when intentional updates are needed, comparison artifact generation, and pixel diff reporting.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /playwright-visual:visual-testing still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Delegates visual test execution to the Playwright test runner with the correct flags for baseline consistency: --project=visual for single-browser runs, --update-snapshots mode when intentional updates are needed, comparison artifact generation, and pixel diff reporting.
npx playwright test invocation for visual suite runs.--project=visual) for baseline consistency.--update-snapshots safely.# Run the visual project only (single browser, consistent baselines)
npx playwright test --project=visual
# Run with verbose output to see per-test diff percentages
npx playwright test --project=visual --reporter=html
# Run a single visual spec file
npx playwright test tests/visual/specs/hero.visual.spec.ts --project=visual
# Run tests matching a description pattern
npx playwright test --project=visual --grep "landing page"
# Run in headed mode for local debugging
npx playwright test --project=visual --headed
# Update ALL baselines (use with caution — review every changed PNG)
npx playwright test --project=visual --update-snapshots
# Update baselines for a specific test or file only
npx playwright test --project=visual --update-snapshots --grep "hero section"
npx playwright test tests/visual/specs/hero.visual.spec.ts --project=visual --update-snapshots
After updating:
# Open the HTML report to review the before/after diff for every changed baseline
npx playwright show-report
# Stage only the snapshot changes, review, then commit
git diff --stat tests/visual/__screenshots__/
git add tests/visual/__screenshots__/
git commit -m "chore(visual): update hero baselines — new brand colour"
// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
snapshotDir: 'tests/visual/__screenshots__',
expect: {
toHaveScreenshot: {
animations: 'disabled',
maxDiffPixelRatio: 0.02,
threshold: 0.1,
},
},
reporter: [
['html', { outputFolder: 'playwright-report', open: 'never' }],
['list'],
],
projects: [
{
name: 'visual',
use: {
...devices['Desktop Chrome'],
viewport: { width: 1280, height: 800 },
},
testMatch: 'tests/visual/**/*.visual.spec.ts',
},
],
});
# GitHub Actions
- name: Run visual regression tests
run: npx playwright test --project=visual
env:
CI: true # Playwright treats missing baselines as failures when CI=true
- name: Upload visual report on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-visual-report
path: playwright-report/
retention-days: 14
- name: Upload diff images on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-visual-diffs
path: test-results/
retention-days: 14
When a visual test fails, Playwright reports:
Error: Screenshot comparison failed:
5 pixels (ratio 0.0039 %) are different.
Expected: tests/visual/__screenshots__/hero-desktop-chromium-linux.png
Received: test-results/hero-desktop-visual/hero-desktop-actual.png
Diff: test-results/hero-desktop-visual/hero-desktop-diff.png
Open playwright-report/index.html to see the expected, actual, and diff images side-by-side with the pixel diff percentage highlighted.
--project=visual — never mix visual and functional tests in the same run for baseline management purposes.--update-snapshots in CI pipeline scripts; set CI=true instead so missing baselines are treated as failures.playwright-report/ and test-results/ as CI artifacts on failure so diffs are accessible without re-running locally.What SKILL.md sets; muted values are Claude Code's defaults
None: SKILL.md is the whole skill.
Other plugins' skills for the same job
6 skills in this plugin
/screenshot-baselineSkill: screenshot-baselineManage the full lifecycle of visual regression baselines: initial capture, intentional updates, platform-specific naming conventions, Git LFS storage, and PR review gates./visual-assertionsSkill: visual-assertionsPatterns for `toHaveScreenshot` and `toMatchSnapshot` assertions: full-page vs element captures, all supported options, masking dynamic regions, and DO / DON'T examples./visual-comparisonSkill: visual-comparisonConfigure Playwright's pixel-diff comparison engine: tune `maxDiffPixels`, `maxDiffPixelRatio`, and `threshold` per component type; normalize cross-platform font anti-aliasing; and mask locators that emit dynamic content (timestamps, avatars, ads)./visual-project-structureSkill: visual-project-structureScaffold the visual regression test directory layout, configure `.gitattributes` for Git LFS on PNG baselines, and generate snapshot update helper scripts./visual-test-generationSkill: visual-test-generationGenerate visual snapshot tests using Playwright's `toHaveScreenshot()` assertion. Covers full-page captures, element-level screenshots, masked regions for dynamic content, and responsive viewport sweeps across mobile, tablet, and desktop breakpoints.npx claudepluginhub gagandeepp/software-agent-teams --plugin playwright-visual