integration-e2e-testing

Designs integration and E2E tests with mock boundaries and behavior verification rules. Use when writing E2E or integration tests.

$ Installer

git clone https://github.com/shinpr/ai-coding-project-boilerplate /tmp/ai-coding-project-boilerplate && cp -r /tmp/ai-coding-project-boilerplate/.claude/skills-en/integration-e2e-testing ~/.claude/skills/ai-coding-project-boilerplate

// tip: Run this command in your terminal to install the skill


name: integration-e2e-testing description: Designs integration and E2E tests with mock boundaries and behavior verification rules. Use when writing E2E or integration tests.

Integration Test & E2E Test Design/Implementation Rules

Test Types and Limits

TypePurposeFile FormatLimit
Integration TestComponent interaction verification*.int.test.ts3 per feature
E2E TestCritical user journey verification*.e2e.test.ts1-2 per feature

Critical User Journey: Features with revenue impact, legal requirements, or daily use by majority of users

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

// AC: "[Acceptance criteria original text]"
// ROI: [0-100] | Business Value: [0-10] | Frequency: [0-10]
// Behavior: [Trigger] -> [Process] -> [Observable Result]
// @category: core-functionality | integration | edge-case | ux | e2e
// @dependency: none | [component name] | full-system
// @complexity: low | medium | high
it.todo('[AC number]: [Test name]')

Property Annotations

// Property: `[Verification expression]`
// fast-check: fc.property(fc.[arbitrary], (input) => [invariant])
it.todo('[AC number]-property: [Invariant description]')

ROI Calculation

ROI = (Business Value x Frequency + Legal Requirement x 10 + Defect Detection) / Total Cost
TypeTotal CostE2E Generation Condition
Integration11-
E2E38ROI > 50

Implementation Rules

Property-Based Test Implementation

When Property annotation exists, fast-check library is required:

import fc from 'fast-check'

it('AC2-property: Model name is always gemini-3-pro-image-preview', () => {
  fc.assert(
    fc.property(fc.string(), (prompt) => {
      const result = client.generate(prompt)
      return result.model === 'gemini-3-pro-image-preview'
    })
  )
})

Requirements:

  • Write in fc.assert(fc.property(...)) format
  • Reflect skeleton's // fast-check: comment directly in implementation
  • When failure case discovered, add as concrete unit test (regression prevention)

Behavior Verification Implementation

Behavior Description Verification Levels:

Step TypeVerification TargetExample
TriggerReproduce in ArrangeAPI failure -> mockResolvedValue({ ok: false })
ProcessIntermediate state or callFunction call, state change
Observable ResultFinal output valueReturn value, error message, log output

Pass Criteria: Pass if "observable result" is verified as return value or mock call argument of test target

Verification Item Determination Rules

Skeleton StateVerification Item Determination Method
// Verification items: listedImplement all listed items with expect
No // Verification items:Derive from "observable result" in "Behavior" description
Both presentPrioritize verification items, use behavior as supplement

Integration Test Mock Boundaries

Judgment CriteriaMockActual
Part of test target?No -> Can mockYes -> Actual required
Is call verification target of test?No -> Can mockYes -> Actual or verifiable mock
External network communication?Yes -> Mock requiredNo -> Actual recommended

Judgment Flow:

  1. External API (HTTP communication) -> Mock required
  2. Component interaction under test -> Actual required
  3. Log output verification needed -> Use verifiable mock (vi.fn())
  4. Log output verification not needed -> Actual or ignore

E2E Test Execution Conditions

  • Execute only after all components are implemented
  • Do not use mocks (@dependency: full-system)

Review Criteria

Skeleton and Implementation Consistency

CheckFailure Condition
Property VerificationProperty annotation exists but fast-check not used
Behavior VerificationNo expect for "observable result"
Verification Item CoverageListed verification items not included in expect
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