Agent skill
e2e-test
[Testing] Use when generating, updating, or maintaining E2E tests from recordings, specs, or code changes. Supports Playwright, Selenium, Cypress, and other frameworks.
Install this agent skill to your Project
npx add-skill https://github.com/duc01226/EasyPlatform/tree/main/.claude/skills/e2e-test
SKILL.md
Skill: e2e-test
Category: [Testing] Trigger: e2e test, e2e from recording, generate e2e, playwright test, cypress test, selenium test, webdriver, puppeteer
Generate and maintain E2E tests using the project's configured testing framework.
docs/test-specs/— Test specifications by module (read existing TCs for E2E scenario coverage; match TC codes to E2E test implementations)
Be skeptical. Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence percentages (Idea should be more than 80%).
⚠️ MANDATORY: Read Project E2E Reference (FIRST)
BEFORE ANY E2E WORK, you MUST:
# 1. Read project-specific E2E patterns (REQUIRED)
head -100 docs/project-reference/e2e-test-reference.md
# 2. Read project config for framework, paths, commands
grep -A 50 '"e2eTesting"' docs/project-config.json
# 3. Find TC codes you need to implement
grep -r "TC-.*-E2E-" docs/test-specs/ docs/business-features/
The e2eTesting section in docs/project-config.json contains:
- Framework, language, paths, run commands, TC code format
- Project-specific best practices and entry points
When investigating/fixing E2E failures, update docs/project-reference/e2e-test-reference.md with learnings.
docs/project-reference/domain-entities-reference.md— Domain entity catalog, relationships, cross-service sync (read when task involves business entities/models)
Framework Detection (SECOND STEP)
Detect the project's E2E stack before generating tests:
# TypeScript/JavaScript
grep -l "playwright\|cypress\|selenium\|webdriver" package.json 2>/dev/null
ls playwright.config.* cypress.config.* wdio.conf.* 2>/dev/null
# C# .NET
grep -r "Selenium.WebDriver\|Microsoft.Playwright" **/*.csproj 2>/dev/null
| Framework | Config File | Test Extension | Run Command |
|---|---|---|---|
| Playwright | playwright.config.ts | *.spec.ts | npx playwright test |
| Cypress | cypress.config.ts | *.cy.ts | npx cypress run |
| WebdriverIO | wdio.conf.js | *.e2e.ts | npx wdio run |
| Selenium.NET | *.csproj | *Tests.cs | dotnet test |
Workflow Modes
| Mode | Input | Output |
|---|---|---|
from-recording |
Recording JSON + feature | Test spec + page object |
update-ui |
Git diff of UI changes | Updated screenshot baselines |
from-changes |
Changed test specs or code | Updated test implementations |
from-spec |
TC codes from test specs | New tests matching specs |
Core Principles
1. TC Code Traceability (MANDATORY)
Every E2E test MUST have:
- TC code in test name:
TC-{MODULE}-E2E-{NNN} - Tag/trait linking to spec
- Comment linking to feature doc
// TypeScript
test('TC-LR-E2E-001: Submit leave request', async () => { ... });
// C# .NET
[Fact]
[Trait("TC", "TC-LR-E2E-001")]
public async Task SubmitLeaveRequest() { ... }
2. Page Object Model
All frameworks should use Page Object pattern:
- Encapsulate page locators in page class
- Methods represent user actions
- Assertions in test file, not page object
3. Selector Strategy (Priority Order)
- Semantic classes — BEM (
.block__element), component classes - Data attributes —
[data-testid],[data-cy],[data-test] - ARIA/Role —
role=button,aria-label - Text content — Visible user text (last resort)
AVOID: Generated classes (.ng-star-inserted, .MuiButton-root), positional selectors (:nth-child), XPath
4. Unique Test Data
Tests must generate unique data to be repeatable:
- Append GUIDs/timestamps to test data
- Don't depend on specific database state
- Don't clean up data (creates side effects)
5. Preconditions Documentation
Document what must exist before test runs:
- System: Infrastructure running, APIs healthy
- Data: Seed data exists (users, companies)
- Feature: Configurations complete
Steps
- Detect framework from project files
- Read project E2E docs for conventions and patterns
- Load test specs with TC codes from feature docs
- Generate/update tests following Page Object pattern
- Run tests using project's configured commands
- Update e2e-test-reference.md with any learnings
Output
Report:
- Files created/modified
- TC codes covered
- Run command to execute tests
- Any preconditions or setup needed
Workflow Recommendation
IMPORTANT MUST: If you are NOT already in a workflow, use
AskUserQuestionto ask the user:
- Activate
e2e-from-changesworkflow (Recommended) — scout → e2e-test → test → watzup- Execute
/e2e-testdirectly — run this skill standalone
Closing Reminders
- MUST break work into small todo tasks using
TaskCreateBEFORE starting - MUST search codebase for 3+ similar patterns before creating new code
- MUST cite
file:lineevidence for every claim (confidence >80% to act) - MUST add a final review todo task to verify work quality
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
fix-parallel
[Implementation] Analyze & fix issues with parallel fullstack-developer agents
ask
[Utilities] Answer technical and architectural questions.
claude-code
[Utilities] Claude Code CLI setup, configuration, troubleshooting, and feature guidance. Triggers on claude code setup, hook not firing, MCP connection, context limit, skill creation, slash command setup.
workflow-deployment
[Workflow] Trigger Deployment & Infrastructure workflow — CI/CD pipelines, Docker, Kubernetes setup and deployment.
workflow-idea-to-pbi
[Workflow] Trigger Idea to PBI workflow — po/ba workflow: capture idea, refine to pbi, create stories, prioritize.
easy-claude-help
[Utilities] Configuration guide for the easy-claude framework — explain settings, guide users through configuring .ck.json.
Didn't find tool you were looking for?