integration-e2e-testing
Scannednpx machina-cli add skill shinpr/agentic-code/integration-e2e-testing --openclawIntegration Test & E2E Test Design/Implementation Rules
Test Types and Limits
| Type | Purpose | Limit |
|---|---|---|
| Integration Test | Component interaction verification | 3 per feature |
| E2E Test | Critical user journey verification | 1-2 per feature |
Behavior-First Principle
Observability Check (All YES = Include)
| Check | Question | If NO |
|---|---|---|
| Observable | Can user observe the result? | Exclude |
| System Context | Does it require integration of multiple components? | Exclude |
| Automatable | Can it run stably in CI environment? | Exclude |
Include/Exclude Criteria
Include: Business logic accuracy, data integrity, user-visible features, error handling Exclude: External live connections, performance metrics, implementation details, UI layout
Skeleton Specification
Required Comment Format
Each test skeleton MUST include:
- AC: Original acceptance criteria text
- ROI: Calculated score with Business Value and Frequency
- Behavior: Trigger → Process → Observable Result format
- Metadata: @category, @dependency, @complexity annotations
Implementation Rules
Behavior Verification
| Step Type | Verification Target |
|---|---|
| Trigger | Reproduce in test setup (Arrange) |
| Process | Intermediate state or function call |
| Observable Result | Final output value (return value, error message, log output) |
Pass Criteria: Test passes if "observable result" is verified as return value or mock call argument
Integration Test Mock Boundaries
| Judgment Criteria | Mock | Actual |
|---|---|---|
| Part of test target? | No → Can mock | Yes → Actual required |
| External network communication? | Yes → Mock required | No → Actual recommended |
E2E Test Execution Conditions
- Execute only after all components are implemented
- Do not use mocks (full system integration required)
Review Criteria
Skeleton and Implementation Consistency
| Check | Failure Condition |
|---|---|
| Behavior Verification | No assertion for "observable result" |
| Verification Item Coverage | Listed verification items not included in assertions |
| Mock Boundary | Internal components mocked in integration test |
Implementation Quality
| Check | Failure Condition |
|---|---|
| AAA Structure | Arrange/Act/Assert separation unclear |
| Independence | State sharing between tests, execution order dependency |
| Reproducibility | Depends on date/random, results vary |
| Readability | Test name and verification content don't match |
Source
git clone https://github.com/shinpr/agentic-code/blob/main/.agents/skills/integration-e2e-testing/SKILL.mdView on GitHub Overview
This skill guides designing integration and end-to-end tests with explicit mock boundaries. It emphasizes observable results, clear inclusion criteria, and a skeleton-driven workflow that records acceptance criteria, business value, and dependencies. It also defines per-feature test limits and when tests should run in CI.
How This Skill Works
Define test types and limits (3 integration, 1-2 E2E per feature). Apply the Behavior-First principle with Observability, System Context, and Automatable checks to decide inclusion. Create a skeleton for each test containing AC, ROI, Behavior, and Metadata, then verify tests against AAA structure and mock boundary rules.
When to Use It
- Writing E2E tests for critical user journeys
- Creating integration tests to verify component interactions
- Reviewing test quality and coverage against the skeleton criteria
- Ensuring correct mock boundaries for external dependencies in integration tests
- Documenting test expectations with AC, ROI, Behavior, and metadata
Quick Start
- Step 1: Define the feature's test types and apply the Behavior-First observability checks to decide which tests to include
- Step 2: Draft the test skeletons with AC, ROI, Behavior, and Metadata for each planned test
- Step 3: Implement tests using Arrange/Act/Assert; ensure E2E tests run with full system integration (no mocks) and CI compatibility; review against the criteria
Best Practices
- Limit test counts per feature: up to 3 integration tests and 1-2 E2E tests
- Start with Behavior-First observability: Observable, System Context, Automatable
- Always include a Skeleton with AC, ROI, Behavior, and Metadata
- Mock external networks in integration tests when appropriate; avoid mocks in E2E
- Write AAA-style tests with Arrange/Act/Assert and ensure independence
Example Use Cases
- Integration test for a payment component using a mock external gateway boundary
- E2E test for checkout flow without mocks, validating observable results
- Skeleton-driven test for a new feature with AC, ROI, Behavior, Metadata
- Reviewing a test pack to ensure observable result is asserted
- Enforcing per-feature test limits: 3 integration, 1-2 E2E