From playwright-visual
Manage the full lifecycle of visual regression baselines: initial capture, intentional updates, platform-specific naming conventions, Git LFS storage, and PR review gates.
How this skill is triggered — by the user, by Claude, or both
Slash command
/playwright-visual:screenshot-baselineThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Manage the full lifecycle of visual regression baselines: initial capture, intentional updates, platform-specific naming conventions, Git LFS storage, and PR review gates.
Manage the full lifecycle of visual regression baselines: initial capture, intentional updates, platform-specific naming conventions, Git LFS storage, and PR review gates.
--update-snapshots command and explain when it is safe to use..gitattributes for Git LFS on .png snapshot files.Playwright auto-generates snapshot names using the pattern:
<test-name>-<project>-<platform>.png
Examples:
| Environment | Generated filename |
|---|---|
| CI (Linux, chromium project) | hero-desktop-chromium-linux.png |
| Local macOS (chromium project) | hero-desktop-chromium-darwin.png |
| Local Windows (chromium project) | hero-desktop-chromium-win32.png |
Platform suffixes ensure that Linux CI baselines are never overwritten by local captures.
# 1. Run the visual suite — tests will FAIL on first run (no baselines yet).
npx playwright test --project=visual
# 2. Accept the generated screenshots as baselines.
npx playwright test --project=visual --update-snapshots
# 3. Verify the generated PNGs look correct, then commit.
git add tests/visual/__screenshots__/
git commit -m "chore(visual): add initial baselines"
# After a deliberate UI change, regenerate only the affected baselines.
npx playwright test --project=visual --update-snapshots --grep "hero section"
# Review the diff in the Playwright HTML report before committing.
npx playwright show-report
# Commit with a clear message explaining the visual change.
git add tests/visual/__screenshots__/
git commit -m "chore(visual): update hero baselines — new brand colour"
Add to .gitattributes at the repository root:
tests/visual/__screenshots__/**/*.png filter=lfs diff=lfs merge=lfs -text
Initialize LFS if not already configured:
git lfs install
git lfs track "tests/visual/__screenshots__/**/*.png"
--update-snapshots in CI pipeline scripts.CI=true in the environment; Playwright will fail tests rather than regenerate missing baselines.playwright-report/ artifact in CI so pixel diffs are visible on failure.# GitHub Actions example
- name: Run visual tests
run: npx playwright test --project=visual
env:
CI: true
- name: Upload visual report
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-visual-report
path: playwright-report/
When a PR modifies baseline PNGs, reviewers must:
main must always originate from CI (Linux) to prevent cross-platform drift.--update-snapshots locally only to preview what a change looks like; regenerate on CI before merging.chore(visual): so they are easy to filter in the log.npx claudepluginhub gagandeepp/software-agent-teams --plugin playwright-visualGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.