Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

playwright-component-testing

Skill by microsoft

Sets up Playwright component testing for React and Vue using a story gallery page and the built-in mount fixture. It is aimed at developers who want to test components in isolation without a dedicated component-testing runtime.

  • Score 94
  • 101k stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install playwright-component-testing

Built from the published package, never by AI.

git clone --depth 1 https://github.com/microsoft/playwright /tmp/playwright && mkdir -p ~/.claude/skills && cp -r /tmp/playwright/packages/playwright-core/src/tools/skills/playwright-component-testing ~/.claude/skills/playwright-component-testing

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install playwright-component-testing in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill scaffolds component tests that run as regular Playwright e2e tests. Each component is wrapped in small stories, and a gallery page served by the app's dev server renders them. The gallery exposes window.mount and window.unmount, and the built-in mount fixture from @playwright/test drives it and returns a locator for the gallery root.

The skill covers setup for apps on Vite and for other bundlers, Playwright config, story and spec templates, and patterns for callbacks, prop updates, network mocking and debugging. It also includes a migration guide for teams moving off @playwright/experimental-ct-react or @playwright/experimental-ct-vue. It is intended for teams testing React or Vue components with Playwright.

Written from the project's SKILL.md and checked against it.

What it can do

  • Story gallery setupGuides building a gallery page that renders stories into #root for Playwright tests.
  • Story scaffoldingCreates story files next to components, with each named export as one story scenario.
  • Mount fixture testsWrites plain Playwright tests that use the built-in mount fixture to render stories.
  • Callback and state testingRecords component state in hidden form inputs so tests can assert on callback results.
  • Prop updatesUses component.update() to change props on a mounted story without remounting it.
  • Network mockingRegisters page.route() mocks before mounting a story, with service workers blocked.
  • Playwright configAdds a components project and a webServer entry to playwright.config.ts.
  • Framework migrationProvides a guide for moving off the experimental React and Vue component-testing packages.

What you need

  • Playwright (@playwright/test)
  • A React or Vue project
  • Vite and the framework plugin as devDependencies, for apps not using Vite

Try asking

  • Set up Playwright component testing with a story gallery for this React app
  • Write a story and a spec for the Button component using the mount fixture
  • Migrate our tests off @playwright/experimental-ct-vue to the mount fixture

Good to know

  • Stories run in the browser, so setup such as providers must live inside the story
  • Vue stories must also declare their props at runtime
  • Non-Vite projects need a standalone dev server for the gallery

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: packages/playwright-core/src/tools/skills/playwright-component-testing/SKILL.md, packages/playwright-core/src/tools/skills/playwright-component-testing/templates/react/button.spec.ts, packages/playwright-core/src/tools/skills/playwright-component-testing/templates/vue/Button.story.ts, packages/playwright-core/src/tools/skills/playwright-component-testing/templates/vue/button.spec.ts. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md10 KB
  • references/gallery-spec.md6 KB
  • references/migration.md5 KB
  • references/react.md3 KB
  • references/typing.md7 KB
Show all 10 files
  • references/vue.md3 KB
  • templates/react/Button.story.tsx892 B
  • templates/react/button.spec.ts830 B
  • templates/vue/Button.story.ts1 KB
  • templates/vue/button.spec.ts830 B

Alternatives to playwright-component-testing

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

playwright-component-testing: common questions

Does this need a dedicated component-testing runtime?

No. The skill uses regular Playwright e2e tests and the built-in mount fixture, with no extra test runner, bundler integration or npm packages required.

How do I migrate from @playwright/experimental-ct-react?

The source includes a migration reference at references/migration.md that covers moving off the experimental React and Vue component-testing packages.

Can I use it with Next.js or webpack?

Yes. For projects that are not on Vite, the skill says to run a small standalone dev server, such as Vite, that serves the gallery page.

How do I install playwright-component-testing?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is playwright-component-testing free?

The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.

Is playwright-component-testing safe to use?

It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to playwright-component-testing?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

playwright-component-testing Install

Add to stack

Loading.