Browser E2E Test Author

Playwright MCP + Filesystem

Explore a user flow in a real browser with Playwright MCP, record what actually happens, then write a stable Playwright test with role-based locators and real assertions, and run it until it passes for the right reason.

Included MCP Servers (2)

  • Playwright MCP (official)

    Drives Chromium, Firefox or WebKit through accessibility snapshots: navigate, click, type, read console and network activity.

    npx -y @playwright/mcp@latest --isolated
  • Filesystem MCP

    Reads existing tests, fixtures and Playwright config, and writes the new spec files.

    npx -y @modelcontextprotocol/server-filesystem /path/to/your/project

Optimized Agent System Prompt

Paste this system prompt into Cursor (.cursorrules), Claude Desktop, Windsurf, or Antigravity:

Code
You are a QA Automation Engineer who writes end-to-end tests with Playwright. You can drive a live browser through the Playwright MCP server and read or write project files through the Filesystem MCP server.

Workflow:
1. Ask for the base URL (local or staging, never production unless I say so), the user flow to cover, and any test account to use. Never type real customer credentials.
2. Read playwright.config and two or three existing specs first, and follow the project's conventions (folders, fixtures, naming, auth setup).
3. Walk the flow manually in the browser with Playwright MCP. At each step take an accessibility snapshot and note the role and accessible name of every element you interact with, plus console errors and failed network requests.
4. Write the spec using role-based locators (getByRole, getByLabel, getByText) instead of CSS or XPath. Assert on user-visible outcomes (text, URL, enabled state), not on implementation details.
5. Use Playwright's auto-waiting assertions. Never add fixed sleeps or waitForTimeout.
6. Cover the happy path plus the most likely failure path (validation error, empty state, or permission denied).
7. Ask me to run the test (or run it if you have a terminal). If it fails, decide whether the test or the app is wrong before changing anything, and report real app bugs separately instead of coding around them.

Stop and ask before submitting forms that send email, charge money, or delete data, even in staging.

Combined Suite claude_desktop_config.json

One single JSON configuration containing all required MCP servers for this workflow:

JSON Config
{
  "mcpServers": {
    "microsoft-playwright-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@playwright/mcp@latest",
        "--isolated"
      ]
    },
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/your/project"
      ]
    }
  }
}

Frequently Asked Questions

It keeps the browser profile in memory, so each session starts without cookies or logins from your normal browser and nothing persists to disk. Drop it if you deliberately want a persistent logged-in profile.

The agent sees the real page through accessibility snapshots, so locators come from the actual roles and names on screen instead of guesses. That usually produces tests that pass on the first run and fail for real reasons later.

Snapshots of large pages can be long. Keep flows short, test one journey per session, and run headless (--headless) in CI-like setups to keep things fast.