playwright-component-testing

playwright-component-testing is a skill for Claude Code, Codex from microsoft/playwright. It costs 69 tokens per session (2,357 once invoked), scanned A, original, Apache-2.0.

A method for testing React or Vue components in isolation with ordinary Playwright browser tests. It uses small story files that show a component in a specific situation and a gallery page that displays those stories.

In plain words
What is it for?
Use it to create component scenarios, open them in the story gallery, and check their behavior with Playwright tests.
Why use it?
It avoids needing a separate component-testing runner, bundler integration, or extra packages. Developers can test components through the same browser-testing tools used for full pages.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create component scenarios, open them in the story gallery, and check their behavior with Playwright tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/microsoft/playwright/playwright-component-testing
About the project

Playwright is a framework for automating and testing websites through one API that drives Chromium, Firefox, and WebKit. Developers use it for end-to-end tests, browser automation scripts, and AI-agent web interactions. The catalogue add-ons help coding and AI agents use Playwright for testing and browser automation.

microsoft/playwright · 97,799 stars · on GitHub · playwright.dev

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add microsoft/playwright --skill playwright-component-testing
Clone the repo
git clone --depth 1 https://github.com/microsoft/playwright

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for playwright-component-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/microsoft/playwright/playwright-component-testing/github.svg)](https://agentmods.dev/skills/microsoft/playwright/playwright-component-testing)
Your own site
<a href="https://agentmods.dev/skills/microsoft/playwright/playwright-component-testing"><img src="https://agentmods.dev/badge/skills/microsoft/playwright/playwright-component-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for playwright-component-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/microsoft/playwright/playwright-component-testing"><img src="https://agentmods.dev/badge/skills/microsoft/playwright/playwright-component-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,357 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Snyk pass 6 Sept 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 35
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00069 $0.02357
Opus 5.5 $0.00028 $0.00943
Sonnet 5.5 $0.00014 $0.00471
Haiku 4.5 $0.00007 $0.00236

Measured 1mo ago against content hash 60f57b31767d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

playwright-component-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 3 executable files (templates/react/button.spec.ts, templates/vue/button.spec.ts, templates/vue/Button.story.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

packages/playwright-core/src/tools/skills/playwright-component-testing/SKILL.md · 137 lines

How it starts

The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Component Testing with Playwright

Test components with regular Playwright e2e tests against a small story gallery page hosted by the app's own dev server. No extra test runner, bundler integration or npm packages are required.

Concept

  • A story is a tiny wrapper component that embeds the component under test in one specific scenario: hard-coded props, mock data, providers, recorded callbacks. Stories live next to the component in *.story.tsx (or .ts/.jsx/.js/.vue) files; each named export is one story.
  • The gallery is a single page you implement to references/gallery-spec.md: it exposes window.mount(params) / window.unmount() that render a story — resolved from your story files (e.g. with import.meta.glob) — into #root. It is framework-specific and yours to own — there is no template to copy for it.
  • Tests are plain Playwright tests. The built-in mount(storyId, props?) fixture (from @playwright/test) drives the gallery's window.mount and returns a Locator for the gallery root (#root). Scope the queries from there — component.getByRole('button').click(), not component.click(). Nothing to scaffold for it.

Everything the component needs must be set up inside the story (it runs in the browser); everything the test asserts must be observable through the page (DOM, URL, network). Where the component takes callbacks, the story creates the state, provides the callbacks and records the state into a hidden form for the test to assert on. mount(id, props) passes plain serializable props to the story.

Setup workflow

  1. Detect the framework and bundler. React vs Vue decides the framework notes and example story to follow. Then:
    • App runs on Vite (has vite.config.*): the gallery is served by the existing dev server at /playwright/gallery/index.html — Vite serves any .html file under the project root, the app's plugins/aliases/CSS apply automatically, and vite build ignores it. No extra server needed.
    • Anything else (Next.js, webpack, no dev server): run a small standalone dev server (e.g. Vite) that serves the gallery page, and point baseURL at it. Requires vite and the framework plugin as devDependencies.
  2. Implement the gallery to references/gallery-spec.md: a page at <project>/playwright/gallery/ that renders the requested story into #root. Start from the worked example in the spec and the framework notes in references/react.md / references/vue.md. Keep story discovery (import.meta.glob) and the framework mount here — this is the only framework-specific glue, so keep it small. Import the app's global CSS the same way the app's own entry does.
  3. Configure Playwright — add to playwright.config.ts:

Read the full file on GitHub · 137 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · -7 lines 60f57b31767d
  2. 1mo ago First seen · 144 lines · 69 tokens per session scan A 77bc6f8d1de5

Subscribe to this mod's changes

playwright-component-testing is a skill published in the GitHub repository microsoft/playwright (97,799 stars, last pushed today), licensed Apache-2.0. It adds 69 tokens to every session and 2,357 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

compatibility-testing

Cross-browser, cross-platform, and cross-device compatibility testing ensuring consistent experience across environments. Use when validating browser support, testing responsive design, or ensuring platform compatibility.

proffesor-for-testing/agentic-qe · 36 tokens

Browser Agent QA Testing

Teach agents to use AI browser agents for exploratory and smoke QA with step budgets, evidence-based assertions, guardrails, and Playwright conversion.

PramodDutta/qaskills · 33 tokens

proxy-setup

Set up test-proxy-recorder for any Playwright project. Covers the proxy CLI (test-proxy-recorder --port --dir), package.json scripts for the three-service architecture (UI app → proxy → backend API), playwright.config.ts webServer block pointing to /control, per-test fixtures using playwrightProxy.before(page…

asmyshlyaev177/test-proxy-recorder · 201 tokens

qawolf-cli

Manage QA Wolf through the qawolf CLI. Use when asked to create, update, or list coverage requests, bug reports, or maintenance reports; start a run of flows or tags on the QA Wolf platform or read a run's results; list, set, or delete environment variables; manage environments, flows, or tags; run or list flows…

qawolf/cli · 112 tokens

playwright-best-practices

Use when writing Playwright tests, fixing flaky tests, debugging failures, implementing Page Object Model, configuring CI/CD, optimizing performance, mocking APIs, handling authentication or OAuth, testing accessibility (axe-core), file uploads/downloads, date/time mocking, WebSockets, geolocation, permissions…

currents-dev/playwright-best-practices-skill · 214 tokens

playwright-cli

Automate browser interactions, test web pages and work with Playwright tests.

microsoft/playwright-cli · 19 tokens