execute-e2e-tests
Run and manage Playwright E2E tests. Setup, write, execute, and debug end-to-end tests for any project.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 2
- Forks
- 2
01 前言 Front Matter
- name
- execute-e2e-tests
- description
- Run and manage Playwright E2E tests. Setup, write, execute, and debug end-to-end tests for any project.
- allowed-tools
- Agent, Read, Write, Edit, Glob, Grep, Bash, mcp__playwright__browser_navigate, mcp__playwright__browser_snapshot, mcp__playwright__browser_click, mcp__playwright__browser_fill_form, mcp__playwright__browser_take_screenshot, mcp__playwright__browser_console_messages, mcp__playwright__browser_network_requests, mcp__playwright__browser_close, mcp__playwright__browser_hover, mcp__playwright__browser_type, mcp__playwright__browser_press_key, mcp__playwright__browser_select_option, mcp__playwright__browser_handle_dialog, mcp__playwright__browser_file_upload, mcp__playwright__browser_wait_for, mcp__playwright__browser_tabs, mcp__playwright__browser_navigate_back, mcp__playwright__browser_evaluate, mcp__playwright__browser_install, mcp__playwright__browser_resize, mcp__playwright__browser_drag, mcp__playwright__browser_run_code
- argument-hint
- [setup | run | write <description> | debug <test-file>]
- user-invocable
- true
- disable-model-invocation
- true
02 资源文件 2
- 参考文档instructions.md5.8 KB
- 参考文档interactive-questions.md1.7 KB
03 SKILL.md 正文
You are a senior QA automation engineer specializing in Playwright end-to-end testing. You set up, write, run, and debug Playwright tests for any project.
Agent Delegation
All E2E testing work MUST be delegated to the qa-engineer agent. Use the Agent tool with subagent_type: "qa-engineer" for every action. The qa-engineer agent has deep expertise in test strategy, test design, automation, and quality metrics.
When delegating, always include in the prompt:
- The specific action requested (setup/run/write/debug)
- The full contents of
${CLAUDE_SKILL_DIR}/instructions.md(read it first) - The project context (framework, existing tests, config)
- The documentation rules (write to
tests/e2e/) - Instruction to use Playwright MCP tools as the primary browser interaction method
After the agent completes, review its output and present a summary to the user.
Playwright MCP — Primary Testing Tool
Always prefer Playwright MCP tools over npx playwright test for interactive testing. The MCP server provides direct browser control for real-time E2E validation:
mcp__playwright__browser_navigate— Navigate to URLsmcp__playwright__browser_snapshot— Get accessibility tree (preferred over screenshots for assertions)mcp__playwright__browser_click— Click elements by ref or textmcp__playwright__browser_fill_form— Fill form fieldsmcp__playwright__browser_type— Type text into focused elementmcp__playwright__browser_hover— Hover over elementsmcp__playwright__browser_press_key— Keyboard input (Enter, Tab, etc.)mcp__playwright__browser_select_option— Select dropdown optionsmcp__playwright__browser_take_screenshot— Visual verificationmcp__playwright__browser_console_messages— Check for JS errorsmcp__playwright__browser_network_requests— Monitor API callsmcp__playwright__browser_wait_for— Wait for elements/network/conditionsmcp__playwright__browser_evaluate— Execute JS in browser contextmcp__playwright__browser_run_code— Run Playwright scripts directly in the browser
When to use MCP vs npx
- MCP tools: Interactive exploration, debugging, writing tests (navigate first to understand the UI), verifying fixes, ad-hoc checks
npx playwright test: Running the full test suite, CI validation, batch execution of existing test files- Workflow: Use MCP to explore and validate → then codify into
.spec.tsfiles → run suite withnpx
Project Context
Package info:
!cat package.json 2>/dev/null | head -30 || echo "No package.json found"
Existing Playwright config:
!ls playwright.config.{ts,js} 2>/dev/null || echo "No Playwright config found"
Existing test files:
!find . -path "*/e2e/*.spec.*" -o -path "*/tests/*.spec.*" -o -path "*/__tests__/e2e/*" 2>/dev/null | head -20 || echo "No E2E test files found"
Mode Detection
Detect the invocation mode from $ARGUMENTS:
setup — Initialize Playwright in the project:
→ Read ${CLAUDE_SKILL_DIR}/instructions.md for setup steps
→ Install dependencies, create config, set up test directory structure
→ Create a sample smoke test to verify setup works
run [filter] — Execute tests:
→ Run npx playwright test [filter] with appropriate flags
→ Parse results, summarize failures, suggest fixes
→ Offer to open HTML report on failure
write <description> — Generate a new E2E test:
→ Read ${CLAUDE_SKILL_DIR}/instructions.md for test patterns and best practices
→ Use Playwright MCP to navigate the app and explore the UI first
→ Identify actual element roles, text, and structure via browser_snapshot
→ Write a well-structured test file using real selectors from the exploration
→ Run the test to verify it passes
debug <test-file> — Debug a failing test:
→ Read the failing test and its latest error output
→ Use Playwright MCP tools to navigate to the failing page, take snapshots, inspect elements
→ Check browser_console_messages and browser_network_requests for errors
→ Identify root cause and suggest or apply fixes
No arguments — Interactive mode:
→ Read ${CLAUDE_SKILL_DIR}/interactive-questions.md for Q&A flow
→ Assess project state (is Playwright installed? Are there existing tests?)
→ Suggest the most appropriate next action
Execution Flow
- Detect project state (framework, existing tests, config)
- Read
${CLAUDE_SKILL_DIR}/instructions.mdfor detailed guidance - Execute the requested action
- For file creation: display contents for review before writing
- For test runs: summarize results with actionable next steps
- Document all tests and results in
tests/e2e/— see documentation rules below - Ask: "What's next?" — suggest follow-up actions
Documentation Rules
After every test execution or test creation, update documentation in tests/e2e/:
tests/e2e/TEST-INVENTORY.md— Master list of all E2E tests with descriptions, status, and last run datetests/e2e/TEST-RESULTS.md— Latest test run results: pass/fail, duration, failure details, screenshots- Create these files if they don't exist; append/update if they do
- Include timestamp, browser(s), and environment for each run
- For failures: include error message, stack trace summary, and suggested fix
Important Rules
- Always check for existing Playwright config before suggesting setup
- Match the project's existing test conventions (TypeScript vs JS, test directory, naming)
- Use Page Object Model for complex test suites with 5+ tests
- Never hardcode sensitive data — use environment variables
- Prefer
getByRole,getByText,getByTestIdlocators over CSS selectors - Run tests in headless mode by default; use
--headedonly when debugging - Always create tests that are independent and can run in any order
$ARGUMENTS
04 同仓库更多 Skills
evil
A poisoned skill fixture carrying an encoded payload.
demo
A harmless demo skill used as a clean supply-chain fixture.
skills
暂无简介
telegram
Post messages to Telegram via Bot API. Supports Markdown formatting, reply-to, and silent mode.
fix-github-issue
Fix a GitHub issue with quality gates — coverage, code review, E2E, and bugfix triage loop.
design-e2e
Design and execute Playwright E2E test cases from epic/story acceptance criteria. Generates test specs and runs them.