e2e-testing
Comprehensive E2E testing skill using Playwright MCP for systematic web application testing. This skill should be used when users need to test web-based systems end-to-end, set up test regimes, run exploratory tests, or analyze test history. Triggers on requests like "test my webapp", "set up E2E tests", "run the tests", "what's been flaky", or when validating web application functionality. The skill observes and reports only - it never fixes issues. Supports three modes - setup (create test regime), run (execute tests), and report (analyze results).
mhylle · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add mhylle/claude-skills-collection --skill e2e-testing技能说明
name: e2e-testing description: Comprehensive E2E testing skill using Playwright MCP for systematic web application testing. This skill should be used when users need to test web-based systems end-to-end, set up test regimes, run exploratory tests, or analyze test history. Triggers on requests like "test my webapp", "set up E2E tests", "run the tests", "what's been flaky", or when validating web application functionality. The skill observes and reports only - it never fixes issues. Supports three modes - setup (create test regime), run (execute tests), and report (analyze results). argument-hint: "[mode: setup|run|report] [url?]"
E2E Testing Skill
Contents
Reference files (open one when a step points to it):
references/flexibility-criteria-guide.md: Flexibility Criteria Guidereferences/history-schema.md: Test History Schema Referencereferences/test-regime-schema.md: Test Regime Schema Reference
Overview
A comprehensive E2E testing skill using Playwright MCP for systematic testing of any web-based system. The skill:
- Observes and reports - Never fixes issues, only documents them
- Discovers paths - Finds undocumented functionality at runtime
- Tracks history - Identifies flaky areas and suggests variations
- Produces dual reports - Human-readable and machine-readable formats
Prerequisites
Before using this skill, verify Playwright MCP is available:
- Check for
playwrightin MCP server configuration - If missing, add to Claude settings:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}
If Playwright MCP is unavailable, inform the user and provide setup instructions before proceeding.
Mode Selection
This skill operates in three modes. Determine mode from user request:
| User Request | Mode |
|---|---|
| "Set up tests for...", "Create test regime" | Setup |
| "Run the tests", "Test the...", "Execute tests" | Run |
| "Show test results", "What failed?", "What's flaky?" | Report |
If unclear, ask: "Would you like to set up a test regime, run existing tests, or view reports?"
Setup Mode
Purpose: Create or update test regime through interactive discovery.
Entry Points
Determine entry point from user context:
| Context | Entry |
|---|---|
| User provides URL | URL Exploration |
| User describes system purpose | Description-Based |
| User points to documentation | Documentation Extraction |
| Combination of above | Combined Flow (recommended) |
Setup Workflow
Step 1: Gather Initial Context
Ask for any missing information:
- URL: Base URL of the application
- Purpose: What does this system do? (1-2 sentences)
- Key workflows: What are the critical user journeys?
- Existing docs: Any README, user stories, or specs?
Step 2: Explore Application
Use Playwright MCP to explore:
Navigate to base URL
Capture accessibility snapshot
Identify:
- Navigation elements (menus, links)
- Interactive elements (buttons, forms)
- Key pages and sections
For each discovered element, note:
- Element type and purpose
- Alternative paths to reach it
- Required preconditions (login, etc.)
Step 3: Discover Alternative Paths
While exploring, actively look for:
- Multiple ways to accomplish the same goal
- Hidden or non-obvious functionality
- Edge cases in navigation
Document discoveries as: "Found alternative: [description]"
Step 4: Define Test Scenarios
For each key workflow, create scenario with:
scenario: [Descriptive name]
description: [What this tests]
preconditions:
- [Required state before test]
blocking: [true/false - does failure prevent other tests?]
steps:
- action: [navigate/click/type/verify/wait]
target: [selector or description]
value: [input value if applicable]
flexibility:
type: [exact/contains/ai_judgment]
criteria: [specific rules or judgment prompt]
success_criteria:
- [What must be true for pass]
alternatives:
- [Alternative path if primary fails]
Step 5: Create Test Regime File
Write regime to tests/e2e/test_regime.yml:
# Test Regime: [Application Name]
# Created: [YYYY-MM-DD]
# Last Updated: [YYYY-MM-DD]
metadata:
application: [Name]
base_url: [URL]
description: [Purpose]
global_settings:
screenshot_every_step: true
capture_network: true
capture_console: true
discovery_cap: 5 # Max new paths to discover per run
blocking_dependencies:
- scenario: login
blocks: [profile, settings, checkout] # These won't run if login fails
scenarios:
- scenario: [name]
# ... scenario definition
Step 6: Present Regime for Review
Show user:
- Summary of discovered scenarios
- Blocking dependencies identified
- Alternative paths found
- Ask for confirmation or modifications
Run Mode
Purpose: Execute tests sequentially with full evidence capture.