/web:component-testingfrom web
Writes component tests using Vitest Browser Mode with Playwright for real-browser testing. Use when testing React components, writing browser-based tests, verifying UI behavior, testing forms, or deciding whether a component needs a test.
Ships in web. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Vitest Browser Mode with Playwright. Tests run in real Chromium — every DOM API, CSS layout, and browser behavior is authentic.
foo.browser.test.tsx next to foo.tsxdescribe named after the componenttest, not itrender() is async — always await itdescribe("SearchFilter", () => {
test("filters results on input change", async () => { ... });
test("shows empty state when no matches", async () => { ... });
});
Test when a component has:
useState or state management logicuseEffect or side effectsSkip when a component:
import { render } from "vitest-browser-react";
import { page } from "vitest/browser";
import { describe, expect, test, vi } from "vitest";
| API | Use |
|---|---|
await render(<C />) | Mount component |
page.getByRole("button", { name }) | Query by ARIA role |
page.getByText("text") | Query by text content |
page.getByLabelText("label") | Query by label |
locator.click() | Click interaction |
locator.fill("value") | Type into input |
await expect.element(locator) | Auto-retry assertion (1s) |
expect(value) | Synchronous assertion |
expect.element() vs expect()| Use | When |
|---|---|
await expect.element(locator) | Page locator queries — auto-retries until pass |
expect(value) | Mock assertions, container.querySelector(), non-DOM values |
See examples/ for complete test examples by pattern:
| Example | When to use |
|---|---|
examples/render-and-query.md | Basic rendering, role and text queries |
examples/user-interactions.md | Clicks, toggles, stateful interactions |
examples/form-testing.md | Form inputs, submission, validation |
examples/conditional-rendering.md | Show/hide content based on props or state |
examples/container-queries.md | DOM structure, data-* attributes, container.querySelector() |
examples/compound-components.md | Multi-part composed components |
.browser.test.tsx extensiondescribe named after the componenttest, not itrender() is awaitedexpect.element() for locator assertionsexamples/compound-components.md (opens in a new tab)examples/conditional-rendering.md (opens in a new tab)examples/container-queries.md (opens in a new tab)examples/form-testing.md (opens in a new tab)examples/render-and-query.md (opens in a new tab)examples/user-interactions.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kvnwolf/devtools --plugin web7 skills in this plugin
/agent-browserBrowser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction./e2e-testingWrites end-to-end tests with Playwright Test for full user flow verification. Use when adding, modifying, or removing user flows in an application. Do not use for isolated component behavior — use component-testing instead./shadcnOther plugins' skills for the same job