Sync tests with TestRail
TestRail Integration

Sync tests with TestRail. Use when user mentions "testrail", "test management", test cases", "test run", "sync test cases", "push results to testrail", or "import from testrail".
--- name: "testrail" description: >- Sync tests with TestRail. Use when user mentions "testrail", "test management", "test cases", "test run", "sync test cases", "push results to testrail", or "import from testrail". --- # TestRail Integration Bidirectional sync between Playwright tests and TestRail test management. ## Prerequisites Environment variables must be set: - `TESTRAIL_URL` — e.g., `https://your-instance.testrail.io` - `TESTRAIL_USER` — your email - `TESTRAIL_API_KEY` — API key from TestRail
Overview
Bidirectional sync between Playwright tests and TestRail test management.
What you get
- Operation summary with counts
- Any errors or unmatched cases
- Link to TestRail run/results
Manual install (npx, ZIP)
npx skills add alirezarezvani/claude-skills --skill testrail -g -a claude-codemkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/alirezarezvani/claude-skills/tar.gz/19392f7a0826 \
| tar -xz -C ~/.claude/skills --strip-components=4 claude-skills-19392f7a0826/engineering-team/playwright-pro/skills/testrailNew-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/8dec8cedb74bb8878888/testrail.zip" -OutFile "$env:TEMP\testrail.zip"; Expand-Archive "$env:TEMP\testrail.zip" -DestinationPath "$HOME\.claude\skills" -ForceConnects with Agent Alley MCP · agentalley.io/mcp
Files included
SKILL.md3.8 KB
Read the files here
alirezarezvani/
Shared references2SKILL.md reads these from elsewhere in the repo. Not in the ZIP.
Get them on GitHub ↗Show the full text138 lines
TestRail Integration
Bidirectional sync between Playwright tests and TestRail test management.
Prerequisites
Environment variables must be set:
TESTRAIL_URL— e.g.,https://your-instance.testrail.ioTESTRAIL_USER— your emailTESTRAIL_API_KEY— API key from TestRail
If not set, inform the user how to configure them and stop.
The TestRail MCP server is not auto-registered (issue #978).
pw-testrailwas removed from the plugin's.mcp.jsonbecause it failed to connect for every user (the plugin ships nonode_modules). Thetestrail_*MCP tools used below, and the/pw:testrailcommand, will fail with "tool not found" until it is enabled manually — see the Integrations section of the plugin'sCLAUDE.md(cd integrations/testrail-mcp && npm install, then register the server in your own user/project MCP config). Setting the env vars alone is not sufficient.
Capabilities
1. Import Test Cases → Generate Playwright Tests
/pw:testrail import --project <id> --suite <id>
Steps:
- Call
testrail_get_casesMCP tool to fetch test cases - For each test case:
- Read title, preconditions, steps, expected results
- Map to a Playwright test using appropriate template
- Include TestRail case ID as test annotation:
test.info().annotations.push({ type: 'testrail', description: 'C12345' })
- Generate test files grouped by section
- Report: X cases imported, Y tests generated
2. Push Test Results → TestRail
/pw:testrail push --run <id>
Steps:
- Run Playwright tests with JSON reporter:
npx playwright test --reporter=json > test-results.json - Parse results: map each test to its TestRail case ID (from annotations)
- Call
testrail_add_resultMCP tool for each test:- Pass → status_id: 1
- Fail → status_id: 5, include error message
- Skip → status_id: 2
- Report: X results pushed, Y passed, Z failed
3. Create Test Run
/pw:testrail run --project <id> --name "Sprint 42 Regression"
Steps:
- Call
testrail_add_runMCP tool - Include all test case IDs found in Playwright test annotations
- Return run ID for result pushing
4. Sync Status
/pw:testrail status --project <id>
Steps:
- Fetch test cases from TestRail
- Scan local Playwright tests for TestRail annotations
- Report coverage:
TestRail cases: 150 Playwright tests with TestRail IDs: 120 Unlinked TestRail cases: 30 Playwright tests without TestRail IDs: 15
5. Update Test Cases in TestRail
/pw:testrail update --case <id>
Steps:
- Read the Playwright test for this case ID
- Extract steps and expected results from test code
- Call
testrail_update_caseMCP tool to update steps
MCP Tools Used
| Tool | When |
|---|---|
testrail_get_projects |
List available projects |
testrail_get_suites |
List suites in project |
testrail_get_cases |
Read test cases |
testrail_add_case |
Create new test case |
testrail_update_case |
Update existing case |
testrail_add_run |
Create test run |
testrail_add_result |
Push individual result |
testrail_get_results |
Read historical results |
Test Annotation Format
All Playwright tests linked to TestRail include:
test('should login successfully', async ({ page }) => {
test.info().annotations.push({
type: 'testrail',
description: 'C12345',
});
// ... test code
});
This annotation is the bridge between Playwright and TestRail.
Output
- Operation summary with counts
- Any errors or unmatched cases
- Link to TestRail run/results
| 1 | |
| 2 | name "testrail" |
| 3 | description >- |
| 4 | Sync tests with TestRail. Use when user mentions "testrail", "test management", |
| 5 | "test cases", "test run", "sync test cases", "push results to testrail", |
| 6 | or "import from testrail". |
| 7 | |
| 8 | |
| 9 | # TestRail Integration |
| 10 | |
| 11 | Bidirectional sync between Playwright tests and TestRail test management. |
| 12 | |
| 13 | ## Prerequisites |
| 14 | |
| 15 | Environment variables must be set: |
| 16 | `TESTRAIL_URL` — e.g., `https://your-instance.testrail.io` |
| 17 | `TESTRAIL_USER` — your email |
| 18 | `TESTRAIL_API_KEY` — API key from TestRail |
| 19 | |
| 20 | If not set, inform the user how to configure them and stop. |
| 21 | |
| 22 | > **The TestRail MCP server is not auto-registered (issue #978).** `pw-testrail` |
| 23 | > was removed from the plugin's `.mcp.json` because it failed to connect for every |
| 24 | > user (the plugin ships no `node_modules`). The `testrail_*` MCP tools used below, |
| 25 | > and the `/pw:testrail` command, will fail with "tool not found" until it is |
| 26 | > enabled manually — see the **Integrations** section of the plugin's `CLAUDE.md` |
| 27 | > (`cd integrations/testrail-mcp && npm install`, then register the server in your |
| 28 | > own user/project MCP config). Setting the env vars alone is not sufficient. |
| 29 | |
| 30 | ## Capabilities |
| 31 | |
| 32 | ### 1. Import Test Cases → Generate Playwright Tests |
| 33 | |
| 34 | |
| 35 | /pw:testrail import --project <id> --suite <id> |
| 36 | |
| 37 | |
| 38 | Steps: |
| 39 | Call `testrail_get_cases` MCP tool to fetch test cases |
| 40 | For each test case: |
| 41 | Read title, preconditions, steps, expected results |
| 42 | Map to a Playwright test using appropriate template |
| 43 | Include TestRail case ID as test annotation: `test.info().annotations.push({ type: 'testrail', description: 'C12345' })` |
| 44 | Generate test files grouped by section |
| 45 | Report: X cases imported, Y tests generated |
| 46 | |
| 47 | ### 2. Push Test Results → TestRail |
| 48 | |
| 49 | |
| 50 | /pw:testrail push --run <id> |
| 51 | |
| 52 | |
| 53 | Steps: |
| 54 | Run Playwright tests with JSON reporter: |
| 55 | |
| 56 | npx playwright test --reporter=json > test-results.json |
| 57 | |
| 58 | Parse results: map each test to its TestRail case ID (from annotations) |
| 59 | Call `testrail_add_result` MCP tool for each test: |
| 60 | Pass → status_id: 1 |
| 61 | Fail → status_id: 5, include error message |
| 62 | Skip → status_id: 2 |
| 63 | Report: X results pushed, Y passed, Z failed |
| 64 | |
| 65 | ### 3. Create Test Run |
| 66 | |
| 67 | |
| 68 | /pw:testrail run --project <id> --name "Sprint 42 Regression" |
| 69 | |
| 70 | |
| 71 | Steps: |
| 72 | Call `testrail_add_run` MCP tool |
| 73 | Include all test case IDs found in Playwright test annotations |
| 74 | Return run ID for result pushing |
| 75 | |
| 76 | ### 4. Sync Status |
| 77 | |
| 78 | |
| 79 | /pw:testrail status --project <id> |
| 80 | |
| 81 | |
| 82 | Steps: |
| 83 | Fetch test cases from TestRail |
| 84 | Scan local Playwright tests for TestRail annotations |
| 85 | Report coverage: |
| 86 | |
| 87 | TestRail cases: 150 |
| 88 | Playwright tests with TestRail IDs: 120 |
| 89 | Unlinked TestRail cases: 30 |
| 90 | Playwright tests without TestRail IDs: 15 |
| 91 | |
| 92 | |
| 93 | ### 5. Update Test Cases in TestRail |
| 94 | |
| 95 | |
| 96 | /pw:testrail update --case <id> |
| 97 | |
| 98 | |
| 99 | Steps: |
| 100 | Read the Playwright test for this case ID |
| 101 | Extract steps and expected results from test code |
| 102 | Call `testrail_update_case` MCP tool to update steps |
| 103 | |
| 104 | ## MCP Tools Used |
| 105 | |
| 106 | | Tool | When | |
| 107 | |---|---| |
| 108 | | `testrail_get_projects` | List available projects | |
| 109 | | `testrail_get_suites` | List suites in project | |
| 110 | | `testrail_get_cases` | Read test cases | |
| 111 | | `testrail_add_case` | Create new test case | |
| 112 | | `testrail_update_case` | Update existing case | |
| 113 | | `testrail_add_run` | Create test run | |
| 114 | | `testrail_add_result` | Push individual result | |
| 115 | | `testrail_get_results` | Read historical results | |
| 116 | |
| 117 | ## Test Annotation Format |
| 118 | |
| 119 | All Playwright tests linked to TestRail include: |
| 120 | |
| 121 | |
| 122 | test('should login successfully', async ({ page }) => { |
| 123 | test.info().annotations.push({ |
| 124 | type: 'testrail', |
| 125 | description: 'C12345', |
| 126 | }); |
| 127 | // ... test code |
| 128 | }); |
| 129 | |
| 130 | |
| 131 | This annotation is the bridge between Playwright and TestRail. |
| 132 | |
| 133 | ## Output |
| 134 | |
| 135 | Operation summary with counts |
| 136 | Any errors or unmatched cases |
| 137 | Link to TestRail run/results |
| 138 |
Details
- Updated
- Aug 30, 2026
- License
- MIT
- Stars on the repo
- ★ 26,349
- Checked
- Source
- alirezarezvani/claude-skills ↗
- Creator
- alirezarezvani · 363 listings
Similar skills
See all →
SkillTests in real browsers via Chrome DevTools MCPBrowser testing with devtools
MCPThis MCP server attempts to exercise all the featuresEverything MCP Server
MCPA Model Context Protocol server that provides web contentFetch MCP Server
MCPNode.js server implementing Model Context ProtocolFilesystem MCP Server
SkillAbout libraries, frameworks, API referencesContext7 MCP
SkillUses Chrome DevTools via MCP for efficient debuggingMore from alirezarezvani
SkillResume a paused experiment/ar:ar-resume — Resume Experiment
SkillShow experiment dashboard with results, active loops/ar:ar-status — Experiment Dashboard
SkillStart an autonomous experiment loop with user-selected/ar:loop — Autonomous Experiment Loop
SkillRun a single experiment iteration/ar:run — Single Experiment Iteration
SkillSet up a new autoresearch experiment interactively/ar:setup — Create New Experiment
Skill/cs:boardroom <brief/cs:boardroom — Multi-Role Boardroom Deliberation