| name | e2e-ui-execute |
| description | Implement UI E2E tests sequentially using Playwright MCP, stop on bug discovery. Use after e2e-ui-research to implement the planned test scenarios. |
| context | fork |
| agent | general-purpose |
UI E2E Test Implementation Command
User Input
$ARGUMENTS
Extract test number (if specified) and consider any additional context from user input (if not empty).
Overview
-
Check Prerequisites:
- Verify
docs/e2e-ui/test-targets.md exists (English version, for AI)
- If not exists ERROR: "Please run /e2e-ui:research first"
-
Read Project Configuration:
- Read
playwright.config.ts (or .js):
- Extract test directory from
testDir or testMatch
- Extract base URL from
webServer.url or use.baseURL
- Read
package.json (in same directory):
- Detect framework from dependencies:
next, react, vue, svelte, etc.
- Fallback: If playwright.config not found, ask user for test directory and base URL
-
Load Test Targets:
- Read test scenarios from document
- Extract test number from $ARGUMENTS (if provided)
- Identify execution order
-
Execute Tests Sequentially:
- For each test scenario (in order):
a. Manual Testing Phase: Verify behavior with Playwright MCP
b. Bug Detection: Check for issues
c. Bug Handling: If bug found, create bilingual bug report (ko.md + md) and continue
d. Code Writing Phase: Write Playwright test code if passed (skip if bug)
e. Progress Reporting: Update summary document
-
Generate Documentation:
- Create
docs/e2e-ui/summary-test-N.md for each completed test
- Create
docs/e2e-ui/bug-report-test-N.ko.md and bug-report-test-N.md for bugs
- Track overall progress
-
Report Results:
- List of completed tests
- List of bugs found (with details)
- Summary of test code created
- Guide next steps
Key Rules
๐จ Bug Detection (Important)
Document and continue when these situations occur:
-
Page Load Failure:
- Navigation timeout
- 404/500 errors
- Blank page
-
Element Not Found:
- Expected button/input missing
- Wrong element attributes
- Wrong page structure
-
Interaction Failure:
- Click not working
- Input text not entering
- Form submission failure
-
Console Errors:
- JavaScript errors
- Network failures (except expected ones)
- React errors/warnings
-
Unexpected Behavior:
- Wrong navigation
- Wrong data display
- Missing UI elements
- Broken functionality
Bug Report Format (create both ko.md and md versions):
Files to create:
docs/e2e-ui/bug-report-test-N.ko.md (Korean)
docs/e2e-ui/bug-report-test-N.md (English)
## ๐ Bug Found
**Test**: [Test N: name]
**Priority**: [Critical/High/Medium]
**What Was Being Tested**:
[description]
**Reproduction Steps**:
1. [step 1]
2. [step 2]
3. [bug occurs here]
**Expected Behavior**:
[what should happen]
**Actual Behavior**:
[what actually happened]
**Evidence**:
- Screenshot: [path]
- Console Errors: [if any]
- Page State: [snapshot info]
**Impact**:
[impact on users]
After creating bug report, continue to next test instead of stopping.
โ
MUST DO
- Read
playwright.config.ts and package.json first to get project configuration
- playwright.config.ts: test directory, base URL, test settings
- package.json: framework detection
- Run tests one at a time (sequentially)
- Use Playwright MCP for actual testing before code writing
- Create bilingual bug reports (ko.md + md) when bugs found
- Continue testing after documenting bugs
- Write test code in directory from playwright.config.ts (testDir or testMatch)
- Write clean and maintainable test code
- Follow TypeScript and testing coding standards
- Generate summary for each test
- Take screenshots for evidence
โ NEVER DO
- Skip reading
playwright.config.ts (it's the primary source of truth)
- Run multiple tests in parallel
- Skip manual verification phase
- Stop testing after finding bug (should continue)
- Write test code without verifying behavior
- Create single-language bug reports (must be bilingual)
- Write test code outside directory specified in playwright.config
- Hardcode base URLs or test directories
- Ignore console errors or warnings
- Skip edge cases
๐ฏ Test Implementation Process
For each test:
-
Manual Verification (using Playwright MCP):
- Navigate to page
- Interact with UI elements
- Take snapshots
- Verify expected behavior
- Check console messages
-
Bug Check:
- Did everything work as expected?
- Any errors or warnings?
- Is behavior correct?
-
Decision Point:
- โ
If Pass: Proceed to write test code
- ๐ If Bug Found: Create bilingual bug report, continue to next test
-
Write Test Code (only if passed):
-
Documentation:
- Generate summary document
- Record what was tested
- Note observations
Document Template
File to create: docs/e2e-ui/summary-test-N.md
# Test N: [scenario name]
> **Created**: [YYYY-MM-DD HH:mm]
> **Related Plan**: `test-targets.md` > Test N
> **Status**: โ
Pass / ๐ Bug Found
---
## ๐ฏ Test Objective
[what this test verifies]
---
## ๐งช Manual Verification Results
**Test Steps Performed**:
1. [step 1] - โ
Success
2. [step 2] - โ
Success
3. [step 3] - โ
Success
**Screenshots**:
- [screenshot 1]: `path/to/screenshot1.png`
- [screenshot 2]: `path/to/screenshot2.png`
**Console Output**:
- [relevant console messages]
**Observations**:
- [interesting findings]
---
## ๐ Generated Test Code
**File**: `[path/to/test/file.spec.ts]`
**Main Assertions**:
- [assertion 1]
- [assertion 2]
**Code Structure**:
```typescript
// Brief overview of test structure
test("scenario name", async ({ page }) => {
// test steps
});
```
โ
Verification
Test Execution:
- Manual verification: โ
Pass
- Code implementation: โ
Complete
- Test successfully run: [โ
/ Not yet run]
Edge Cases Tested:
๐ Coverage
What This Test Covers:
- [feature 1]
- [user flow 2]
What It Doesn't Cover (future):
๐ Technical Notes
- [technical decisions made]
- [workarounds if needed]
- [dependencies or setup required]
---
## Bug Report Template
**Create bilingual bug reports when bug found**:
Files to create:
- `docs/e2e-ui/bug-report-test-N.ko.md` (Korean version)
- `docs/e2e-ui/bug-report-test-N.md` (English version)
### Korean Version Template
```markdown
# ๐ ๋ฒ๊ทธ ๋ฆฌํฌํธ: Test N
> **๋ฐ๊ฒฌ์ผ์**: [YYYY-MM-DD HH:mm]
> **ํ
์คํธ**: Test N: [์๋๋ฆฌ์ค ์ด๋ฆ]
> **์ฐ์ ์์**: [Critical/High/Medium]
---
## ๐ ๋ฒ๊ทธ ์์ฝ
[๋ฒ๊ทธ์ ๋ํ ํ ๋ฌธ์ฅ ์ค๋ช
]
---
## ๐ ์์ธ ๋ด์ฉ
**ํ
์คํธ ๋์**:
[ํ
์คํธ ์๋๋ฆฌ์ค ์ค๋ช
]
**์ฌํ ๋จ๊ณ**:
1. [๋จ๊ณ 1]
2. [๋จ๊ณ 2]
3. [๋ฒ๊ทธ ๋ฐ์ ์ง์ ]
**์์ ๋์**:
[๊ธฐ๋ํ๋ ๋์]
**์ค์ ๋์**:
[์ค์ ๋ฐ์ํ ๋์]
---
## ๐ธ ์ฆ๊ฑฐ
**์คํฌ๋ฆฐ์ท**:
- [์คํฌ๋ฆฐ์ท 1]: `path/to/screenshot.png`
**์ฝ์ ์๋ฌ**:
[์ฝ์ ์๋ฌ ๋ฉ์์ง ๋ถ์ฌ๋ฃ๊ธฐ]
**ํ์ด์ง ์ํ**:
```yaml
[ํ์ด์ง ์ค๋
์ท ๋๋ ๊ด๋ จ HTML]
๐ฅ ์ํฅ๋
์ฌ์ฉ์ ์ํฅ:
[์ต์ข
์ฌ์ฉ์์๊ฒ ๋ฏธ์น๋ ์ํฅ]
์ฌ๊ฐ๋:
[์ด ์ฐ์ ์์ ๋ ๋ฒจ์ธ ์ด์ ]
๐ ๋ค์ ๋จ๊ณ
- ์ฌ์ฉ์๊ฐ ๋ฒ๊ทธ ๋ฆฌํฌํธ ๊ฒํ
- ๊ฐ๋ฐ์๊ฐ ๋ฒ๊ทธ ์์
- ์์ ํ
/e2e-ui:execute N์ผ๋ก ์ด ํ
์คํธ๋ถํฐ ์ฌ๊ฐ ๊ฐ๋ฅ
### English Version Template
```markdown
# ๐ Bug Report: Test N
> **Discovered**: [YYYY-MM-DD HH:mm]
> **Test**: Test N: [scenario name]
> **Priority**: [Critical/High/Medium]
---
## ๐ Bug Summary
[one sentence description of bug]
---
## ๐ Details
**What Was Being Tested**:
[test scenario description]
**Reproduction Steps**:
1. [step 1]
2. [step 2]
3. [bug occurs here]
**Expected Behavior**:
[what should happen]
**Actual Behavior**:
[what actually happened]
---
## ๐ธ Evidence
**Screenshots**:
- [screenshot 1]: `path/to/screenshot.png`
**Console Errors**:
[paste console error messages]
**Page State**:
```yaml
[page snapshot or relevant HTML]
๐ฅ Impact
User Impact:
[impact on end users]
Severity:
[why this priority level]
๐ Next Steps
- User reviews this bug report
- Developer fixes the bug
- After fix, resume:
/e2e-ui:execute N to continue from this test
**Important**: After creating bug report, continue to next test instead of stopping.
---
## Execution Flow
### Initialization
1. **Read project configuration files**:
- `playwright.config.ts`: Extract test directory, base URL, naming convention from testMatch
- `package.json`: Detect framework from dependencies (next, react, vue, etc.)
- **Fallback**: If config not found, ask user for test directory and base URL
2. Load test targets document (docs/e2e-ui/test-targets.md - English version, for AI)
3. Determine which tests to run
4. Check existing summaries (resume capability)
### For Each Test
1. **Announce**: "Starting Test N: [name]"
2. **Manual Testing**:
- Use Playwright MCP tools
- Navigate, interact, verify
- Take screenshots
- Check console
3. **Evaluate**:
- Is behavior correct?
- Any errors?
4. **Decide**:
- If bug: Generate bilingual bug report (ko.md + md), continue to next
- If pass: Continue to code writing
5. **Write Code** (only if passed):
- Create test file in directory from playwright.config.ts
- Implement test logic
- Follow coding standards
- Follow naming convention from testMatch pattern
6. **Document**:
- Generate summary (if passed)
- Generate bug report (if bug found)
- Record findings
7. **Progress**: "Test N complete. Moving to Test N+1..."
### Completion
- Provide comprehensive summary:
- List of tests passed with generated code
- List of bugs found with report links
- Overall coverage achieved
- Recommendations for next steps
---
## Execute
Start working according to the guidelines above.