一键导入
e2e-setup
Manage TestRail demo site API key. Delete stale keys (72h+), generate a new one via Playwright, verify access, and update .mcp.json.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Manage TestRail demo site API key. Delete stale keys (72h+), generate a new one via Playwright, verify access, and update .mcp.json.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | e2e-setup |
| description | Manage TestRail demo site API key. Delete stale keys (72h+), generate a new one via Playwright, verify access, and update .mcp.json. |
| allowed-tools | Bash(npm run playwright-cli:*), Bash(curl:*), Bash(npm:*), Bash(node:*), Bash(date:*), Bash(test:*) |
Ensures .mcp.json is configured with valid TestRail credentials so that mcp__testrail__* tools are available in the current Claude Code session.
Output: A valid .mcp.json file that Claude Code recognizes as MCP server config.
@playwright/cli is in devDependencies and available as npm run playwright-clinpx playwright install chromium if needed.mcp.json already workstest -f .mcp.json && cat .mcp.json
If .mcp.json exists, verify the credentials work:
TESTRAIL_URL=$(node -e "const c=JSON.parse(require('fs').readFileSync('.mcp.json','utf8'));console.log(c.mcpServers.testrail.env.TESTRAIL_URL)")
TESTRAIL_USERNAME=$(node -e "const c=JSON.parse(require('fs').readFileSync('.mcp.json','utf8'));console.log(c.mcpServers.testrail.env.TESTRAIL_USERNAME)")
TESTRAIL_API_KEY=$(node -e "const c=JSON.parse(require('fs').readFileSync('.mcp.json','utf8'));console.log(c.mcpServers.testrail.env.TESTRAIL_API_KEY)")
curl -s -w "\nHTTP_STATUS:%{http_code}" \
-u "$TESTRAIL_USERNAME:$TESTRAIL_API_KEY" \
"${TESTRAIL_URL}/index.php?/api/v2/get_projects"
Use WebFetch on this URL to extract login ID, password, and demo URL:
https://www.techmatrix.co.jp/product/testrail/demo_site.html
All playwright-cli commands are run via npm run playwright-cli --.
npm run playwright-cli -- open '<DEMO_SITE_URL>/index.php?/auth/login'
npm run playwright-cli -- snapshot
Known selectors (as of 2026-03):
input[name="name"]input[name="password"]#button_primaryUse snapshot refs to fill and click:
npm run playwright-cli -- fill <email_ref> "<LOGIN_ID>"
npm run playwright-cli -- fill <password_ref> "<PASSWORD>"
npm run playwright-cli -- click <login_button_ref>
Verify redirect to dashboard (URL contains /dashboard).
npm run playwright-cli -- goto '<DEMO_SITE_URL>/index.php?/mysettings'
npm run playwright-cli -- snapshot
Click the "API キー" tab. Important: There are two elements with text "API キー". Use the one with data-testid="apiKeysButton":
npm run playwright-cli -- click <ref_for_apiKeysButton>
npm run playwright-cli -- snapshot
mcp-e2e-* keysScan the API key table in the snapshot. For each row whose name starts with mcp-e2e-:
.dialog-action-default or "OK" button)Never delete keys that don't start with mcp-e2e-.
npm run playwright-cli -- click <add_key_link_ref>
npm run playwright-cli -- snapshot
The name input field has id="userTokenName":
npm run playwright-cli -- fill <userTokenName_ref> "mcp-e2e-YYYYMMDD-HHMMSS"
Click the "キーの生成" button:
npm run playwright-cli -- click <generate_button_ref>
npm run playwright-cli -- snapshot
The generated API key is shown only once. Read it from the snapshot immediately. It appears as a readonly input with the key value.
npm run playwright-cli -- click <dialog_add_key_button_ref>
npm run playwright-cli -- snapshot
npm run playwright-cli -- click <save_settings_button_ref>
npm run playwright-cli -- snapshot
.mcp.jsonWrite the MCP server configuration directly to .mcp.json:
{
"mcpServers": {
"testrail": {
"command": "node",
"args": ["dist/stdio.js"],
"env": {
"TESTRAIL_URL": "<DEMO_SITE_URL>",
"TESTRAIL_USERNAME": "<LOGIN_ID>",
"TESTRAIL_API_KEY": "<GENERATED_API_KEY>"
}
}
}
}
npm run playwright-cli -- close
TESTRAIL_URL=$(node -e "const c=JSON.parse(require('fs').readFileSync('.mcp.json','utf8'));console.log(c.mcpServers.testrail.env.TESTRAIL_URL)")
TESTRAIL_USERNAME=$(node -e "const c=JSON.parse(require('fs').readFileSync('.mcp.json','utf8'));console.log(c.mcpServers.testrail.env.TESTRAIL_USERNAME)")
TESTRAIL_API_KEY=$(node -e "const c=JSON.parse(require('fs').readFileSync('.mcp.json','utf8'));console.log(c.mcpServers.testrail.env.TESTRAIL_API_KEY)")
curl -s -w "\nHTTP_STATUS:%{http_code}" \
-u "$TESTRAIL_USERNAME:$TESTRAIL_API_KEY" \
"${TESTRAIL_URL}/index.php?/api/v2/get_projects"
.mcp.json.All keys use prefix mcp-e2e-YYYYMMDD-HHMMSS. Only keys matching mcp-e2e-* are managed by this skill.
| Element | Selector / Identifier |
|---|---|
| Login email | input[name="name"] |
| Login password | input[name="password"] |
| Login submit | #button_primary |
| API Keys tab | data-testid="apiKeysButton" (use this to avoid duplicate match) |
| Add key link | Text: "キーの追加" |
| Key name input | id="userTokenName" |
| Generate button | Text: "キーの生成" |
| Confirm add button | Text: "キーの追加" (in dialog) |
| Save settings button | Text: "設定の保存" |
| Delete confirm | .dialog-action-default |
If any step fails due to UI changes:
| File | Purpose | Git tracked |
|---|---|---|
.mcp.json | MCP server config for Claude Code | No (gitignored) |