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.
npx skills add PracticalSwan/agent-skills --skill playwright-component-testinggit clone --depth 1 https://github.com/PracticalSwan/agent-skillsWrote 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.
[](https://agentmods.dev/skills/practicalswan/agent-skills/playwright-component-testing)<a href="https://agentmods.dev/skills/practicalswan/agent-skills/playwright-component-testing"><img src="https://agentmods.dev/badge/skills/practicalswan/agent-skills/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.
<a href="https://agentmods.dev/skills/practicalswan/agent-skills/playwright-component-testing"><img src="https://agentmods.dev/badge/skills/practicalswan/agent-skills/playwright-component-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00069 | $0.03040 |
| Opus 5.5 | $0.00028 | $0.01216 |
| Sonnet 5.5 | $0.00014 | $0.00608 |
| Haiku 4.5 | $0.00007 | $0.00304 |
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.
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.
How it starts
The opening of the file, as written. The whole thing — 206 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. The workflow does not require the retired experimental component-testing runtime, but the built-in mount fixture comes from the project's @playwright/test package and the gallery still needs its framework and bundler dependencies.
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 exposeswindow.mount(params)/window.unmount()that render a story — resolved from your story files (e.g. withimport.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'swindow.mountand returns aLocatorfor the gallery root (#root). Scope the queries from there —component.getByRole('button').click(), notcomponent.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.
Prerequisites
Confirm the project owns the test-runner dependency before changing its package manifest:
npm ls --depth=0 @playwright/test playwright
If @playwright/test is absent, ask for approval before running
npm install --save-dev @playwright/test. Install a browser only when the
project's test setup needs it and the user approves the download:
What ships with it
12 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- CHANGELOG.md 743 B
- LICENSE.txt 11 KB
- NOTICE.txt 489 B
- references/gallery-spec.md 6.1 KB
- references/migration.md 4.9 KB
- references/react.md 3.0 KB
- references/typing.md 6.7 KB
- references/vue.md 3.3 KB
- templates/react/button.spec.ts 830 B runs code
- templates/react/Button.story.tsx 892 B
- templates/vue/button.spec.ts 830 B runs code
- templates/vue/Button.story.ts 1.1 KB runs code
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.
- 1mo ago First seen · 206 lines · 69 tokens per session scan A 1f9e6226af9f
playwright-component-testing is a skill published in the GitHub repository PracticalSwan/agent-skills (21 stars, last pushed 1mo ago), licensed MIT. It adds 69 tokens to every session and 3,040 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-09-13.
Other skills, from other repositories
playwright-cli
Automate browser interactions, test web pages and work with Playwright tests.
playwright-component-testing
Set up component testing with Playwright using a story gallery — scaffold stories and a gallery dev page driven by the built-in mount fixture, no dedicated component-testing runtime. Use when asked to test React or Vue components in isolation with Playwright, or to migrate off @playwright/experimental-ct-react / -vue.
playwright-trace
Inspect Playwright trace files from the command line — list actions, view requests, console, errors, snapshots and screenshots.
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.
e2e-testing
Use when writing or stabilizing Playwright tests that drive a real browser through multi-step journeys — durable locators, web-first assertions, storageState auth, trace/retries, and flakes that only bite in CI. NOT in-process component tests (that is testing-web), NOT WCAG auditing (that is accessibility), NOT the…
Axe-core Accessibility Testing
Accessibility testing skill using axe-core and Playwright for automated WCAG 2.1 compliance auditing, custom rules, and accessibility reporting.