Agent skill

Playwright Component Testing

by mellowagain in mellowagain/gitarena

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.

MITAuto-check passedTesting & QA

Install Playwright Component Testing

skills CLI
$ npx skills add mellowagain/gitarena --skill playwright-component-testing -a claude-code

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

GitHub CLI
$ gh skill install mellowagain/gitarena playwright-component-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/mellowagain/gitarena.git skills-src && mkdir -p .claude/skills && cp -r skills-src/gitarena-frontend/.claude/skills/playwright-component-testing .claude/skills/playwright-component-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-component-testing
GitHub stars
115
Used in
1 other repo
Token cost
~2.6k tokens
SKILL.md length
1,129 words
Files
6 (incl. references)
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

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.

  • Works in 6 steps: Detect the framework and bundler. React… → Implement the gallery to… → Configure Playwright — add to… → …
  • Asked to test React
  • SKILL.md covers Concept, Setup workflow, Conventions and Testing patterns, plus 2 more sections
  • Calls npx

What it does

Playwright Component Testing is an agent skill from mellowagain/gitarena. 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.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/gallery-spec.md`, `references/migration.md` and `references/react.md`).

It sits in Testing & QA, covering Browser testing. It works with Playwright, Vue.js, React and Vite. The repository describes itself as: Rust-based Software development platform (forge) with built-in vcs, issue tracking and code review. The licence is MIT.

When your agent uses it

  • Asked to test React
  • Vue components in isolation with Playwright
  • Migrate off @playwright/experimental-ct-react / -vue

Example prompts

  • “/playwright-component-testing”

Requirements

  • Node.js

Workflow steps

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

  1. Detect the framework and bundler. React vs Vue decides the framework notes and example story to follow. Then
  2. Implement the gallery to references/gallery-spec.md: a page at /playwright/gallery/ that renders the requested story into #root. Start…
  3. Configure Playwright — add to playwright.config.ts
  4. Write a first story next to an existing component, modeled on templates//Button.story.*.
  5. Write a first spec, modeled on templates/react/button.spec.ts, importing test/expect from @playwright/test.
  6. Run: npx playwright test --project=components. Open http://localhost:5173/playwright/gallery/index.html in a browser to eyeball all stories.

What it can do on your machine

Read from SKILL.md and the folder at commit a9b0bf7. 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

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

  • Network

    No URLs in SKILL.md. Its commands use npx, 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 Component Testing loads about 2.6k tokens when it runs, and up to ~9.2k if it reads all its reference files. Until then it costs about 87 tokens; SKILL.md has 1,129 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~87
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9.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 mellowagain/gitarena at commit a9b0bf7, republished under its MIT licence (© mellowagain). 1,129 words, ~2,621 tokens.

Download SKILL.mdSave it as .claude/skills/playwright-component-testing/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
playwright-component-testing
description
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.

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:

    ts
    projects: [
      {
        name: 'components',
        testDir: './tests/components',
        use: { ...devices['Desktop Chrome'], baseURL: 'http://localhost:5173/playwright/gallery/index.html', serviceWorkers: 'block', reuseContext: true },
      },
    ],
    webServer: {
      command: 'npm run dev',                                       // or: npx vite --config playwright/vite.config.ts
      url: 'http://localhost:5173/playwright/gallery/index.html',   // standalone server: http://localhost:3100/playwright/gallery/index.html
      reuseExistingServer: !process.env.CI,
    },

    Match the port to the dev server. mount navigates to baseURL, so set baseURL to the gallery's URL. serviceWorkers: 'block' keeps the app's own service worker from serving cached responses that would shadow your page.route() mocks. reuseContext: true reuses the browser context across tests in a worker (as the old component-testing runtime did) — a large speedup for component suites. If the config already has projects/webServer, merge instead of replacing.

  4. Write a first story next to an existing component, modeled on templates/<react|vue>/Button.story.*.

  5. Write a first spec, modeled on templates/react/button.spec.ts, importing test/expect from @playwright/test.

  6. Run: npx playwright test --project=components. Open http://localhost:5173/playwright/gallery/index.html in a browser to eyeball all stories.

Conventions

  • Story id: path under src/ without the .story.* extension, plus the export name — src/components/Button.story.tsx export Primary → components/Button/Primary. Any unique suffix works too: mount('Button/Primary'). A .story.vue single-file component is one story, addressable by its path alone (its default export). With gallery types (references/typing.md) ids are prefixed with the package name: acme-ui/components/Button/Primary.
  • One export per scenario. Prefer a new story export over parameterizing an existing one — stories are greppable, reviewable documentation of component states.

Testing patterns

Examples are React; the Vue equivalents differ only in story syntax.

Callbacks and events

The story owns the state and provides the callbacks. Where the component takes callbacks, create the state inside the story, wire the callbacks to it, and record the state into a hidden form next to the component. Tests perform operations and assert on the recorded values:

tsx
export const Stateful = () => {
    const [expanded, setExpanded] = useState(false);
    return (
        <>
            <Expandable expanded={expanded} setExpanded={setExpanded} title="Title">
                Details
            </Expandable>
            <form hidden>
                <input data-testid="expanded" readOnly value={String(expanded)} />
            </form>
        </>
    );
};
ts
test("click should expand", async ({ mount }) => {
    const component = await mount("components/Expandable/Stateful");
    await component.locator(".codicon-chevron-right").click();
    await expect(component.getByTestId("expanded")).toHaveValue("true");
});

This keeps the whole scenario in the browser: no callback marshalling, the story doubles as documentation, and the recorded state is visible when eyeballing the gallery. Record each observed value in its own data-testid input (String(...) or JSON.stringify(...) for payloads) and assert with toHaveValue() — a web-first assertion that retries until the state lands. The negative direction works the same way: perform the operation, then assert the value did not change.

Show full SKILL.md (396 more words)Show less
Per-test props

When a scenario is genuinely parametric (e.g. a boundary-value sweep), pass props as the second argument to mount; the gallery hands them to the story as its props. Keep props to plain serializable data — callbacks belong inside the story.

tsx
export const WithTitle = ({ title = "Default" }: { title?: string }) => <Button title={title} />;
ts
const component = await mount("components/Button/WithTitle", { title: "Hello" });

Props are type-checked in two optional ways, see references/typing.md: pass the story type as a template argument (mount<typeof WithTitle>('components/Button/WithTitle', { title: 'Hello' }), no setup), or generate gallery types with a small Vite plugin so the id itself is typed (mount('acme-ui/components/Button/WithTitle', { title: 'Hello' }), with autocomplete and rename safety). Vue stories must additionally declare the props at runtime — see the Typed props sections in references/react.md / references/vue.md.

Prop transitions with update()

To test how a component reacts to a prop change without remounting (state preserved), call component.update(newProps) — it re-renders the same story with new props on the existing root:

ts
const component = await mount("components/Counter/Default", { value: 1 });
await expect(component.getByTestId("value")).toHaveText("1");
await component.update({ value: 2 });
await expect(component.getByTestId("value")).toHaveText("2");

This requires the gallery to reuse its root/instance (references/gallery-spec.md); state survives as long as the story stays the same.

Multiple states in one test

Each mount() navigates fresh, so tests are fully isolated and mounting several stories in one test is cheap:

ts
await expect(await mount("Button/Primary")).toHaveScreenshot("primary.png");
await expect(await mount("Button/Disabled")).toHaveScreenshot("disabled.png");

For visual comparison, screenshot the returned root locator (as above), not the page, to avoid asserting on browser chrome.

Network mocking

Use page.route() as usual — register routes before mount(), since mounting navigates. serviceWorkers: 'block' (set in the config above) keeps the app's own service worker from serving cached responses that shadow the routes. Teams with MSW handler libraries can start the worker inside a story or decorator instead.

Debugging stories

Open your gallery URL (baseURL) in a browser and call await window.mount({ story: 'components/Button/Primary' }) from the devtools console — that is exactly what the mount fixture does. An unknown story rejects window.mount, which surfaces as the test's mount() throwing with a real stack. To browse without the console, give your gallery an optional index page.

Decision points

  • Monorepos / non-src layouts: change the glob and the id derivation in your gallery (references/gallery-spec.md) to match, and prefix ids with the package name (references/typing.md).
  • Global providers (theme, i18n, store, router): create a shared decorator helper next to the gallery and wrap components in stories; see references/react.md / references/vue.md.

References

  • references/gallery-spec.md — the gallery endpoint contract to implement (start here).
  • references/typing.md — optional typing for mount: explicit story types vs generated gallery types, with the Vite plugin.
  • references/react.md — React walkthrough: providers, StrictMode, CSS.
  • references/vue.md — Vue walkthrough: .story.ts and .story.vue stories, plugins.
  • references/migration.md — migrating off @playwright/experimental-ct-react / -vue.

© mellowagain, 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 5 other files (references) in gitarena-frontend/.claude/skills/playwright-component-testing of mellowagain/gitarena.

  • SKILL.md
  • references/gallery-spec.md
  • references/migration.md
  • references/react.md
  • references/typing.md
  • references/vue.md

Open the folder on GitHubat commit a9b0bf7

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in mellowagain/gitarena, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Playwright Component 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 Component Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Playwright Component Testing this skillmellowagain/gitarena1151 repos~2.6kAutomated safety check: PassMIT
Handsontable Visual Test Demoshandsontable/handsontable22k—~1.3kAutomated safety check: PassCustom licence
Awt E2E Testingsickn33/agentic-awesome-skills47k2 repos~556Automated safety check: PassMIT
Liteyuki Webui FrontendLiteyukiStudio/LiteyukiBot157—~2.5kAutomated safety check: PassCustom licence
Desktopgridaco/grida2.7k—~3.2kAutomated safety check: NotesApache-2.0
Playwright Coretestdino-hq/playwright-skill3861 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Handsontable Visual Test Demos

    handsontable/handsontable

    Explains how to add or change the demo pages that Handsontable's visual regression suite photographs, including per-feature routes in the js demo and the shared grid.

    22k GitHub stars~1.3k tokensUpdated today
    Testing & QAAuto-check passed
  • Awt E2E Testing

    sickn33/agentic-awesome-skills

    AI-powered E2E web testing — eyes and hands for AI coding tools.

    47k GitHub starsUsed in 2 repos~556 tokens
    Testing & QAAuto-check passed
  • Liteyuki Webui Frontend

    LiteyukiStudio/LiteyukiBot

    Build, review, or test LiteyukiBot v7's React/Vite WebUI under webui/ and its packaged static delivery in packages/webui/.

    157 GitHub stars~2.5k tokensUpdated 1 mo ago
    Frontend & DesignAuto-check passed
  • Desktop

    gridaco/grida

    Grida Desktop Electron shell and release-impact work: BrowserWindow, preload, window.grida, menus, protocol/deep links, file associations, Forge, path-scoped bridge security, Electron-only UI bugs…

    2.7k GitHub stars~3.2k tokensUpdated today
    Testing & QAAuto-check: notes
  • Playwright Core

    testdino-hq/playwright-skill

    Battle-tested Playwright patterns for writing and debugging reliable E2E, API, component, visual, accessibility, and security tests.

    386 GitHub starsUsed in 1 repo~1.4k tokens
    Testing & QAAuto-check passed
  • Repro

    vaadin/web-components

    Reproduce a Vaadin web component bug from a GitHub issue in vaadin/web-components.

    582 GitHub stars~1.3k tokensUpdated today
    Testing & QAAuto-check passed

More from mellowagain/gitarena

  • Playwright Trace

    mellowagain/gitarena

    Inspect Playwright trace files from the command line — list actions, view requests, console, errors, snapshots and screenshots.

    115 GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • Design Guidelines

    mellowagain/gitarena

    Applies GitArena's official design system, colors, and typography to frontend components and pages.

    115 GitHub stars~2.5k tokensUpdated today
    Auto-check passed

Categories

Questions about Playwright Component Testing

What does Playwright Component Testing do?

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. Playwright Component Testing is an agent skill from mellowagain/gitarena. 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.

When should I use Playwright Component Testing?

Playwright Component Testing fits situations like: asked to test React; vue components in isolation with Playwright; migrate off @playwright/experimental-ct-react / -vue.

How do I install Playwright Component Testing in Claude Code?

Run `npx skills add mellowagain/gitarena --skill playwright-component-testing -a claude-code`. Or copy the skill folder (gitarena-frontend/.claude/skills/playwright-component-testing in mellowagain/gitarena) into .claude/skills/playwright-component-testing in your project. Claude Code loads it when a task matches its description.

How do I install Playwright Component Testing in Codex?

Run `npx skills add mellowagain/gitarena --skill playwright-component-testing -a codex`. Or copy the skill folder (gitarena-frontend/.claude/skills/playwright-component-testing in mellowagain/gitarena) into .agents/skills/playwright-component-testing in your project. Codex loads it when a task matches its description.

Can I use Playwright Component 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 mellowagain/gitarena --skill playwright-component-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-component-testing, .gemini/skills/playwright-component-testing, .github/skills/playwright-component-testing and .opencode/skills/playwright-component-testing in your project.

What does Playwright Component Testing need to run?

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

Does Playwright Component Testing access the network?

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

Is Playwright Component 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 Component Testing use?

Playwright Component 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 Component Testing use?

About 2.6k tokens (SKILL.md is roughly 10k 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 6.6k tokens, read only when the agent opens those files.

What are the alternatives to Playwright Component Testing?

Skills that share tags, products or a category with Playwright Component Testing: Handsontable Visual Test Demos (handsontable/handsontable, 22k stars), Awt E2E Testing (sickn33/agentic-awesome-skills, 47k stars), Liteyuki Webui Frontend (LiteyukiStudio/LiteyukiBot, 157 stars) and Desktop (gridaco/grida, 2.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Playwright Component Testing?

mellowagain (a GitHub user) maintains it in mellowagain/gitarena, which has 115 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 7, 2026.

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