Agent skill

Playwright Visual Testing

by managedcode in 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.

MITAuto-check passedTesting & QA

Install Playwright Visual Testing

skills CLI
$ npx skills add managedcode/dotnet-skills --skill playwright-visual-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install managedcode/dotnet-skills playwright-visual-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/managedcode/dotnet-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/catalog/Testing/Playwright/skills/playwright-visual-testing .claude/skills/playwright-visual-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
playwright-visual-testing
GitHub stars
486
Token cost
~1.9k tokens
SKILL.md length
873 words
Files
3 (incl. references)
Skills in repo
81
Repo updated
First seen
Licence
MIT

At a glance

Add, repair, or review Playwright visual regression tests for browser-facing .NET apps, including screenshot baselines, Pixelmatch thresholds, deterministic rendering, and GitHub Actions artifacts.

  • Works in 6 steps: Inspect the current browser-test surface → Choose the comparison path deliberately → Make screenshots deterministic before… → …
  • : toHaveScreenshot
  • SKILL.md covers Trigger On, Do Not Use For, Load References and Current Upstream Notes, plus 4 more sections
  • Calls npx, npm and dotnet

What it does

Playwright Visual Testing is an agent skill from 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 baseline updates, screenshot diff triage, or CI workflows for UI regression screenshots. DO NOT USE FOR: pure unit tests, accessibility audits, browser-debugging sessions, or frontend linting.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `manifest.json` and `references/ci-and-snapshot-patterns.md`).

It sits in Testing & QA, covering Visual regression testing, Browser testing and Linting and formatting. It works with Playwright, GitHub Actions and .NET. The repository describes itself as: Installable .NET skill catalog and CLI for Codex, Claude Code, GitHub Copilot, and Gemini. The licence is MIT.

When your agent uses it

  • : toHaveScreenshot
  • Page.screenshot visual checks
  • Pixelmatch/pngjs comparison scripts
  • Visual baseline updates

Example prompts

  • “/playwright-visual-testing”

Requirements

  • Node.js

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Inspect the current browser-test surface
  2. Choose the comparison path deliberately
  3. Make screenshots deterministic before tuning thresholds
  4. Keep baseline updates explicit
  5. Wire CI for repeatability
  6. Triage failures from artifacts

What it can do on your machine

Read from SKILL.md and the folder at commit 535dd55. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • npm
    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx and npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Playwright Visual Testing loads about 1.9k tokens when it runs, and up to ~4.2k if it reads all its reference files. Until then it costs about 130 tokens; SKILL.md has 873 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~130
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from managedcode/dotnet-skills at commit 535dd55, republished under its MIT licence (© managedcode). 873 words, ~1,949 tokens.

Download SKILL.mdSave it as .claude/skills/playwright-visual-testing/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
playwright-visual-testing
description
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 baseline updates, screenshot diff triage, or CI workflows for UI regression screenshots. DO NOT USE FOR: pure unit tests, accessibility audits, browser-debugging sessions, or frontend linting.

Playwright Visual Testing

Trigger On

  • the user asks for pixel, screenshot, visual, or UI regression testing with Playwright
  • a .NET repo needs visual baselines for ASP.NET Core, Blazor, WebAssembly, static pages, or generated frontend assets
  • GitHub Actions should run Playwright screenshots and expose expected, actual, and diff artifacts
  • tests fail with screenshot mismatches, noisy baselines, or unstable visual snapshots

Do Not Use For

  • pure .NET unit or integration tests without a browser surface
  • accessibility, SEO, PWA, or security-header audits; route those to webhint
  • browser debugging or live DOM inspection; route that to chrome-devtools-mcp
  • JavaScript, TypeScript, CSS, or HTML linting; route those to biome, eslint, stylelint, or htmlhint

Load References

  • Read CI and snapshot patterns when adding a new visual test suite, wiring GitHub Actions, choosing between Playwright snapshots and a standalone Pixelmatch script, or stabilizing screenshot diffs.

Current Upstream Notes

  • The August 2026 Playwright CI and visual-comparison docs still require browser dependencies to be installed explicitly in CI and warn that screenshot rendering varies by host OS, browser build, fonts, headless mode, and hardware. Generate and review baselines in the same environment used for comparison.
  • The CI guide recommends against caching browser binaries by default: restoring them often costs as much as downloading, and OS dependencies still need an explicit install. If a runner must cache browsers, key it by the exact Playwright version and keep dependency installation in the job.
  • Current CI examples use actions/checkout@v6, actions/setup-node@v6, and actions/upload-artifact@v5; use a full checkout only when --only-changed needs the pull-request base ref.
  • Keep Playwright parallel by default. Do not set workers: 1 merely because CI or screenshots are involved. Isolate test data and browser contexts, enable fullyParallel when tests are independent, and shard large suites across CI jobs. Reduce concurrency only for the smallest tests that destructively change the same external state.
  • Playwright v1.62.1 fixes TypeScript configuration resolution regressions, accessibility snapshots that dropped names or image-style actionable elements, and branded primitive arguments passed to page.evaluate(). Re-run config discovery, accessibility snapshots, and TypeScript compile checks before accepting new visual baselines.
  • Keep --update-snapshots as an intentional local review action. Pull-request CI should retain expected, actual, diff, trace, and report artifacts instead of silently accepting a new baseline.

Workflow

mermaid
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:
    • nearest AGENTS.md
    • package.json, lockfile, Playwright config, test folders, and CI workflows
    • how the app starts locally: dotnet run, Aspire AppHost, static preview, or frontend dev server
  2. Choose the comparison path deliberately:
    • default to Playwright Test expect(page).toHaveScreenshot() when the repo can use Playwright Test snapshots
    • use page.screenshot() plus a standalone Pixelmatch script only when the repo needs article-style central screenshots/baseline, screenshots/actual, and screenshots/diff folders, non-Playwright image inputs, or custom reporting outside Playwright Test
  3. Make screenshots deterministic before tuning thresholds:
    • fix viewport, browser project, locale/time zone, color scheme, and device scale factor
    • use stable test data and wait for the app-specific ready state
    • disable animations or use Playwright screenshot options for animations
    • mask or hide volatile regions such as ads, time, avatars, random IDs, spinners, and third-party iframes
  4. Keep baseline updates explicit:
    • generate missing baselines once, review them, and commit them
    • update intended Playwright snapshots with npx playwright test --update-snapshots
    • do not auto-create or auto-update baselines in pull-request CI
  5. Wire CI for repeatability:
    • use npm ci, then npx playwright install --with-deps, then the focused Playwright command
    • preserve Playwright's parallel workers; use fullyParallel for isolated tests and CI sharding for large suites
    • constrain only a narrow destructive shared-state collision, never the whole visual suite for generic stability
    • optionally run npx playwright test --only-changed=origin/$GITHUB_BASE_REF first on pull requests for faster feedback, but always follow it with the full suite because changed-test selection is heuristic
    • use the same OS, browser build, fonts, headless mode, and rendering environment that produced the committed baselines; an official Playwright container is useful when host drift keeps changing pixels
    • upload the Playwright HTML report and test-results/, or upload screenshots/baseline, screenshots/actual, and screenshots/diff for a custom Pixelmatch flow
  6. Triage failures from artifacts:
    • inspect expected, actual, and diff images together
    • classify the mismatch as intentional design change, rendering nondeterminism, app bug, or baseline drift
    • fix nondeterminism before increasing maxDiffPixels, maxDiffPixelRatio, or Pixelmatch mismatch thresholds
Show full SKILL.md (185 more words)Show less

Deliver

  • a Playwright visual-test path that matches the repo's existing package manager and test layout
  • committed reviewed baseline images or a clear command to generate and review them
  • deterministic screenshot controls for dynamic UI regions
  • GitHub Actions report or diff artifacts that make failures reviewable
  • a short note on whether the implementation uses built-in Playwright snapshots or a custom Pixelmatch comparison script

Validate

  • npm ci
  • npx playwright install --with-deps
  • npx playwright test or the repo's focused visual-test script
  • npx playwright test --update-snapshots only when accepting intentional baseline changes
  • in CI changes, confirm artifact upload uses maintained GitHub Actions versions and runs on pull requests without requiring secrets

Common Pitfalls

  • capturing screenshots before the UI is stable
  • generating baselines on one OS and comparing them on another
  • sharing one mutable browser context across tests
  • masking too much of the page and removing the regression signal
  • raising thresholds to hide animation, font, clock, or data nondeterminism
  • forcing one CI worker instead of fixing data/context isolation or sharding the suite
  • using a custom Pixelmatch script when Playwright's built-in screenshot assertion would give better trace, report, and snapshot integration

© managedcode, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in catalog/Testing/Playwright/skills/playwright-visual-testing of managedcode/dotnet-skills.

  • SKILL.md
  • manifest.json
  • references/ci-and-snapshot-patterns.md

Open the folder on GitHubat commit 535dd55

Compare with similar skills

Playwright Visual Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Playwright Visual Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Playwright Visual Testing this skillmanagedcode/dotnet-skills486—~1.9kAutomated safety check: PassMIT
Web Testing with Playwright and Vitestwithkynam/vibecode-pro-max-kit1.1k—~892Automated safety check: PassApache-2.0
Debug Playwright Prowquay/quay2.8k—~2.2kAutomated safety check: PassApache-2.0
Playwright Testingchongdashu/vibejam-starter-pack149—~2.2kAutomated safety check: PassNone
Testingradix-ng/primitives274—~3.3kAutomated safety check: PassMIT
Selector Drift Recoverypetrkindlmann/qa-skills163—~5.1kAutomated safety check: PassMIT

Similar skills

  • Web Testing with Playwright and Vitest

    withkynam/vibecode-pro-max-kit

    Covers web testing from unit to E2E, load, visual, accessibility and security checks, with Playwright, Vitest and k6 guides plus a Playwright setup script.

    1.1k GitHub stars~892 tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Deep-dive diagnosis of a Playwright test failure already isolated to one Quay Prow/OpenShift CI run: downloads its GCS artifacts (results.json, JUnit, build/pod logs, Jaeger traces), classifies real…

    2.8k GitHub stars~2.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Playwright Testing

    chongdashu/vibejam-starter-pack

    Plan, implement, and debug frontend tests: unit/integration/E2E/visual/a11y.

    149 GitHub stars~2.2k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • Testing

    radix-ng/primitives

    Test Radix NG primitives across every layer and pick the RIGHT one for a change: Vitest unit (zoneless), jest-axe a11y, Playwright browser regression (apps/visual-regression), SSR…

    274 GitHub stars~3.3k tokensUpdated 8 days ago
    Testing & QAAuto-check passed
  • Selector Drift Recovery

    petrkindlmann/qa-skills

    Bulk-regenerate broken test selectors after a UI refactor or redesign.

    163 GitHub stars~5.1k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Playwright

    EliasOulkadi/shokunin

    Browser automation, web scraping, E2E testing, and visual regression with Playwright.

    114 GitHub stars~3.6k tokensUpdated 2 days ago
    Testing & QAAuto-check: notes

More from managedcode/dotnet-skills

All 81 skills in this repo
  • Analyzer Config

    managedcode/dotnet-skills

    Use a repo-root .editorconfig to configure free .NET analyzer and style rules.

    486 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Archunitnet

    managedcode/dotnet-skills

    Use the open-source free ArchUnitNET library for architecture rules in .NET tests.

    486 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Aspire

    managedcode/dotnet-skills

    Build, upgrade, and operate Aspire 13.5.x C or TypeScript application hosts with the current CLI, AppHost, ServiceDefaults, integrations, dashboard, testing, MCP, and deployment patterns for…

    486 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Aspnet Core

    managedcode/dotnet-skills

    Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on current .NET.

    486 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Asynkron Profiler

    managedcode/dotnet-skills

    Use the open-source free Asynkron.Profiler dotnet tool for CLI-first CPU, allocation, exception, contention, and heap profiling of .NET commands or existing trace artifacts.

    486 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Azure Functions

    managedcode/dotnet-skills

    Build, review, or migrate Azure Functions in .NET with correct execution model, isolated worker setup, bindings, DI, and Durable Functions patterns.

    486 GitHub stars~2.6k tokensUpdated today
    Auto-check passed

Categories

Questions about Playwright Visual Testing

What does Playwright Visual Testing do?

Add, repair, or review Playwright visual regression tests for browser-facing .NET apps, including screenshot baselines, Pixelmatch thresholds, deterministic rendering, and GitHub Actions artifacts. Playwright Visual Testing is an agent skill from managedcode/dotnet-skills.NET apps, including screenshot baselines, Pixelmatch thresholds, deterministic rendering, and GitHub Actions artifacts.

When should I use Playwright Visual Testing?

Playwright Visual Testing fits situations like: : toHaveScreenshot; page.screenshot visual checks; pixelmatch/pngjs comparison scripts; visual baseline updates.

How do I install Playwright Visual Testing in Claude Code?

Run `npx skills add managedcode/dotnet-skills --skill playwright-visual-testing -a claude-code`. Or copy the skill folder (catalog/Testing/Playwright/skills/playwright-visual-testing in managedcode/dotnet-skills) into .claude/skills/playwright-visual-testing in your project. Claude Code loads it when a task matches its description.

How do I install Playwright Visual Testing in Codex?

Run `npx skills add managedcode/dotnet-skills --skill playwright-visual-testing -a codex`. Or copy the skill folder (catalog/Testing/Playwright/skills/playwright-visual-testing in managedcode/dotnet-skills) into .agents/skills/playwright-visual-testing in your project. Codex loads it when a task matches its description.

Can I use Playwright Visual Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add managedcode/dotnet-skills --skill playwright-visual-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/playwright-visual-testing, .gemini/skills/playwright-visual-testing, .github/skills/playwright-visual-testing and .opencode/skills/playwright-visual-testing in your project.

What does Playwright Visual Testing need to run?

Going by SKILL.md and its folder, Playwright Visual Testing needs the command-line tools its instructions call (npx, npm and dotnet). Our summary lists: Node.js.

Does Playwright Visual Testing access the network?

SKILL.md contains no URLs. Its commands use npx and npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Playwright Visual Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Playwright Visual Testing use?

Playwright Visual Testing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Playwright Visual Testing use?

About 1.9k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.3k tokens, read only when the agent opens those files.

What are the alternatives to Playwright Visual Testing?

Skills that share tags, products or a category with Playwright Visual Testing: Web Testing with Playwright and Vitest (withkynam/vibecode-pro-max-kit, 1.1k stars), Debug Playwright Prow (quay/quay, 2.8k stars), Playwright Testing (chongdashu/vibejam-starter-pack, 149 stars) and Testing (radix-ng/primitives, 274 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Playwright Visual Testing?

managedcode (a GitHub organization) maintains it in managedcode/dotnet-skills, which has 486 GitHub stars. The repository holds 81 skills in this directory. The repository was last updated on October 7, 2026.

Source: managedcode/dotnet-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.