Skill library

Agent skill Review & testing

Playwright Visual Testing

Review the accessibility of visible web interface elements and interactions.

  • Accessibility

Install the skill

Installation method

Run the command from your project root with Node.js and npm.

npx skills@latest add https://github.com/manutej/luxor-claude-marketplace/tree/main/plugins/luxor-specialized-tools/skills/playwright-visual-testing --skill playwright-visual-testing --agent claude-code --yes

Check this file in your project.claude/skills/playwright-visual-testing/SKILL.md

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add https://github.com/manutej/luxor-claude-marketplace/tree/main/plugins/luxor-specialized-tools/skills/playwright-visual-testing --skill playwright-visual-testing

    Select your assistant and choose the project installation scope.

    Official instructions

The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. An approved baseline screen, stable local fixture, fixed viewport/browser options, and a Playwright test runner for snapshot comparisons.

View operation manual

What this skill helps with

  • Review the accessibility of visible web interface elements and interactions.

Good for

  • Accessible interfaces
Task
Create a repeatable visual comparison for an existing component
Inputs
An approved baseline screen, stable local fixture, fixed viewport/browser options, and a Playwright test runner for snapshot comparisons.
Output
A pair of reproducible screenshots and a reviewable diff, with functional assertions guarding the state being captured.
Skill name
playwright-visual-testing

Start from a reproducible real case

A broad request

Take screenshots before and after and treat anything similar as a pass.

Different device settings or late-loading content can create false visual changes. Conversely a static capture can look stable while the UI state is wrong.

A verifiable workflow

  1. Define reproducible data, viewport, fonts and observable readiness before capturing.
  2. The baseline includes the intended region with consistent motion settings.
  3. The comparison identifies intentional changes, unexpected shifts, or missing checks.

Playwright Visual Testing operation manual

A pair of reproducible screenshots and a reviewable diff, with functional assertions guarding the state being captured.

An approved baseline screen, stable local fixture, fixed viewport/browser options, and a Playwright test runner for snapshot comparisons.

  1. Select the state and stabilize the runtime

    Define reproducible data, viewport, fonts and observable readiness before capturing.

    Prompt · Step 1
    Use playwright-visual-testing on [route, component and intended states]. Choose a fixed browser and viewport for each baseline and use controlled data. Wait for actual expected headings or controls and any font or image load relevant to the frame. Use visual baselines inside the Playwright test runner. Use available browser tools when only exploring manually.
  2. Capture the component after checking the state

    The baseline includes the intended region with consistent motion settings.

    Prompt · Step 2
    Add or run a local screenshot assertion for [target component and fixture]. First assert the correct state and necessary keyboard affordance. Use expect(locator).toHaveScreenshot with consistent animations settings. Capture only the region this change owns. Generate a baseline for approved visuals through the runner, then compare subsequent output with the same environment.
  3. Review a visual diff before accepting changes

    The comparison identifies intentional changes, unexpected shifts, or missing checks.

    Prompt · Step 3
    Run [same test and viewport] twice and inspect diff, actual and expected screenshots for any mismatch. Compare data, readiness, animation and font conditions before adjusting thresholds. Explain the actual changed region and verify the control’s function before adopting a new authorized baseline.

Look up testing conditions

Use your installed tooling and local evidence.

Can I use toHaveScreenshot with a simple browser script?SKILL.md
Command or reference
expect(locator).toHaveScreenshot()
Examples
Use the Playwright test runner for its snapshot assertion and baseline storage. A browser script can capture images as evidence, with a separately managed comparison.

Troubleshooting and FAQ

Can I use toHaveScreenshot with a simple browser script?

Use the Playwright test runner for its snapshot assertion and baseline storage. A browser script can capture images as evidence, with a separately managed comparison.