1.0.33 • Published 11 months ago
@perandrestromhaug/playwright-test-runner-and-debugger v1.0.33
Playwright Test Runner and Debugger MCP
A Machine Code Processing (MCP) tool for executing and debugging Playwright tests directly from within Cursor or other AI coding environments.
Overview
This MCP allows you to:
- Run Playwright tests from your codebase
- Debug failed tests with detailed trace information
- View network logs, console output, and screenshots
- Interactively debug tests with UI mode and headed browser options
Installation
npm install @perandrestromhaug/playwright-test-runner-and-debugger --save-devSetup
- Ensure you have Playwright installed in your project:
npm install @playwright/test --save-dev
npx playwright install- Configure the MCP in your
.cursor/mcp.jsonfile (or equivalent file for Claude Desktop or Claude Code):
{
"playwright-test-runner-and-debugger": {
"command": "npx",
"args": [
"-y",
"@perandrestromhaug/playwright-test-runner-and-debugger",
"--project-root",
"/path/to/your/project"
]
}
}- Make sure you have a playwright.config.ts file in your project root
- Write your tests in the directory specified in your playwright.config.ts
Tools
get-config
- Description: Returns the Playwright configuration as JSON
- Parameters: None
- Output: JSON representation of your Playwright configuration
list-tests
- Description: Lists all available Playwright tests
- Parameters: None
- Output: List of all available Playwright tests with file paths and test names
run-tests
- Description: Runs Playwright tests, optionally specifying test files or test names
- Parameters:
grep(string, optional): Only run tests matching this regular expressionheaded(boolean, optional, default: true): Run tests in headed mode with visible browserdebug(boolean, optional, default: false): Run tests in debug mode for step-by-step executionui(boolean, optional, default: false): Run tests in UI mode for interactive debuggingtimeout(number, optional, default: 10000): Specify test timeout in millisecondslastFailed(boolean, optional, default: false): Only run tests that failed in the last runfullyParallel(boolean, optional, default: true): Run tests in parallel
- Output:
- Test execution results
- List of trace directories
- Screenshots for any failed tests
get-trace
- Description: Gets the trace for a test run, including step-by-step execution info and console logs. By default returns a filtered version that removes bloated data like DOM snapshots while preserving essential debugging information.
- Parameters:
traceDirectory(string, required): The name of the trace directory (e.g., "home-homepage-has-correct-heading-chromium")raw(boolean, optional, default: false): Return raw unfiltered trace including all DOM snapshots and verbose data
- Output: Detailed trace information showing each step of test execution and console logs (filtered by default)
get-network-log
- Description: Gets browser network logs for a test run. By default returns a filtered version that removes analytics, third-party services, and verbose metadata while preserving essential debugging information.
- Parameters:
traceDirectory(string, required): The name of the trace directoryraw(boolean, optional, default: false): Return raw unfiltered network log including all analytics, third-party services, and verbose metadata
- Output: Network requests and responses (filtered by default for 80%+ size reduction, focused on localhost application traffic)
get-screenshots
- Description: Gets all available screenshots for a test run
- Parameters:
traceDirectory(string, required): The name of the trace directory - Output: All screenshots captured during test execution with their names
1.0.33
11 months ago
1.0.32
12 months ago
1.0.29
12 months ago
1.0.28
12 months ago
1.0.27
12 months ago
1.0.26
12 months ago
1.0.25
12 months ago
1.0.24
12 months ago
1.0.23
12 months ago
1.0.22
12 months ago
1.0.21
12 months ago
1.0.20
12 months ago
1.0.19
12 months ago
1.0.18
12 months ago
1.0.16
12 months ago
1.0.15
12 months ago
1.0.14
12 months ago
1.0.13
12 months ago
1.0.12
12 months ago
1.0.11
12 months ago
1.0.10
12 months ago
1.0.9
12 months ago
1.0.7
12 months ago
1.0.5
12 months ago
1.0.4
12 months ago