Writes E2E tests for a feature flow or user story. Loads repo E2E conventions and writes tests using the project's established intercept, page object, and wait patterns. Use when adding end-to-end coverage for a user flow or feature.
Arguments: $ARGUMENTS — description of the flow or feature to test
Call test-context scoped to the E2E test directory. It writes its output to a timestamped file and echoes the full path — read that file to get E2E-specific conventions: intercept patterns, page object structure, wait strategy, form interaction patterns.
Search for existing tests that cover similar flows:
grep -r "{key terms from flow}" packages/e2e/ --include="*.cy.ts" -l 2>/dev/null | head -5
Read 1-2 relevant existing tests to understand the exact patterns used here.
Based on the flow description:
E2E test plan for: {flow description}
User journey:
1. {step}
2. {step}
3. {step}
API intercepts needed:
- {method} {route} → {alias}
Page objects needed:
- {existing page object} or {new page object to create}
Test cases:
- Happy path: {description}
- Error state: {description}
- Edge case: {description if relevant}
Following the patterns from Step 1 and Step 2:
cy.wait('@alias') without intercept setup)cy.wait(5000))Rules:
cy.get() selectors in test filescd packages/e2e # or wherever E2E tests live in this repo
# Run only the new test (add .only temporarily)
pnpm cypress run --spec "{test-file-path}" --headless 2>&1 | tail -50
If test fails: diagnose root cause before reporting. Check screenshots. Compare selectors against actual DOM.
Remove .only after confirming the test passes.
✅ E2E tests written for {flow}
Coverage added:
- {test case}
- {test case}
Test file: {path}
Page objects created/modified: {list}
REPO=$(git remote get-url origin 2>/dev/null | sed 's/.*\///' | sed 's/\.git//')
BRANCH=$(git branch --show-current 2>/dev/null | sed 's/\//-/g')
TS=$(date +%Y%m%d-%H%M%S)-$$
mkdir -p ~/.claude/skill-output/$REPO/$BRANCH
Write this report to ~/.claude/skill-output/$REPO/$BRANCH/write-e2e-tests-report-$TS.md.