Get the FREE Ultimate OpenClaw Setup Guide →

integration-e2e-testing

Scanned
npx machina-cli add skill shinpr/agentic-code/integration-e2e-testing --openclaw
Files (1)
SKILL.md
2.8 KB

Integration Test & E2E Test Design/Implementation Rules

Test Types and Limits

TypePurposeLimit
Integration TestComponent interaction verification3 per feature
E2E TestCritical user journey verification1-2 per feature

Behavior-First Principle

Observability Check (All YES = Include)

CheckQuestionIf NO
ObservableCan user observe the result?Exclude
System ContextDoes it require integration of multiple components?Exclude
AutomatableCan 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 TypeVerification Target
TriggerReproduce in test setup (Arrange)
ProcessIntermediate state or function call
Observable ResultFinal 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 CriteriaMockActual
Part of test target?No → Can mockYes → Actual required
External network communication?Yes → Mock requiredNo → 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

CheckFailure Condition
Behavior VerificationNo assertion for "observable result"
Verification Item CoverageListed verification items not included in assertions
Mock BoundaryInternal components mocked in integration test

Implementation Quality

CheckFailure Condition
AAA StructureArrange/Act/Assert separation unclear
IndependenceState sharing between tests, execution order dependency
ReproducibilityDepends on date/random, results vary
ReadabilityTest 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

  1. Step 1: Define the feature's test types and apply the Behavior-First observability checks to decide which tests to include
  2. Step 2: Draft the test skeletons with AC, ROI, Behavior, and Metadata for each planned test
  3. 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

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers