/playwright-plugin:dynamic-mockerfrom playwright-plugin
Use this skill whenever the user needs frontend testing without a ready backend, intent-based API stubbing, dynamic test data generation, request interception, or reproducible network scenarios with Playwright. This skill designs and implements route-level mocking using page.route and route.fulfill patterns and validates mocked behavior with Playwright tests. Trigger this skill for any request to intercept APIs, fake responses, force error states, or make flaky network behavior deterministic.
Ships in playwright-plugin. 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.
Purpose: enable realistic frontend test scenarios when APIs are unavailable, unstable, or intentionally simulated.
Evidence basis:
docs/mocking).This skill supports two modes with different setup requirements:
For test-code mocking:
npm install -D @playwright/test@latest
playwright-cli open <url> --browser=chrome).--browser=chromium).Use this mode when the goal is to simulate backend behavior and validate UI reactions without writing Playwright test files.
Required sequence:
playwright-cli open <url> --browser=chrome), with Chromium fallback only if needed.route, run-code, conditional fulfill, or abort by intent).docs/mocking including simulated data and embedded screenshots.docs/mocking.exploratory-mocking-<flow-or-scope>-<timestamp>.md.docs/mocking/screenshots/<flow-id>/<step-or-state>.png.If playwright-cli is already available, use it directly for on-the-fly mocking:
playwright-cli route "api.example.com/**" --body='{"mock":true}'
playwright-cli route "**/*.jpg" --status=404
playwright-cli route-list
playwright-cli unroute "**/*.jpg"
playwright-cli unroute
If playwright-cli is not available, use npx (no local project installation needed):
npx -y playwright-cli route "api.example.com/**" --body='{"mock":true}'
npx -y playwright-cli route "**/*.jpg" --status=404
npx -y playwright-cli route-list
npx -y playwright-cli unroute "**/*.jpg"
npx -y playwright-cli unroute
Use this path for quick discovery and debugging without adding test dependencies to the project.
When used for exploratory mocking, always finish by generating the evidence artifact in docs/mocking.
import { test, expect } from '@playwright/test';
test('renders paginated list with mocked backend', async ({ page }) => {
await page.route('**/api/patients*', async route => {
const payload = {
page: 1,
pageSize: 20,
total: 120,
items: Array.from({ length: 20 }, (_, i) => ({
id: `P-${i + 1}`,
name: `Patient ${i + 1}`,
})),
};
await route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify(payload),
});
});
await page.goto('/patients');
await expect(page.getByRole('heading', { name: 'Patients' })).toBeVisible();
await expect(page.getByRole('row')).toHaveCount(21);
});
Implement one or more of these intents per endpoint:
tests/data/*.json or typed fixture modules), not inline inside spec bodies.tests/types/*.ts) and import them across fixtures and specs.Provide:
docs/mocking with simulated flow summary, simulated data table, and embedded screenshots.npx playwright test
| Task | Reference |
|---|---|
| Advanced route interception patterns | references/request-mocking.md |
| Role-first locator strategy and anti-patterns | references/locators.md |
| Web-first assertions and waits | references/assertions-waiting.md |
| Exploratory mocking evidence template | references/mocking-evidence.md |
| CI config, tags, and suite structure | references/test-suite-structure.md |
| Session-scoped mocking with named browsers | references/session-management.md |
| Page Object Model for reusable flows | references/page-object-model.md |
| Trace captures for flaky or failing mocks | references/tracing.md |
| Plan -> generate -> heal workflow for robust tests | references/test-generation.md |
| Reusable test data and shared type organization | references/test-data-and-types.md |
references/assertions-waiting.md (opens in a new tab)references/locators.md (opens in a new tab)references/mocking-evidence.md (opens in a new tab)references/page-object-model.md (opens in a new tab)references/request-mocking.md (opens in a new tab)references/session-management.md (opens in a new tab)references/test-data-and-types.md (opens in a new tab)references/test-generation.md (opens in a new tab)references/test-suite-structure.md (opens in a new tab)references/tracing.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (charlyautomatiza/playwright-plugin) — no native marketplace selected
npx claudepluginhub p/charlyautomatiza-playwright-plugin5 skills in this plugin
/a11y-sentinelUse this skill whenever the user asks for accessibility testing, a11y audits in pull requests, semantic locator hardening, or prevention of usability regressions in frontend flows. This skill implements Playwright-based accessibility checks and integrates automated axe-core audits into repeatable tests. Trigger it for any request mentioning WCAG concerns, keyboard navigation, aria issues, or CI accessibility gates./exploratory-testgenUse this skill whenever the user asks for exploratory functional testing, browser-based discovery, UI flow validation, fast health checks before automation, or a test plan proposal for a frontend. This skill performs non-invasive discovery, proposes a plan for approval, executes approved exploratory flows with Playwright (Chrome preferred, Chromium fallback), captures flow evidence screenshots, and writes a final report in docs/testing. Trigger it for rapid product health checks before formal automation./test-suite-builderUse this skill whenever the user asks for comprehensive frontend test authoring that combines web UI, API, accessibility, and visual coverage in one coherent Playwright strategy. This skill plans, writes, and heals layered tests using proven Playwright practices for locators, assertions, mocking, POM, CI config, tagging, and test isolation. Trigger it for end-to-end test architecture decisions, layered suite design, and recovery of flaky suites.