Agent skill

BiSheng E2E Test Generator

by dataelement in dataelement/bisheng

Generates and runs end-to-end tests for BiSheng, pairing pytest API tests with a manual checklist for UI behavior, from a feature spec or a free description.

Apache-2.0Auto-check passedTesting & QA

SKILL.md written in Chinese; this summary is our English description.

Install BiSheng E2E Test Generator

skills CLI
$ npx skills add dataelement/bisheng --skill e2e-test -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dataelement/bisheng e2e-test --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dataelement/bisheng.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/e2e-test .claude/skills/e2e-test && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
e2e-test
GitHub stars
12k
Token cost
~1.4k tokens
SKILL.md length
308 words
Files
3 (incl. references)
Skills in repo
10
Repo updated
First seen
Licence
Apache-2.0

At a glance

Generates and runs end-to-end tests for BiSheng, pairing pytest API tests with a manual checklist for UI behavior, from a feature spec or a free description.

  • Works in 6 steps: :模式识别 → :AC 分析(仅 SDD 模式) → :基础设施检查 → …
  • Writing end-to-end API tests from a feature's acceptance criteria
  • SKILL.md covers 概述, 调用方式, 六步流程 and 手动验证清单格式, plus 3 more sections
  • Calls pytest

What it does

Two modes are supported: SDD mode, which reads a feature directory's spec.md and builds coverage from its acceptance criteria, and free mode, which writes tests for a page or feature you describe. Tests are layered, with automated API end-to-end tests in pytest and httpx plus a manual verification checklist for UI behavior. The skill handles BiSheng-specific concerns such as JWT authentication, multi-tenant isolation, OpenFGA permission checks and UnifiedResponseModel assertions.

A six-step flow runs from mode detection and acceptance-criteria classification through an infrastructure check of the shared conftest.py and helpers, test generation, a run-and-fix loop and a coverage report. Generation follows twelve mandatory rules, including prefixed test data that is cleaned up by prefix only, cleanup both before and after, a dedicated test tenant, paired allow and deny permission tests, exact business error code assertions, acceptance-criteria IDs in docstrings and idempotent reruns.

Failures are diagnosed with references/common-pitfalls.md for at most three repair rounds, after which remaining problems are handed back to you. Criteria about UI interactions, such as forms, dialogs, routing and hidden buttons, go to an e2e-checklist.md instead of automated tests. The SKILL.md is in Chinese.

When your agent uses it

  • Writing end-to-end API tests from a feature's acceptance criteria
  • Adding tests for one BiSheng page or function from a free description
  • Producing a manual verification checklist for UI-heavy acceptance criteria

Example prompts

  • “Write end-to-end tests for the tenant management creation flow.”
  • “Generate E2E coverage from the spec.md of this feature directory and show me a coverage report.”
  • “Add permission tests that check a normal user is denied cross-tenant access.”

Requirements

  • A BiSheng checkout with the backend test environment under src/backend
  • pytest and httpx

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. :模式识别
  2. :AC 分析(仅 SDD 模式)
  3. :基础设施检查
  4. :生成测试
  5. :运行与修复
  6. :覆盖报告

What it can do on your machine

Read from SKILL.md and the folder at commit cb9b77a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pytest

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

BiSheng E2E Test Generator loads about 1.4k tokens when it runs, and up to ~4.9k if it reads all its reference files. Until then it costs about 72 tokens; SKILL.md has 308 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~72
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from dataelement/bisheng at commit cb9b77a, republished under its Apache-2.0 licence (© dataelement). 308 words, ~1,385 tokens.

Download SKILL.mdSave it as .claude/skills/e2e-test/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
e2e-test
description
为 BiSheng 生成和运行 E2E 测试。两种模式: (1) SDD 模式 — 基于 feature spec.md 的 AC 生成覆盖; (2) 自由模式 — 对指定页面/功能写测试。 采用双层策略:API 端到端测试(pytest + httpx)+ 页面手动验证清单。 自动处理认证、多租户隔离、权限检查、Radix UI 交互等常见问题。 用法:/e2e-test [feature_dir] 或 /e2e-test <描述> 当用户说"写 E2E 测试"、"端到端测试"、"E2E coverage", 或使用 /e2e-test 命令时触发。

E2E Test Skill

概述

生成并运行 BiSheng 的 E2E 测试,覆盖 API 链路和 UI 交互流程。自动处理 JWT 认证、多租户数据隔离、OpenFGA 权限检查验证、UnifiedResponseModel 响应断言等 BiSheng 特有问题。

调用方式

/e2e-test <feature_dir>          # SDD 模式:基于 spec.md AC 生成
/e2e-test <描述>                  # 自由模式:对指定页面/功能写测试

示例:

/e2e-test features/v2.5.0/004-rebac-core
/e2e-test 为租户管理页面写创建流程测试

六步流程

Step 1:模式识别

解析用户参数:

  • SDD 模式:参数是 features/ 开头的路径 → 读取该目录下的 spec.md
  • 自由模式:参数是自由文本描述 → 直接进入 Step 3
Step 2:AC 分析(仅 SDD 模式)

读取 <feature_dir>/spec.md,从 AC 表格中分类:

API 行为类(自动化 pytest 测试):

  • CRUD 操作及响应格式
  • 权限检查(允许/拒绝)
  • 分页、过滤、排序
  • 错误码返回(MMMEE)
  • 跨租户访问拒绝

UI 交互类(手动验证清单):

  • 表单填写、按钮点击
  • 列表展示、搜索过滤
  • 弹窗/抽屉交互
  • 路由跳转
  • 权限控制(按钮隐藏/禁用)

排除:

  • 纯样式/布局调整
  • 纯内部状态逻辑

输出分类后的 AC 列表,作为测试用例依据。

Step 3:基础设施检查

检查共享 helpers 是否存在:

src/backend/test/e2e/
├── conftest.py       # pytest fixtures(认证、client、cleanup)
├── helpers/
│   ├── __init__.py
│   ├── auth.py       # JWT 认证 + 用户创建
│   ├── api.py        # API 常量 + 通用 CRUD helpers
│   └── cleanup.py    # 数据隔离 + 安全 cleanup
└── test_e2e_xxx.py   # 各 Feature 的测试文件

如果不存在,按照 references/test-template.md 创建基础设施。 如果需要新增共享函数,先加到对应的 helpers 文件中。

Step 4:生成测试

基于 references/test-template.md 生成测试文件。

文件命名:src/backend/test/e2e/test_e2e_{feature_name}.py

强制生成规则(12 条):

  1. 数据隔离(红线):测试数据统一 e2e-{feature}- 前缀(≥5 字符)。禁止无条件删除所有资源——cleanup 必须按前缀过滤,只删本套件创建的数据。E2E 运行前后,非测试数据必须保持不变
  2. 双重 cleanup:setup fixture 清理上次残留 + teardown 清理本次数据
  3. 测试租户隔离:使用专用 test_tenant_id,不影响正式租户数据。创建测试数据前先确保测试租户存在
  4. 认证流程:通过 helpers 获取 JWT token,注入到请求 headers。测试管理员和普通用户两种角色
  5. 响应格式断言:所有 API 响应必须断言 UnifiedResponseModel 格式(status_code, status_message, data)
  6. 权限测试配对:每个"允许"操作配对一个"拒绝"测试(不同角色/不同租户)
  7. 共享 helpers:导入 test/e2e/helpers/ 的函数,禁止在测试文件内重新定义通用工具函数
  8. AC 追溯:每个测试方法的 docstring 标注 AC-NN: <描述>
  9. API 验证:数据变更操作后,通过 GET 请求断言最终状态(不仅依赖创建响应)
  10. 错误码精确断言:业务错误断言具体的 MMMEE 错误码,不仅检查非 200
  11. 串行执行:使用 pytest-ordering 或 class 内方法顺序保证 setup → tests → cleanup
  12. 幂等性:测试可重复运行,不依赖特定的数据库状态(除测试自己创建的数据)
Step 5:运行与修复

运行生成的测试:

bash
cd src/backend
.venv/bin/pytest test/e2e/test_e2e_{feature_name}.py -v

如果失败,按照 references/common-pitfalls.md 的诊断表定位问题。

最多 3 轮修复。如果 3 轮后仍有失败,输出剩余问题让用户决定。

调试技巧:

bash
# 单个测试
.venv/bin/pytest test/e2e/test_e2e_{feature}.py::TestE2E{Feature}::test_ac01 -v -s

# 显示完整请求/响应
.venv/bin/pytest test/e2e/test_e2e_{feature}.py -v -s --log-cli-level=DEBUG

# 只运行失败的
.venv/bin/pytest test/e2e/test_e2e_{feature}.py --lf -v
Step 6:覆盖报告

输出 AC 覆盖表:

markdown
# E2E 覆盖报告: <feature_name>

## API 测试结果

| AC-ID | 描述 | 状态 | 测试方法 |
|-------|------|------|---------|
| AC-01 | 创建租户成功 | ✅ 通过 | test_ac01_create_tenant |
| AC-02 | 重复租户名拒绝 | ✅ 通过 | test_ac02_duplicate_name |
| AC-05 | 表单提交创建 | ⏭️ 跳过(UI 交互,见手动清单) | — |

通过: N/M | 跳过: K(UI 交互类)| 失败: J

## 手动验证清单

生成位置: `features/v2.5.0/{NNN}-{name}/e2e-checklist.md`
覆盖 AC: AC-05, AC-06, ...

## 整体状态: PASS / PARTIAL / FAIL

手动验证清单格式

当 AC 涉及 UI 交互时,生成结构化验证清单。

文件位置:features/v2.5.0/{NNN}-{name}/e2e-checklist.md

markdown
# E2E 验证清单: {feature_name}

**测试环境**: http://192.168.106.114:4001 (Platform) / :4001/workspace (Client)
**前置条件**: <描述测试前需要的数据/账号>

## Platform 前端

### AC-05: <描述>
- [ ] 步骤 1: 以管理员登录 Platform (admin/admin123)
- [ ] 步骤 2: 导航到 <页面路径>
- [ ] 步骤 3: 点击 <按钮/元素>
- [ ] 步骤 4: 填写表单: <字段=值>
- [ ] 预期: <具体可观察结果,如 toast 提示、列表刷新>
- [ ] 验证: 刷新页面后数据仍存在

### AC-06: <错误场景描述>
- [ ] 步骤: <触发错误的操作>
- [ ] 预期: <错误提示内容>

## Client 前端(如适用)

### AC-07: <描述>
- [ ] ...

## 回归检查
- [ ] 相关页面(<列出>)正常加载,无 console 错误
- [ ] 既有功能(<列出>)不受影响
- [ ] 不同角色(管理员/普通用户)看到的内容符合权限设定

参考文件

生成测试前必须阅读以下参考文件:

文件用途何时阅读
references/test-template.mdpytest E2E 测试骨架模板生成新测试文件时
references/common-pitfalls.mdBiSheng E2E 常见陷阱诊断表测试失败时

已有共享 Helpers 清单

首次运行时由 Step 3 自动创建。以下是目标结构。

test/e2e/helpers/auth.py
函数签名用途
get_admin_token(client) -> str获取管理员 JWT token
get_user_token(client, username, password) -> str获取指定用户 JWT token
create_test_user(client, admin_token, username, role_id) -> dict创建测试用户
auth_headers(token) -> dict构建认证请求头
test/e2e/helpers/api.py
导出用途
API_BASE后端 API 基础 URL 常量 (http://localhost:7860/api/v1)
assert_resp_200(resp)断言 UnifiedResponseModel 成功响应
assert_resp_error(resp, code)断言 UnifiedResponseModel 错误码
create_resource(client, path, data, token)通用 POST 创建
list_resources(client, path, token, params)通用 GET 列表
delete_resource(client, path, resource_id, token)通用 DELETE
test/e2e/helpers/cleanup.py
函数用途
cleanup_by_prefix(client, path, prefix, token)安全删除指定前缀的资源。前缀必须 ≥5 字符,否则抛错防止误删
ensure_test_tenant(client, admin_token, tenant_code)确保测试租户存在(不存在则创建)

新增 Helper 的规则

当测试需要新的共享函数时:

  1. 认证相关 → 加到 helpers/auth.py
  2. API 请求/断言 → 加到 helpers/api.py
  3. 数据管理/fixtures → 加到 helpers/cleanup.py
  4. 特定 feature 的 helper → 留在测试文件内,不提取

提取标准:2 个以上测试文件使用 → 提取到 helpers。

© dataelement, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .claude/skills/e2e-test of dataelement/bisheng.

  • SKILL.md
  • references/common-pitfalls.md
  • references/test-template.md

Open the folder on GitHubat commit cb9b77a

Compare with similar skills

BiSheng E2E Test Generator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

BiSheng E2E Test Generator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
BiSheng E2E Test Generator this skilldataelement/bisheng12k—~1.4kAutomated safety check: PassApache-2.0
Codexqa Jev Browseropenqa-cn/codexqa152—~1.4kAutomated safety check: NotesMIT
Test Suite Analysisprime-radiant-inc/greenfield292—~3.2kAutomated safety check: PassApache-2.0
Testing Test Strategydzhalaevd/Donatello135—~1.7kAutomated safety check: PassApache-2.0
Specialist Integration Test GeneratorHoangNguyen0403/agent-skills-standard570—~525Automated safety check: PassMIT
Testing Strategy Builderaiskillstore/marketplace430—~3.6kAutomated safety check: PassNone

Similar skills

  • Codexqa Jev Browser

    openqa-cn/codexqa

    Jev browser automation with indexed actions. An agent skill from openqa-cn/codexqa.

    152 GitHub stars~1.4k tokensUpdated 4 days ago
    Testing & QAAuto-check: notes
  • Test Suite Analysis

    prime-radiant-inc/greenfield

    Layer 1 skill for extracting behavioral intelligence from test suites.

    292 GitHub stars~3.2k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • Testing Test Strategy

    dzhalaevd/Donatello

    Use as the lead skill when choosing what backend tests to write, reviewing test plans, or balancing unit, integration, API, concurrency, and E2E coverage

    135 GitHub stars~1.7k tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • Specialist Integration Test Generator

    HoangNguyen0403/agent-skills-standard

    Generates one integration/E2E test from an approved test case spec using existing project patterns.

    570 GitHub stars~525 tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Testing Strategy Builder

    aiskillstore/marketplace

    A skill your agent uses when creating comprehensive testing strategies for applications.

    430 GitHub stars~3.6k tokensUpdated today
    Testing & QAAuto-check passed
  • Writes a Playwright end-to-end test from a prompt, runs it against a live Appsmith deployment and retries with fixes up to three times until it passes.

    41k GitHub stars~2.9k tokensUpdated today
    Testing & QAAuto-check: notes

More from dataelement/bisheng

All 10 skills in this repo
  • BiSheng DOCX Builder

    dataelement/bisheng

    Builds or edits Word .docx documents inside BiSheng's code executor with python-docx, handling Chinese fonts, tables of contents, page numbers and official-document layout.

    12k GitHub stars~2.6k tokensUpdated 7 days ago
    Auto-check passed
  • BiSheng PPTX Builder

    dataelement/bisheng

    Builds PowerPoint decks in BiSheng's code executor with python-pptx, from scratch, from a supplied template or by rewriting an existing file, with Chinese layout rules.

    12k GitHub stars~1.8k tokensUpdated 7 days ago
    Auto-check passed
  • Builds, edits and cleans Excel workbooks inside BiSheng's code executor using openpyxl, with LibreOffice recalculation and a pre-delivery check.

    12k GitHub stars~1.7k tokensUpdated 7 days ago
    Auto-check passed
  • BiSheng SDD Document Review

    dataelement/bisheng

    Reviews BiSheng spec, design and tasks documents with checklists for PRD gaps, handover readiness and acceptance traceability, producing a report or an LGTM.

    12k GitHub stars~717 tokensUpdated 7 days ago
    Auto-check passed
  • Task-Level Code Review

    dataelement/bisheng

    Runs a light convention check on one finished spec-driven task, choosing checks by task type and ending in pass, pass-with-notes or needs-fix.

    12k GitHub stars~652 tokensUpdated 7 days ago
    Auto-check passed
  • Maps BiSheng's approval-center architecture to exact service files and methods, so a change to approval logic can be located without searching the whole repo.

    12k GitHub stars~4k tokensUpdated 7 days ago
    Auto-check passed

Works with

Categories

Questions about BiSheng E2E Test Generator

What does BiSheng E2E Test Generator do?

Generates and runs end-to-end tests for BiSheng, pairing pytest API tests with a manual checklist for UI behavior, from a feature spec or a free description. md and builds coverage from its acceptance criteria, and free mode, which writes tests for a page or feature you describe. Tests are layered, with automated API end-to-end tests in pytest and httpx plus a manual verification checklist for UI behavior.

When should I use BiSheng E2E Test Generator?

BiSheng E2E Test Generator fits situations like: writing end-to-end API tests from a feature's acceptance criteria; adding tests for one BiSheng page or function from a free description; producing a manual verification checklist for UI-heavy acceptance criteria.

How do I install BiSheng E2E Test Generator in Claude Code?

Run `npx skills add dataelement/bisheng --skill e2e-test -a claude-code`. Or copy the skill folder (.claude/skills/e2e-test in dataelement/bisheng) into .claude/skills/e2e-test in your project. Claude Code loads it when a task matches its description.

How do I install BiSheng E2E Test Generator in Codex?

Run `npx skills add dataelement/bisheng --skill e2e-test -a codex`. Or copy the skill folder (.claude/skills/e2e-test in dataelement/bisheng) into .agents/skills/e2e-test in your project. Codex loads it when a task matches its description.

Can I use BiSheng E2E Test Generator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dataelement/bisheng --skill e2e-test -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/e2e-test, .gemini/skills/e2e-test, .github/skills/e2e-test and .opencode/skills/e2e-test in your project.

What does BiSheng E2E Test Generator need to run?

Going by SKILL.md and its folder, BiSheng E2E Test Generator needs the command-line tools its instructions call (pytest). Our summary lists: A BiSheng checkout with the backend test environment under src/backend; pytest and httpx.

Does BiSheng E2E Test Generator access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is BiSheng E2E Test Generator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does BiSheng E2E Test Generator use?

BiSheng E2E Test Generator is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does BiSheng E2E Test Generator use?

About 1.4k tokens (SKILL.md is roughly 5.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.6k tokens, read only when the agent opens those files.

What are the alternatives to BiSheng E2E Test Generator?

Skills that share tags, products or a category with BiSheng E2E Test Generator: Codexqa Jev Browser (openqa-cn/codexqa, 152 stars), Test Suite Analysis (prime-radiant-inc/greenfield, 292 stars), Testing Test Strategy (dzhalaevd/Donatello, 135 stars) and Specialist Integration Test Generator (HoangNguyen0403/agent-skills-standard, 570 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains BiSheng E2E Test Generator?

dataelement (a GitHub organization) maintains it in dataelement/bisheng, which has 12,027 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on September 30, 2026.

Source: dataelement/bisheng on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.