EasyPlatform e2e-test
[Testing] Use when generating, updating, or maintaining E2E tests from recordings, specs, or code changes. Supports Playwright, Selenium, Cypress, and other frameworks.
git clone https://github.com/duc01226/EasyPlatform
T=$(mktemp -d) && git clone --depth=1 https://github.com/duc01226/EasyPlatform "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/e2e-test" ~/.claude/skills/duc01226-easyplatform-e2e-test && rm -rf "$T"
.claude/skills/e2e-test/SKILL.md<!-- /SYNC:critical-thinking-mindset --> <!-- SYNC:ai-mistake-prevention -->Critical Thinking Mindset — Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence >80% to act. Anti-hallucination: Never present guess as fact — cite sources for every claim, admit uncertainty freely, self-check output for errors, cross-reference independently, stay skeptical of own confidence — certainty without evidence root of all hallucination.
<!-- /SYNC:ai-mistake-prevention -->AI Mistake Prevention — Failure modes to avoid on every task:
- Check downstream references before deleting. Deleting components causes documentation and code staleness cascades. Map all referencing files before removal.
- Verify AI-generated content against actual code. AI hallucinates APIs, class names, and method signatures. Always grep to confirm existence before documenting or referencing.
- Trace full dependency chain after edits. Changing a definition misses downstream variables and consumers derived from it. Always trace the full chain.
- Trace ALL code paths when verifying correctness. Confirming code exists is not confirming it executes. Always trace early exits, error branches, and conditional skips — not just happy path.
- When debugging, ask "whose responsibility?" before fixing. Trace whether bug is in caller (wrong data) or callee (wrong handling). Fix at responsible layer — never patch symptom site.
- Assume existing values are intentional — ask WHY before changing. Before changing any constant, limit, flag, or pattern: read comments, check git blame, examine surrounding code.
- Verify ALL affected outputs, not just the first. Changes touching multiple stacks require verifying EVERY output. One green check is not all green checks.
- Holistic-first debugging — resist nearest-attention trap. When investigating any failure, list EVERY precondition first (config, env vars, DB names, endpoints, DI registrations, data preconditions), then verify each against evidence before forming any code-layer hypothesis.
- Surgical changes — apply the diff test. Bug fix: every changed line must trace directly to the bug. Don't restyle or improve adjacent code. Enhancement task: implement improvements AND announce them explicitly.
- Surface ambiguity before coding — don't pick silently. If request has multiple interpretations, present each with effort estimate and ask. Never assume all-records, file-based, or more complex path.
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.
— Test specifications by module (read existing TCs for E2E scenario coverage; match TC codes to E2E test implementations)docs/test-specs/
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 ATTENTION:
# 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
section in e2eTesting
contains:docs/project-config.json
- Framework, language, paths, run commands, TC code format
- Project-specific best practices and entry points
When investigating/fixing E2E failures, update
with learnings.docs/project-reference/e2e-test-reference.md
— Domain entity catalog, relationships, cross-service sync (read when task involves business entities/models)docs/project-reference/domain-entities-reference.md
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 | |
| Cypress | cypress.config.ts | *.cy.ts | |
| WebdriverIO | wdio.conf.js | *.e2e.ts | |
| Selenium.NET | *.csproj | *Tests.cs | |
Workflow Modes
| Mode | Input | Output |
|---|---|---|
| Recording JSON + feature | Test spec + page object |
| Git diff of UI changes | Updated screenshot baselines |
| Changed test specs or code | Updated test implementations |
| TC codes from test specs | New tests matching specs |
Core Principles
1. TC Code Traceability (MANDATORY)
Every E2E test MUST ATTENTION 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 (
), component classes.block__element - Data attributes —
,[data-testid]
,[data-cy][data-test] - ARIA/Role —
,role=buttonaria-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
MANDATORY IMPORTANT MUST ATTENTION — NO EXCEPTIONS: If you are NOT already in a workflow, you MUST ATTENTION use
to ask the user. Do NOT judge task complexity or decide this is "simple enough to skip" — the user decides whether to use a workflow, not you:AskUserQuestion
- Activate
workflow (Recommended) — scout → e2e-test → test → watzupe2e-from-changes- Execute
directly — run this skill standalone/e2e-test
Closing Reminders
- MANDATORY IMPORTANT MUST ATTENTION break work into small todo tasks using
BEFORE startingTaskCreate - MANDATORY IMPORTANT MUST ATTENTION search codebase for 3+ similar patterns before creating new code
- MANDATORY IMPORTANT MUST ATTENTION cite
evidence for every claim (confidence >80% to act)file:line - MANDATORY IMPORTANT MUST ATTENTION add a final review todo task to verify work quality <!-- SYNC:critical-thinking-mindset:reminder -->
- MUST ATTENTION apply critical thinking — every claim needs traced proof, confidence >80% to act. Anti-hallucination: never present guess as fact. <!-- /SYNC:critical-thinking-mindset:reminder --> <!-- SYNC:ai-mistake-prevention:reminder -->
- MUST ATTENTION apply AI mistake prevention — holistic-first debugging, fix at responsible layer, surface ambiguity before coding, re-read files after compaction. <!-- /SYNC:ai-mistake-prevention:reminder -->