Playwright visual testing

From managedcode/dotnet-skills · View interactive version

Playwright visual testing is an AI agent skill from the GitHub repository managedcode/dotnet-skills. Add, repair, or review Playwright visual regression tests for browser-facing .NET apps, including screenshot baselines, Pixelmatch thresholds, deterministic rendering, and GitHub Actions artifacts. USE FOR: toHaveScreenshot, page.screenshot visual checks, Pixelmatch/pngjs comparison scripts, visual

How to use this skill

Skill file

Playwright Visual Testing

Trigger On

Do Not Use For

Load References

Current Upstream Notes

Workflow

flowchart TD
    A["Need visual regression coverage"] --> B{"Uses Playwright Test"}
    B -->|"Yes"| C["Prefer expect(page).toHaveScreenshot"]
    B -->|"No or custom compare needed"| D["Capture page.screenshot output"]
    D --> E["Compare with pixelmatch and pngjs"]
    C --> F["Stabilize viewport, data, animation, and volatile regions"]
    E --> F
    F --> G["Commit reviewed baselines"]
    G --> H["Run in CI and upload reports or image diffs"]
    H --> I["Triage expected, actual, and diff before changing thresholds"]
  1. Inspect the current browser-test surface:
  1. Choose the comparison path deliberately:
  1. Make screenshots deterministic before tuning thresholds:
  1. Keep baseline updates explicit:
  1. Wire CI for repeatability:
  1. Triage failures from artifacts:

Deliver

Validate

Common Pitfalls

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.