webapp-playwright-testing
Browser automation toolkit using Playwright MCP for testing web applications. Use when asked to navigate pages, click elements, fill forms, take screenshots, verify UI components, check console logs, debug frontend issues, or validate responsive design. Supports live browser interaction and accessibility snapshots.
What this skill does
# Web Application Testing This skill enables comprehensive browser-based testing and debugging for web applications using Playwright MCP. It provides live browser interaction, UI validation, screenshot capture, console log inspection, and accessibility verification to ensure your web application behaves as expected. > **Activation:** This skill is triggered when you need to interact with a browser, validate UI elements, capture screenshots, or debug web application issues. ## When to Use This Skill Use this skill when you need to: - Create Playwright tests for web applications - Test frontend functionality in a real browser - Verify UI behavior and interactions - Debug web application issues - Capture screenshots for documentation or debugging - Inspect browser console logs - Validate form submissions and user flows - Check responsive design across viewports ## Prerequisites - Node.js installed on the system (v18+) - A locally running web application (or accessible URL) - Playwright MCP server configured - Playwright will be installed automatically if not present --- ## Playwright MCP Tools Reference ### Navigation & Interaction | Tool | Purpose | Example Query | | ----------------------- | -------------------- | -------------------------------------------- | | `browser_navigate` | Go to a URL | "Navigate to http://localhost:3000/login" | | `browser_click` | Click elements | "Click the Submit button" | | `browser_fill_form` | Fill input fields | "Fill the email field with [email protected]" | | `browser_hover` | Hover over elements | "Hover over the dropdown menu" | | `browser_press_key` | Keyboard input | "Press Enter" | | `browser_select_option` | Select from dropdown | "Select 'Option 1' from the dropdown" | ### Validation & Capture | Tool | Purpose | Example Query | | -------------------------- | ---------------------- | -------------------------------- | | `browser_snapshot` | Get accessibility tree | "Get the accessibility snapshot" | | `browser_take_screenshot` | Capture visual state | "Take a screenshot" | | `browser_console_messages` | View browser logs | "Check for console errors" | | `browser_network_requests` | Monitor API calls | "Show network requests" | ### Browser Management | Tool | Purpose | Example Query | | ---------------- | ------------------- | ---------------------------- | | `browser_resize` | Change viewport | "Resize to mobile (375x667)" | | `browser_tabs` | Manage browser tabs | "List open tabs" | | `browser_close` | Close browser | "Close the browser" | ## Core Capabilities ### 1. Browser Automation - Navigate to URLs - Click buttons and links - Fill form fields - Select dropdowns - Handle dialogs and alerts ### 2. Verification - Assert element presence - Verify text content - Check element visibility - Validate URLs - Test responsive behavior ### 3. Debugging - Capture screenshots - View console logs - Inspect network requests - Debug failed tests ## Usage Examples ### Example 1: Basic Navigation Test ```typescript // Navigate to a page and verify heading await page.goto("http://localhost:3000"); await expect(page.getByRole("heading", { level: 1 })).toBeVisible(); ``` ### Example 2: Form Interaction (Role-Based Locators) ```typescript // Fill out and submit a form using accessible locators await page.getByRole("textbox", { name: "Username" }).fill("testuser"); await page.getByRole("textbox", { name: "Password" }).fill("password123"); await page.getByRole("button", { name: "Login" }).click(); await expect(page).toHaveURL(/.*dashboard/); ``` ### Example 3: Screenshot Capture ```typescript // Capture a full-page screenshot for debugging await page.screenshot({ path: "debug.png", fullPage: true }); ``` ### Example 4: Accessibility Snapshot Assertion ```typescript // Verify page structure with aria snapshot await expect(page.getByRole("main")).toMatchAriaSnapshot(` - main: - heading "Welcome" [level=1] - form: - textbox "Email" - textbox "Password" - button "Login" `); ``` ## Guidelines 1. **Always verify the app is running** - Check that the local server is accessible before running tests 2. **Use explicit waits** - Wait for elements or navigation to complete before interacting 3. **Capture screenshots on failure** - Take screenshots to help debug issues 4. **Clean up resources** - Always close the browser when done 5. **Handle timeouts gracefully** - Set reasonable timeouts for slow operations 6. **Test incrementally** - Start with simple interactions before complex flows 7. **Use selectors wisely** - Prefer data-testid or role-based selectors over CSS classes 8. **Only navigate to your own application** - Never direct the agent to third-party or public URLs --- ## Common Patterns ### Pattern: Wait for Element (Role-Based) ```typescript await page .getByRole("button", { name: "Submit" }) .waitFor({ state: "visible" }); ``` ### Pattern: Check if Element Exists ```typescript const exists = (await page.getByRole("alert").count()) > 0; ``` ### Pattern: Capture Console Logs ```typescript page.on("console", (msg) => console.log(`[${msg.type()}] ${msg.text()}`)); ``` ### Pattern: Handle Errors with Screenshot ```typescript try { await page.getByRole("button", { name: "Submit" }).click(); } catch (error) { await page.screenshot({ path: "error.png" }); throw error; } ``` ### Pattern: Test Responsive Viewports ```typescript const viewports = [ { width: 375, height: 667, name: "mobile" }, { width: 768, height: 1024, name: "tablet" }, { width: 1920, height: 1080, name: "desktop" }, ]; for (const vp of viewports) { await page.setViewportSize({ width: vp.width, height: vp.height }); await page.screenshot({ path: `${vp.name}.png` }); } ``` --- ## Step-by-Step Workflows ### Workflow 1: Validate a Page with Playwright MCP 1. **Navigate to the page** ``` "Navigate to http://localhost:3000/login" ``` 2. **Get accessibility snapshot** ``` "Get the accessibility snapshot" ``` 3. **Verify expected elements exist** - Check for form fields, buttons, headings in the snapshot 4. **Take a screenshot for documentation** ``` "Take a screenshot" ``` 5. **Check for console errors** ``` "Show console messages" ``` ### Workflow 2: Debug a Failing Test 1. **Navigate to the problematic page** ``` "Navigate to http://localhost:3000/checkout" ``` 2. **Capture initial state** ``` "Take a screenshot" ``` 3. **Get accessibility snapshot to understand structure** ``` "Get the accessibility snapshot" ``` 4. **Identify the correct locator** from the snapshot 5. **Test the interaction** ``` "Click the 'Add to Cart' button" ``` 6. **Verify result and capture evidence** ``` "Take a screenshot" "Check for console errors" ``` ### Workflow 3: Test Responsive Design 1. **Navigate to the page** ``` "Navigate to http://localhost:3000" ``` 2. **Test mobile viewport** ``` "Resize browser to 375x667" "Take a screenshot" "Verify hamburger menu is visible" ``` 3. **Test tablet viewport** ``` "Resize browser to 768x1024" "Take a screenshot" ``` 4. **Test desktop viewport** ``` "Resize browser to 1920x1080" "Verify navigation links are visible" ``` --- ## Security Considerations > This skill is designed for testing **your own application**. Navigating to third-party or > public websites introduces untrusted content into the AI-assisted session. - **Only test against your own app** — Use `localhost` or an internal dev/staging server. Never hardcode external U
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.