Skip to main content

Playwright MCP

Path: .cursor/skills/playwright-mcp/SKILL.md

Category: Browser and Automation

Triggers: testing the Fastlane Portal, verifying UI changes, form filling, carrier portal automation, taking screenshots, browser debugging

What It Does

Teaches the agent to use the Playwright MCP server (user-playwright-mcp) for browser interactions. Covers session reuse, snapshot-before-interact patterns, local dev URLs, and tool usage for both the Fastlane Portal and Progressive carrier portal.

This is distinct from the Playwright sub-agent (which writes E2E test code) — this skill is about using Playwright as a browser automation tool during development.

Key Patterns

Snapshot Before Interact

Always take a snapshot before any interaction to get fresh element refs. Refs go stale after navigation or DOM changes.

browser_snapshot → get element refs → browser_click / browser_type / browser_select_option

Tool Usage

ToolPurpose
browser_navigateInitial page load
browser_snapshotCapture current page state and element refs
browser_clickClick an element by ref
browser_typeType into a text input
browser_select_optionSelect from a dropdown
browser_run_codeExecute arbitrary JavaScript for complex multi-step inspections

Local Dev URLs

AppURL
Fastlane Portalhttp://localhost:4200
DA (Digital Agency)http://localhost:3000
API Gatewayhttp://localhost:3333

MCP Server

All browser operations use CallMcpTool with server: "user-playwright-mcp". Do not confuse with cursor-ide-browser, which is Cursor's built-in browser MCP — a separate instance.