跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

integration-e2e-testing

Selects and designs the smallest integration/E2E test set that proves accepted behavior at an observable boundary. Use when writing or reviewing E2E or integration tests.

shinpr · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add shinpr/ai-coding-project-boilerplate --skill integration-e2e-testing

技能说明


name: integration-e2e-testing description: Selects and designs the smallest integration/E2E test set that proves accepted behavior at an observable boundary. Use when writing or reviewing E2E or integration tests.

Integration Test & E2E Test Design/Implementation Rules

References

  • references/e2e-design.md - E2E test design principles with Playwright (candidate properties, selection criteria, candidate record)
  • references/e2e-environment-prerequisites.md - service-integration-e2e environment prerequisites (seed data, auth fixtures, environment checklist); fixture-e2e requires no live service or real database

Test Types and Selection

Test TypePurposeScopeExternal DepsFile FormatImplementation Timing
IntegrationVerify component interactions in-processPartial system integration (in-process modules; for UI components, RTL+MSW for React/TS)Mocked or in-process*.int.test.tsCreated alongside implementation
fixture-e2eVerify browser behavior with deterministic fixturesFull UI flow with mocked backend / fixture-driven stateMocked / fixture only — no live services*.fixture-e2e.test.tsCreated alongside the UI feature
service-integration-e2eVerify a contract that only a running stack can exposeFull system across servicesLive local services or service-level stubs*.service-e2e.test.tsExecuted after the required services exist

Lane selection (E2E only):

  • Default lane for user-facing UI journeys is fixture-e2e — it runs a real browser against deterministic fixtures, catches the bugs that unit/integration tests miss (button no-op, state never updates, navigation breaks), and runs in CI without infrastructure setup
  • Select service-integration-e2e when the proof obligation is real cross-service behavior such as data persistence, transactional consistency, or an external service contract

Start from accepted proof obligations, assign each to the cheapest boundary that can expose its failure, remove duplicate coverage, and keep the smallest set that covers every remaining distinct failure. Let those obligations determine the test count. A feature may validly produce no test in a lane.

Behavior-First Principle

Candidate Evidence

An integration/E2E candidate states:

  • an observable result at the boundary named by the accepted behavior
  • a material failure that crosses the components exercised by the selected lane
  • an automated harness or controlled environment capable of reproducing that failure

Route behavior observable in isolation to unit/component verification. Record an unavailable controlled environment as a proof prerequisite for service-integration-e2e.

Candidate Routing

  • Keep business-logic accuracy, data integrity, user-visible behavior, and observable error handling in the integration/E2E pool when they require those boundaries
  • Route pure implementation details and data transformations to unit tests, performance claims to performance verification, and layout-only claims to visual or UI checks
  • Represent external contracts with service-level stubs or a controlled local service when that contract is the proof target

Skeleton Specification

Required Skeleton Format

A committed file matching the project's test include pattern must remain valid to its runner. Use the detected framework's smallest pending suite (describe plus it.todo, or its equivalent), with only the test-framework import and the required comments. The implementing task replaces pending cases and adds application imports, assertions, fixtures, and mock setup alongside implementation.

Each test MUST include the following annotations.

// AC: "[Acceptance criteria original text]"
// Behavior: [Trigger] -> [Process] -> [Observable Result]
// @lane: integration | fixture-e2e | service-integration-e2e
// @dependency: none | [component names] | full-ui (mocked backend) | full-system
// @real-dependency: [component name] (optional, when Test Boundaries specify non-mock setup)
// Primary failure mode: [specific regression that must make the implemented test fail]
// Proof obligation: [boundary and observable state the implemented test must assert]
// Verification items: [observations that establish the obligation]

@lane selection rule:

  • integration — Component interaction in-process, no browser (e.g., RTL+MSW for React/TS, in-process module/handler integration in any language)
  • fixture-e2e — Browser-level UI verification with mocked backend / fixture-driven state. @dependency is typically full-ui (mocked backend)
  • service-integration-e2e — Browser-level or end-to-end verification against running local services or stubs. @dependency is full-system

Property Annotations

// Property: `[Verification expression]`
// fast-check: fc.property(fc.[arbitrary], (input) => [invariant])

Test Set Selection

  1. Read the accepted behavior and each recorded proof obligation from the governing artifact or task.
  2. For each obligation, name the material failure that must make a test fail and the observable state that exposes it.
  3. Search existing tests. Reuse coverage only when it exercises the same boundary and would fail for that failure.
  4. Assign the obligation to the narrowest sufficient lane:
    • unit/component when isolated execution exposes the behavior
    • integration for in-process component contracts
    • fixture-e2e for browser behavior whose backend may be deterministic
    • service-integration-e2e for persistence, transactions, messages, or external contracts whose failure is exposed only through that running boundary
  5. Merge obligations when one scenario proves them while preserving a clear assertion-to-failure mapping. Keep distinct setup and failure modes in
阅读完整来源 ↗