
e2e-testing
Orchestrate complete E2E test creation workflow from feature analysis to test implementation and hea
E2E Test Workflow Skill
Orchestrates the complete E2E test creation workflow from feature analysis to test implementation and healing.
Purpose
USE this skill when:
- A feature has been developed and manually verified
- You need to create comprehensive E2E tests for new functionality
- You want to follow a structured approach to test creation
Workflow Steps
Step 1: Feature Analysis
Goal: Understand what was implemented and what needs testing.
Actions:
- Check git staged changes:
git diff --cached --name-only - Analyze staged files to understand the feature scope
- Check
requirements/directory for latest specifications:- Look for recent
.mdfiles - Find specifications matching the feature
- Look for recent
- If unclear, ASK USER:
- Which feature should be tested?
- Are there specific user flows to focus on?
- Any edge cases to consider?
Output: Clear understanding of feature scope and test requirements.
Step 2: Test Planning
Goal: Create comprehensive test plan using playwright-test-planner agent.
Actions:
- INVOKE playwright-test-planner agent with context:
- Feature description from analysis
- User-specified focus areas (if provided)
- Files that were changed
- Requirements specifications
- AGENT WILL:
- Navigate to the feature in browser
- Identify all interactive elements
- Create detailed test scenarios
- Document expected behaviors
- WAIT for agent to complete and return test plan
Output: Detailed test plan with scenarios, steps, and assertions.
Step 3: Test Implementation
Goal: Generate E2E tests using playwright-test-generator agent.
Actions:
- INVOKE playwright-test-generator agent with:
- Test plan from Step 2
- Feature context
- Component structure
- AGENT WILL:
- Create test files following project conventions
- Use proper data-testid selectors
- Implement fixtures where needed
- Follow ESM module patterns
- WAIT for agent to complete test generation
Output: Implemented test files ready to run.
Step 4: Test Execution
Goal: Run tests and analyze results.
Actions:
- RUN tests:
pnpm exec playwright test - WAIT for execution to complete
- ANALYZE results:
- Check test output in terminal
- Review
playwright-report/directory - Identify passing and failing tests
- CATEGORIZE failures:
- App code issues (business logic, API, data)
- Test code issues (selectors, assertions, timing)
Output: Test execution report with failure categorization.
Step 5: Healing Loop
Goal: Fix failures until all tests pass.
Actions:
If App Code is Broken:
- ANALYZE application code issues
- CREATE fix plan:
- Identify root cause
- Plan necessary changes
- Consider side effects
- IMPLEMENT fixes:
- Update application code
- Verify fixes manually if needed
- RE-RUN tests:
pnpm exec playwright test - IF STILL FAILING: Return to beginning of Step 5
If Test Code is Broken:
- INVOKE playwright-test-healer agent with:
- Failing test file paths
- Failure messages and stack traces
- Playwright report details
- AGENT WILL:
- Debug failing tests
- Fix selector issues
- Adjust timing and waits
- Update assertions
- WAIT for agent to complete healing
- RE-RUN tests:
pnpm exec playwright test - IF STILL FAILING: Repeat test healing (max 3 iterations)
- IF STILL FAILING after 3 iterations: ASK USER for guidance
Output: All tests passing or user intervention required.
Success Criteria
- Feature scope clearly identified
- Comprehensive test plan created
- Tests implemented following project patterns
- All tests passing consistently
- Test report generated and reviewed
Failure Recovery
If stuck in healing loop:
- ANALYZE pattern of failures
- CHECK if fundamental issue with test approach
- ASK USER if:
- Feature behavior is as expected
- Test scenarios are still valid
- Different testing approach needed
If agent fails:
- DOCUMENT agent failure details
- TRY manual intervention if possible
- ASK USER for guidance if blocked
Project-Specific Guidelines
Test Selector Requirements:
- VERIFY all components have data-testid attributes
- FOLLOW naming convention:
{feature}-{element}-{type} - REFERENCE .agents/test-ready-component-checklist.md
Fixture Integration:
- USE existing fixtures from
tests/fixtures/ - IMPORT test and expect from
tests/fixtures/index.ts - FOLLOW .agents/e2e-testing-patterns.md
Module Syntax:
- USE ESM import statements exclusively
- ADD
with { type: "json" }for JSON imports - NEVER use
require()in test files
Example Usage
User: "I just implemented the meeting schedule feature. Can you create E2E tests for it?"