playwright-mcp-ui-testing
Enables agentic UI testing and assertions without manually coding test scripts.
Install
mkdir -p .claude/skills/playwright-mcp-ui-testing && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15141" && unzip -o skill.zip -d .claude/skills/playwright-mcp-ui-testing && rm skill.zipInstalls to .claude/skills/playwright-mcp-ui-testing
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
AI-driven browser UI testing using the Playwright MCP server. Guides the sqa-engineer to perform autonomous browser interactions, assertions, and evidence capture through the Playwright MCP tools. Use ONLY when the change involves UI or frontend components.Key capabilities
- →Design UI test cases based on user flows
- →Execute test cases using Playwright MCP tools
- →Navigate to URLs and interact with UI elements
- →Capture accessibility tree snapshots for assertions
- →Take screenshots as evidence
- →Produce structured test reports
How it works
The skill guides the SQA engineer to design test cases and then execute them using Playwright MCP tools, following a Snapshot-Act-Snapshot pattern for interactions and capturing evidence.
Inputs & outputs
When to use playwright-mcp-ui-testing
- →Verify UI component behavior
- →Run smoke tests on frontend changes
- →Validate user flow interaction
About this skill
playwright-mcp-ui-testing
This skill guides the sqa-engineer agent to perform AI-driven UI tests using the Playwright MCP server (@playwright/mcp). The agent uses MCP browser tools to navigate, interact, observe, and assert UI behavior autonomously — without writing coded test files. This skill is ONLY invoked when the software change involves UI or frontend components.
Prerequisites
Before invoking this skill:
- Confirm the change is UI/frontend-related. If not, skip this skill entirely.
- The Playwright MCP server is already available via the docker MCP gateway (configured in
.mcp.json). No additional setup is required — all browser tools are available with themcp__docker-mcp-gateway__prefix. - Ensure the application is running (start via
dotnet runor via the Aspire AppHost insamples/AppHost). - Discover the service URL (check Aspire dashboard at
http://localhost:15888or use the configuredlaunchUrl).
Phase 0 — Context Load (silent)
- Read
CLAUDE.mdto understand the component under test. - Read the spec file at
docs/specs/<feature-slug>.spec.mdif it exists. - Load persistent memory:
Skill("manage-memory", args: "sqa-engineer"). - Identify which UI routes/components were changed by the software-engineer.
Phase 1 — Test Case Design
Design UI test cases based on user flows and acceptance criteria before interacting with the browser. For each test case specify:
- Scenario name (maps to an AC ID if available, e.g.,
[AC-2] Submit form with valid data) - Starting URL
- Steps (navigation, interactions, form inputs)
- Expected outcome (element visible, text present, URL changed, etc.)
- Evidence (screenshot filename)
Phase 2 — AI-Driven Browser Execution
Execute each test case using the Playwright MCP tools. Follow the SAA pattern (Snapshot → Act → Snapshot) for every interaction:
Core Tool Reference
All browser tools are invoked via the docker MCP gateway. Use the exact tool names below:
| Tool | Purpose |
|---|---|
mcp__docker-mcp-gateway__browser_navigate | Navigate to a URL |
mcp__docker-mcp-gateway__browser_snapshot | Capture accessibility tree — use this for all assertions |
mcp__docker-mcp-gateway__browser_take_screenshot | Capture screenshot as evidence |
mcp__docker-mcp-gateway__browser_click | Click an element by ARIA ref |
mcp__docker-mcp-gateway__browser_type | Type into a focused element |
mcp__docker-mcp-gateway__browser_fill_form | Fill a form field |
mcp__docker-mcp-gateway__browser_press_key | Press keyboard key (Enter, Tab, Escape, etc.) |
mcp__docker-mcp-gateway__browser_select_option | Select a dropdown option |
mcp__docker-mcp-gateway__browser_wait_for | Wait for element/condition |
mcp__docker-mcp-gateway__browser_console_messages | Retrieve browser console log |
mcp__docker-mcp-gateway__browser_network_requests | List intercepted network requests |
mcp__docker-mcp-gateway__browser_hover | Hover over an element |
mcp__docker-mcp-gateway__browser_drag / mcp__docker-mcp-gateway__browser_drop | Drag and drop |
mcp__docker-mcp-gateway__browser_handle_dialog | Handle JS alert/confirm/prompt dialogs |
mcp__docker-mcp-gateway__browser_eval | Execute JavaScript (escape hatch — requires justification) |
mcp__docker-mcp-gateway__browser_tabs | List open browser tabs |
mcp__docker-mcp-gateway__browser_resize | Resize the browser window |
mcp__docker-mcp-gateway__browser_navigate_back | Navigate back |
mcp__docker-mcp-gateway__browser_network_request | Inspect a specific network request |
SAA Pattern (Mandatory for every interaction)
Step 1: mcp__docker-mcp-gateway__browser_snapshot → read current state, identify ARIA refs
Step 2: mcp__docker-mcp-gateway__browser_click / browser_type / browser_fill_form → perform the interaction
Step 3: mcp__docker-mcp-gateway__browser_snapshot → verify state changed as expected
Never skip the post-action snapshot — it is the assertion.
Evidence Capture
After each test case (pass or fail), capture a screenshot:
Tool: mcp__docker-mcp-gateway__browser_take_screenshot
Also capture console errors:
Tool: mcp__docker-mcp-gateway__browser_console_messages
Treat any [error] level entries as implicit test failures.
Phase 3 — Test Report
Produce a structured test report:
## AI-Driven UI Test Report
### Application: <app name and URL>
### Date: <ISO date>
| Scenario | AC ID | Steps | Result | Evidence |
|----------|-------|-------|--------|----------|
| Submit valid form | AC-2 | 3 | ✅ PASS | screenshots/submit-valid-pass.png |
| Submit empty form | AC-3 | 2 | ❌ FAIL | screenshots/submit-empty-fail.png |
### Console Errors Found
- [None] / [list any errors]
### Network Errors Found
- [None] / [list any 4xx/5xx responses]
### Summary: N passed, M failed
Rules and Constraints
- Snapshot mode is preferred over vision mode — cheaper, faster, no vision model required.
- Never use
mcp__docker-mcp-gateway__browser_evalas a shortcut to set state directly. Use actual UI flows. Document any unavoidable use in the test report. - Flaky timing: always use
browser_wait_forafter navigation/form submission — never assume instant rendering. - ARIA anchoring: if UI elements lack proper ARIA labels/roles, surface it as a bug to the software-engineer and request semantic markup fixes before retesting.
- Screenshots are mandatory evidence — never submit a test report without screenshot files.
- This skill produces a report, not test code. The
write-testsskill produces.cstest files. This skill produces browser interaction results and a markdown report.
Escape Hatches (Require Justification in Report)
mcp__docker-mcp-gateway__browser_eval/mcp__docker-mcp-gateway__browser_run_code_unsafe: only when no combination of interaction tools can achieve the required state.- If visual/CSS rendering testing is needed, capture multiple screenshots with
mcp__docker-mcp-gateway__browser_take_screenshotat different viewports usingmcp__docker-mcp-gateway__browser_resize.
When not to use it
- →The change does not involve UI or frontend components
Prerequisites
Limitations
- →The skill is only invoked when the change involves UI or frontend components
- →It prefers snapshot mode over vision mode
- →It does not produce test code, only a report
How it compares
This skill enables AI-driven UI testing without writing coded test files, using autonomous browser interactions and assertions, which differs from traditional manual or script-based UI testing.
Compared to similar skills
playwright-mcp-ui-testing side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| playwright-mcp-ui-testing (this skill) | 0 | 3mo | No flags | Intermediate |
| webapp-testing | 353 | 3mo | Review | Intermediate |
| ui-ux-expert-skill | 91 | 9mo | Review | Advanced |
| accessibility | 42 | 5mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by rafsanulhasan
View all by rafsanulhasan →You might also like
webapp-testing
anthropics
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
ui-ux-expert-skill
fercracix33
Technical workflow for implementing accessible React user interfaces with shadcn/ui, Tailwind CSS, and TanStack Query. Includes 6-phase process with mandatory Style Guide compliance, Context7 best practices consultation, Chrome DevTools validation, and WCAG 2.1 AA accessibility standards. Use after Test Agent, Implementer, and Supabase agents complete their work.
accessibility
tech-leads-club
Audit and improve web accessibility following WCAG 2.1 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible".
playwright-browser-automation
lackeyjb
Complete browser automation with Playwright. Auto-detects dev servers, writes clean test scripts to /tmp. Test pages, fill forms, take screenshots, check responsive design, validate UX, test login flows, check links, automate any browser task. Use when user wants to test websites, automate browser interactions, validate web functionality, or perform any browser-based testing.
svelte-expert
Raudbjorn
Expert Svelte/SvelteKit development assistant for building components, utilities, and applications. Use when creating Svelte components, SvelteKit applications, implementing reactive patterns, handling state management, working with stores, transitions, animations, or any Svelte/SvelteKit development task. Includes comprehensive documentation access, code validation with svelte-autofixer, and playground link generation.
browser-daemon
noiv
Persistent browser automation via Playwright daemon. Keep a browser window open and send it commands (navigate, execute JS, inspect console). Perfect for interactive debugging, development, and testing web applications. Use when you need to interact with a browser repeatedly without opening/closing it.