Integration E2e Testing logo

Integration E2e Testing

Community
shinpr
integration-e2e-testing

选择并设计能在可观测边界证明已接受行为的最小集成/E2E 测试集。用于编写或评审 E2E 或集成测试时。

Overview

Publishershinpr
Repositoryai-coding-project-boilerplate
Skill nameintegration-e2e-testing
Stars
234
Forks
28
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by shinpr on GitHub. Read the source before you install it.

Installation

Install the Integration E2e Testing AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/shinpr/ai-coding-project-boilerplate/tree/main/.claude/skills-zh-CN/integration-e2e-testing
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/shinpr/ai-coding-project-boilerplate.git /tmp/ai-coding-project-boilerplate
mkdir -p .claude/skills
cp -r /tmp/ai-coding-project-boilerplate/.claude/skills-zh-CN/integration-e2e-testing .claude/skills/integration-e2e-testing
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Integration E2e Testing in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Integration E2e Testing on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Integration E2e Testing is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

集成测试与 E2E 测试设计/实现规则

参考资料

测试类型与选择

测试类型目的范围外部依赖文件格式实现时机
Integration验证组件间进程内交互部分系统集成(进程内模块;对于 UI 组件,React/TS 使用 RTL+MSW)已 Mock 或进程内*.int.test.ts与实现同步创建
fixture-e2e使用确定性 fixture 验证浏览器行为使用 mock 后端/fixture 驱动状态的完整 UI 流程仅 Mock/fixture — 无实际运行的服务*.fixture-e2e.test.ts与 UI 功能同步创建
service-integration-e2e验证只有运行中的技术栈才能暴露的契约跨服务的完整系统实际运行的本地服务或服务级桩(stub)*.service-e2e.test.ts在所需服务就绪后执行

Lane 选择(仅限 E2E):

  • 面向用户的 UI 流程默认测试通道是 fixture-e2e —— 它在真实浏览器中针对确定性 fixture 运行,能捕捉单元/集成测试遗漏的问题(按钮无响应、状态未更新、导航失效),并且无需基础设施设置即可在 CI 中运行
  • 当证明义务是真实的跨服务行为时,例如数据持久化、事务一致性或外部服务契约,选择 service-integration-e2e

从已接受的证明义务出发,将每项义务分配给能暴露其失败的最低成本边界,去除重复覆盖,并保留能覆盖每个剩余独立失败的最小测试集。让这些义务决定测试数量。一个功能在某个测试通道中可以合理地产生零项测试。

行为优先原则

候选依据

一个集成/E2E 候选项需陈述:

  • 该边界上由已接受行为所命名的可观测结果;
  • 一个跨越所选测试通道所涉及组件的实质性失败;
  • 一个能够复现该失败的自动化测试装置或受控环境

将可在隔离环境中观测到的行为路由至单元/组件验证。若受控环境不可用,将其记录为 service-integration-e2e 的证明前提条件。

候选项路由

  • 当业务逻辑准确性、数据完整性、用户可见行为和可观测的错误处理需要这些边界时,将其保留在集成/E2E 测试池中
  • 将纯粹的实现细节和数据转换路由至单元测试,将性能声明路由至性能验证,将纯布局声明路由至视觉或 UI 检查
  • 当外部契约本身是证明目标时,使用服务级桩或受控的本地服务来表示该契约

骨架规范

必需的骨架格式

一个符合项目测试匹配模式的已提交文件,对其运行器而言必须保持有效。使用所检测框架中最小的挂起(pending)套件(describe 加 it.todo,或其等价形式),仅包含测试框架的 import 语句和必需的注释。实现任务会替换掉挂起用例,并加入应用层 import、断言、fixture 和 mock 设置以配合实现。

每个测试必须包含以下注解。

typescript
// AC: "[验收标准原文]"
// Behavior: [触发] -> [处理] -> [可观测结果]
// @lane: integration | fixture-e2e | service-integration-e2e
// @dependency: none | [组件名称] | full-ui (mocked backend) | full-system
// @real-dependency: [组件名称](可选,当“测试边界”指定了非 mock 设置时)
// Primary failure mode: [必须使已实现的测试失败的具体回归问题]
// Proof obligation: [已实现的测试必须断言的边界与可观测状态]
// Verification items: [用以证实该义务的观察项]

@lane 选择规则:

  • integration — 组件间进程内交互,无浏览器(例如 React/TS 的 RTL+MSW,或任意语言中的进程内模块/处理器集成)
  • fixture-e2e — 使用 mock 后端/fixture 驱动状态的浏览器级 UI 验证。@dependency 通常为 full-ui (mocked backend)
  • service-integration-e2e — 针对实际运行的本地服务或桩的浏览器级或端到端验证。@dependency 为 full-system

属性注解

typescript
// Property: `[验证表达式]`
// fast-check: fc.property(fc.[arbitrary], (input) => [invariant])

测试集选择

  1. 从约束性产物或任务中读取已接受行为以及每项已记录的证明义务。
  2. 对每项义务,明确必须使测试失败的实质性失败原因,以及能暴露该失败的可观测状态。
  3. 检索现有测试。仅当其针对同一边界且会因该失败而失败时,才复用该覆盖。
  4. 将该义务分配给能满足要求的范围最窄的测试通道:
    • 单元/组件测试——当隔离执行即可暴露该行为时;
    • integration——用于进程内组件契约;
    • fixture-e2e——用于后端可为确定性的浏览器行为;
    • service-integration-e2e——用于持久化、事务、消息或外部契约,其失败只能通过该实际运行的边界暴露
  5. 在保持断言与失败之间清晰映射关系的前提下,将由同一场景证明的多项义务合并。将不同的设置和失败模式保留在各自独立的场景中。
  6. 仅输出剩余的最小覆盖集。在每个骨架中记录已接受行为、主要失败、证明义务、所选测试通道和 mock 边界。

从已接受行为和仓库证明边界出发进行选择;产品分析数据和数值估算并非必需。当已接受行为或所需契约在查阅约束来源与仓库依据后仍无法确定时,需上报处理。

实现规则

基于属性的测试实现

当存在 Property 注解时,必须使用 fast-check:

  • 以 fc.assert(fc.property(...)) 格式编写
  • 在实现中直接体现骨架中的 // fast-check: 注释
  • 发现失败用例时,将其作为具体的单元测试添加(防止回归)

行为验证实现

行为描述验证级别:

步骤类型验证目标示例
Trigger在 Arrange 中复现API 失败 -> mockResolvedValue({ ok: false })
Process中间状态或调用函数调用、状态变化
Observable Result最终输出值返回值、错误信息、日志输出

通过标准:若“可观测结果”作为测试目标的返回值或 mock 调用参数得到验证,则通过

验证项确定规则

骨架状态验证项确定方法
已列出 // Verification items:使用 expect 实现所有列出的项目
无 // Verification items:从 “Behavior” 描述中的“可观测结果”推导
两者皆有优先采用验证项,将行为描述作为补充

集成测试 Mock 边界

选取第一条与被评审断言相匹配的规则:

条件应使用的边界
被测对象正是外部适配器、查询、迁移或服务契约本身使用真实边界,或在 service-integration-e2e 测试通道中使用服务级桩 —— mock 无法证明其所替代的契约
未被测试的外部 API 或网络调用Mock
被测的组件间交互真实的进程内组件
调用本身即是测试所验证的对象(例如日志输出)可验证的 mock(vi.fn())
调用及其目标均不在测试范围内使用真实对象,或忽略

E2E 测试执行条件

fixture-e2e:

  • 与 UI 功能实现阶段同步执行
  • 使用 mock 后端/fixture 驱动状态(@dependency: full-ui (mocked backend))
  • 借助确定性 fixture 设置在 CI 中运行

service-integration-e2e:

  • 在待验证组件已存在、且该测试所经过的服务已启动的最早阶段执行
  • 通过实际运行的本地服务或服务级桩来验证被测组件(@dependency: full-system)

评审标准

骨架与实现的一致性

检查项失败条件
Property Verification存在 Property 注解但未使用 fast-check
Behavior Verification未对“可观测结果”进行 expect
Verification Item Coverage已列出的验证项未包含在 expect 中
Mock Boundary集成测试中 mock 了内部组件

共享变更操作的路由一致性

当多个路由到达同一个变更操作时——例如 CLI 路径与 HTTP 处理器、定时任务与手动触发、批量端点与单条目端点——需沿四个维度进行比较:校验、分类、资源边界,以及读取、解析、变更、上报的顺序。

只有能够决定意图的来源——需求、设计文档或 ADR——才能允许存在差异。测试处于该决策的下游——它们记录的是既有行为,因此一个覆盖了宽松路由的既有测试只是确认了该绕过行为,而非赋予其正当性。一旦某项差异被允许,测试便用于验证其行为是否符合该决策。

当某项差异没有任何允许来源时,需要一个能暴露该绕过问题的测试:通过跳过检查的路由驱动该变更操作,并断言原本被跳过的检查所要保护的状态。

检查项失败条件
Validation parity一个路由校验了某项输入,而另一路由未经检查即接受,且没有需求或契约允许此差异
Classification parity同一失败在不同路由中被分类不同,改变了调用方所观察到的结果
Resource-bound parity一个路由强制执行了大小、数量或超时边界,而另一路由缺失该限制
Operation-order parity各路由在读取/解析/变更/上报的顺序上存在差异,导致某一路由可能在校验之前变更,或在持久化之前上报
Bypass coverage一项未加说明的差异,没有测试通过宽松路由驱动该变更操作来加以覆盖

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Integration E2e Testing AI skill do?

选择并设计能在可观测边界证明已接受行为的最小集成/E2E 测试集。用于编写或评审 E2E 或集成测试时。

Why use Integration E2e Testing on TypingMind?

Because you install it once and use it with any model. Integration E2e Testing is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Integration E2e Testing in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/shinpr/ai-coding-project-boilerplate/tree/main/.claude/skills-zh-CN/integration-e2e-testing. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Integration E2e Testing?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Integration E2e Testing?

As many as you like. As long as a model supports skills, you can use Integration E2e Testing with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Integration E2e Testing AI skill free?

Yes. It is published on GitHub by shinpr under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇