bpmax-cli 0.2.1-beta.10 → 0.2.1-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -161,7 +161,8 @@ bpmax-cli e2e cache refresh --flow-id <flow_id> --profile <profile> --format jso
|
|
|
161
161
|
- `unresolved.P0` 和 `unresolved.P1` 必须都是 `0`。
|
|
162
162
|
- `cases.csv` 字段必须固定为:`case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_result,test_data,roles,evidence_required,tags,status,updated_at`。
|
|
163
163
|
- `config_basis` 必须指向真实存在的配置或能力依据,并说明覆盖原因。配置仓库使用 `think_*`、`.ai_test/`、`.codex/skills/`;`bpmax-cli` 包内能力可引用 `skills/`。
|
|
164
|
-
- 每条正式 E2E 用例的 `prep_data` 必须包含执行前置证据:`precondition_check=`、`browser_tool=`、`live_draft=`、`state_file=` 或 `report_run
|
|
164
|
+
- 每条正式 E2E 用例的 `prep_data` 必须包含执行前置证据:`precondition_check=`、`browser_tool=`、`live_draft=`、`state_file=` 或 `report_run=`,并必须声明 `resume_policy=full_rerun|checkpoint|evidence_only`。默认重新运行使用 `resume_policy=full_rerun`;没有 `precondition_check` 记录时,只能进入准备阶段,不能写正式执行结论。
|
|
165
|
+
- `state_file=` / `report_run=` 不得写死历史 run 或历史日期。正式用例模板应使用 `<run_id>` / `<date>` 占位,执行时再生成本轮独立状态文件和报告目录;历史状态、历史报告、历史截图只能作为“历史对照”,不能作为本轮 pass evidence。
|
|
165
166
|
- 用例内容必须可读,`title`、`preconditions`、`config_basis`、`prep_data`、`steps`、`expected_result`、`test_data` 不得出现乱码、异常编码片段、`???`、`xxx`、`占位`、`待补`、`暂无`、`略` 这类空洞内容;`steps` 必须是可执行步骤,不得是一句泛泛备注。
|
|
166
167
|
- 负向、边界、异常、错误提示、扫码错误 SN 等用例必须在 `expected_result`、`steps` 或 `evidence_required` 中写明 `expected_error_text` 或 `error_capture_required`,并要求真实错误提示截图。没拿到提示文案时,结论写“提示文案未取到”,不要直接判业务失败。
|
|
167
168
|
- 涉及人工介入、手工补救、续跑、`dirty_resumed` 的用例,必须在 `prep_data` 或步骤中声明 `resume_policy=full_rerun|checkpoint|evidence_only`,并说明是从头重跑、检查点重跑还是仅补证据;局部续跑只能给局部结论。
|
|
@@ -195,10 +196,14 @@ bpmax-cli test-suite lint-report --root .ai_test/report
|
|
|
195
196
|
|
|
196
197
|
### 报告完整性门禁
|
|
197
198
|
- 单次执行报告必须位于 `.ai_test/report/<YYYYMMDD-NNN>/`,截图必须位于同一 run 的 `screenshots/` 下;`.codex/docs/` 只放复盘、长周期总结或交付版文档,并引用 `run_id` 和原始报告路径。
|
|
198
|
-
- 场景报告必须写 `planned_cases:`、`executed_cases:`、`precondition_check:`、`state_file:`、`browser_tool:`。`planned_cases` 与 `executed_cases` 必须逐条对账;有未执行用例时只能写阶段/局部结论,不能写完整通过。
|
|
199
|
+
- 场景报告必须写 `planned_cases:`、`executed_cases:`、`precondition_check:`、`state_file:`、`report_run:`、`browser_tool:`、`rerun_policy:`。`planned_cases` 与 `executed_cases` 必须逐条对账;有未执行用例时只能写阶段/局部结论,不能写完整通过。
|
|
199
200
|
- 报告出现 `not run`、`未执行`、`跳过` 时,`result:` 必须降级为 `partial`、`stage`、`blocked` 或明确“阶段/局部/不完整”。没有用户确认缩小范围时,不得把跳过用例合并进完整结论。
|
|
200
201
|
- 没有合规浏览器工具或页面证据时,必须使用浏览器阻塞模板:`browser_status: blocked`,并写“页面结论停止”;不得用 API/readback 证据冒充页面验证。
|
|
201
202
|
- 报告里写“页面通过 / 浏览器回归完成 / 真实页面已验证 / 完整链路通过”时,必须同时有 `browser_tool:` 和本 run 的本地截图证据。
|
|
203
|
+
- 用户明确要求“重新运行测试用例”“全量重跑”“重新回归”时,报告必须写 `rerun_policy: full_rerun`,并逐 case 重新执行。禁止直接查找旧结果、旧报告、旧状态文件或旧截图来填充本轮 `executed_cases`、pass 结论或页面证据。
|
|
204
|
+
- `full_rerun` 报告的 `run_id:` 必须等于当前 `.ai_test/report/<YYYYMMDD-NNN>/` 目录名;`state_file:`、`precondition_check:`、`report_run:` 必须指向本轮 run 或本轮日期;截图文件必须位于本轮 `screenshots/` 且修改时间落在本轮 `started_at` / `finished_at` 时间窗内。
|
|
205
|
+
- `checkpoint` / `evidence_only` 只能给局部或对照结论。若使用历史报告或历史截图,必须标成历史对照,不得声明“完整重新运行通过”。
|
|
206
|
+
- 每个 `executed_cases` 中的通过用例,都必须在结果表、截图 alt/path、项目 ID、step ID 或本轮证据路径中能定位到当前 case;缺少本轮 case evidence 时,不能写 pass。
|
|
202
207
|
|
|
203
208
|
### 测试资产与真实页面回归边界
|
|
204
209
|
- 更新 `.ai_test/suite_draft`、通过 lint、完成 review、promote 到 `.ai_test/suite`,只能证明“测试资产已更新”,不等于已经完成真实页面回归。
|
|
@@ -89,7 +89,7 @@ case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_
|
|
|
89
89
|
|
|
90
90
|
```csv
|
|
91
91
|
case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_result,test_data,roles,evidence_required,tags,status,updated_at
|
|
92
|
-
C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"think_flow/flow_type'flow451422190___key'___status'1___is_del'0/flow 校验主流程节点和审批链; think_data_set/.../data_set 覆盖库存联动落库依据","账号=store_staff,dealer_owner;入口=https://yaditest.yitaiyitai.com/w:store_mgr/project?flow_type=flow451422190;样本=新建换货样本;准备操作=确认旧机SN和新机库存可用并打开创建入口;预期=旧机SN和新机库存可被选择且审批人可达;主数据=旧机SN和新机库存;precondition_check=.codex/tmp/e2e_states/customer-exchange.json;browser_tool=Chrome DevTools;live_draft=live;state_file=.codex/tmp/e2e_states/customer-exchange.json;report_run=.ai_test/report
|
|
92
|
+
C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"think_flow/flow_type'flow451422190___key'___status'1___is_del'0/flow 校验主流程节点和审批链; think_data_set/.../data_set 覆盖库存联动落库依据","账号=store_staff,dealer_owner;入口=https://yaditest.yitaiyitai.com/w:store_mgr/project?flow_type=flow451422190;样本=新建换货样本;准备操作=确认旧机SN和新机库存可用并打开创建入口;预期=旧机SN和新机库存可被选择且审批人可达;主数据=旧机SN和新机库存;precondition_check=.codex/tmp/e2e_states/customer-exchange.json;browser_tool=Chrome DevTools;live_draft=live;state_file=.codex/tmp/e2e_states/customer-exchange.json;report_run=.ai_test/report/<run_id>;resume_policy=full_rerun;login_profile=store_staff,dealer_owner;mock_user=store_staff后切dealer_owner;unmock_done=测试结束恢复管理员",发起换货 > 填写旧机 > 填写新机 > 提交 > 审批通过,旧机入库,新机出库,项目终态正确,"业务场景=客户换货补录;业务逻辑=旧机SN应回收入库且新机库存应出库并进入审批链;样本数据=旧机SN为已售可回收库存,新机SN为当前门店可用库存;合理性=符合客户退换货业务中一退一发和经销商负责人审批逻辑",store_staff,dealer_owner,screenshot+project_detail+每个角色独立截图,"core,inventory,approval",active,2026-06-18
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
## latest gate
|
|
@@ -306,12 +306,16 @@ run_id: 20260618-001
|
|
|
306
306
|
scenario_id: customer-exchange-main-flow
|
|
307
307
|
source_suite: .ai_test/suite/customer-exchange-main-flow
|
|
308
308
|
result: pass
|
|
309
|
+
rerun_policy: full_rerun
|
|
309
310
|
tested_at: 2026-06-18
|
|
311
|
+
started_at: 2026-06-18T10:00:00+08:00
|
|
312
|
+
finished_at: 2026-06-18T11:00:00+08:00
|
|
310
313
|
|
|
311
314
|
planned_cases: C001,C002,C003
|
|
312
315
|
executed_cases: C001,C002,C003
|
|
313
|
-
precondition_check: .codex/tmp/e2e_states/customer-exchange.json
|
|
314
|
-
state_file: .codex/tmp/e2e_states/customer-exchange.json
|
|
316
|
+
precondition_check: .codex/tmp/e2e_states/customer-exchange-20260618.json
|
|
317
|
+
state_file: .codex/tmp/e2e_states/customer-exchange-20260618.json
|
|
318
|
+
report_run: .ai_test/report/20260618-001
|
|
315
319
|
browser_tool: Chrome DevTools
|
|
316
320
|
|
|
317
321
|
## 1. 测试范围
|
|
@@ -348,8 +352,13 @@ bpmax-cli test-suite lint-report --root .ai_test/report
|
|
|
348
352
|
|
|
349
353
|
报告 lint 会硬检查:
|
|
350
354
|
- `planned_cases:` 和 `executed_cases:` 必须存在且逐条对账;planned 中未出现在 executed 的用例必须有 blocked/not run 原因,报告结论降级为阶段/局部。
|
|
351
|
-
- `
|
|
355
|
+
- `run_id:` 必须等于当前 `.ai_test/report/<YYYYMMDD-NNN>/` 目录名。
|
|
356
|
+
- `precondition_check:`、`state_file:`、`report_run:`、`browser_tool:`、`rerun_policy:` 必须存在。
|
|
357
|
+
- `rerun_policy: full_rerun` 表示本轮重新运行,不能直接引用旧结果、旧报告、旧状态文件或旧截图填充本轮 `executed_cases` 和 pass 结论。
|
|
358
|
+
- `full_rerun` 下 `state_file:`、`precondition_check:`、`report_run:` 必须指向本轮 run 或本轮日期;截图必须位于本轮 `screenshots/`,且文件修改时间落在 `started_at:` / `finished_at:` 时间窗内。没有时间窗时按 run 日期校验。
|
|
359
|
+
- 每个 `executed_cases` 里的通过用例都必须有本轮 case evidence:结果表 evidence、截图 alt/path、项目 ID、step ID 或本轮证据路径需能定位该 case。
|
|
352
360
|
- 页面/浏览器结论(页面通过、浏览器回归通过、完整链路通过)必须有 `browser_tool` 证据和截图;接口/回读证据不能冒充页面验证。
|
|
353
361
|
- 出现 `not run` 但 `result: pass` 的报告必须降级为 `partial` 或 `stage`。
|
|
354
362
|
- 浏览器 blocked 报告必须使用 `browser_status: blocked` 模板并停止页面结论。
|
|
363
|
+
- `checkpoint` / `evidence_only` 可以引用历史证据作为对照,但只能写局部/对照结论,不能写完整重新运行通过。
|
|
355
364
|
- 报告中的乱码/空洞步骤会通过用例内容 lint 拦截。
|
|
@@ -156,15 +156,28 @@ bpmax-cli config readback form-template --id <form_template_id> --format json
|
|
|
156
156
|
- 在 `approve_actions` 或 `approve_to_step` 中显式引用 `节点名[condition]i`
|
|
157
157
|
- `condational_nodes[i].result` 维护多目标数组
|
|
158
158
|
- `condational_nodes[i].condition` / `standard_condition` 返回命中的 `result` 下标
|
|
159
|
+
- `condition_mode: "standard"` 时,`condition_result_rules` 只负责编辑器回显和生成脚本;后端仍执行 `standard_condition`,且脚本仍必须返回命中的 `result` 下标
|
|
160
|
+
- 标准条件编辑器字段下拉从关联表单模板 `rule[].field` 取值,`condition_result_rules[].conditions[].leftValue` / 右侧字段值必须写 BPMAX 表单字段值,例如 `main.ygyfhj`;不要写 WEWF 原始字段 key `ygyfhj`,也不要指望 `leftLabel` 能让编辑器回显
|
|
161
|
+
- 从 WEWF 或外部流程迁移条件时,必须先用当前环境 form-template work/readback 把源字段解析到 `rule[].field`,解析不到就阻断标准模式候选或改走 code mode 评审
|
|
159
162
|
- 多动作审批字段必须符合平台解析契约:
|
|
160
163
|
- `approve_actions` / `approve_fail_actions` 的每一项必须是 `按钮文案|目标节点ID`,可带编辑器扩展段,例如 `通过|判定[condition]0|||0`
|
|
161
164
|
- 普通多动作必须写成 `通过|ceo_node_id`、`转物流|logistics_node_id`,不能写裸 `["ceo_node_id", "logistics_node_id"]`
|
|
162
165
|
- 条件分支优先配置 `condational_nodes`,再让 `approve_to_step` 或 `approve_actions` 指向 `条件名[condition]0`
|
|
163
166
|
- 动作目标只能是真实 `data.nodes[].id`、终点如 `-1`、平台特殊目标 `[source]` / `anyNode`,或当前节点已定义的 `condational_nodes[].name + "[condition]0"` 引用
|
|
167
|
+
- 原生 `approve_fail_actions: ["驳回|anyNode|||0"]` 是合法的原生驳回按钮配置,表示运行态点击后弹出历史环节选择器;`anyNode` 是前端选择器标记,不会作为最终流转目标提交给后端。它不等同于插件自由打回配置;插件自由打回应配置 `plugin_rejection_control.reject_to_specific_step = true`。
|
|
164
168
|
- `approve_to_step` / `approve_fail` 直接跳转字段也必须指向同一组合法目标,不能写节点名称、失效 id、数组或对象
|
|
165
169
|
- `condational_nodes` 本身必须是数组;`condational_nodes[]` 每一项都必须是对象,包含非空 `name`、`result`、`condition_mode` 和返回 result 下标的条件脚本;不能写成对象、字符串、裸目标数组或空对象
|
|
166
170
|
- `condition_mode` 为空或 `code` 时必须写非空 `condition`;`condition_mode: "standard"` 时必须写非空 `standard_condition`;两种模式不能混填后指望后端自动兜底
|
|
167
171
|
- `condational_nodes[].result` 必须是非空目标数组,每一项都必须是真实节点 `id`、终点如 `-1` 或 `[source]`;不能把不存在的节点、二级 `[condition]` 引用或 `anyNode` 放进 result。`anyNode` 只能用于按钮目标触发前端选择节点弹窗,后端条件脚本命中 result 时不会打开选择器。
|
|
172
|
+
- 驳回增强 / 自由打回插件必须按 `plugin_rejection_control` 配置,不得把插件需求简化成 `approve_fail = "anyNode"`:
|
|
173
|
+
- 插件字段落在节点上:`node.plugin_rejection_control`。
|
|
174
|
+
- 开启插件必须写 `enabled: true`、非空 `button_text`,且节点必须是审批节点,通常要求 `approve_count_required > 0` 或 `approve_count_required: "all"`。
|
|
175
|
+
- “自由打回到已通过历史环节”对应 `reject_to_specific_step: true`;运行态由插件弹窗选择真实历史环节,再提交真实 `to_flow_step_id`。
|
|
176
|
+
- 可选驳回方式包括 `reject_to_pre`、`reject_to_owner`、`reject_to_specific_step`、`reject_to_end`;启用插件时至少保留一个插件驳回方式,或保留原生 `approve_fail` / `approve_fail_actions` 作为插件弹窗里的基础驳回方式。
|
|
177
|
+
- `reject_to_owner: true` 依赖流程级 `data.meta.allow_jump_start = true`;否则运行态不会提供“驳回申请人修改”选项。若它是唯一可用驳回方式,lint 必须阻断;若同时存在 `reject_to_pre`、`reject_to_specific_step`、`reject_to_end` 或原生驳回目标,保留配置但不要误判整条插件不可用。
|
|
178
|
+
- 可选复核方式包括 `review_default`、`review_to_me`、`review_to_all`、`review_to_any_node`;未配置复核开关时按插件运行态默认顺序回审,不要强行生成静态复核目标。
|
|
179
|
+
- 既有未知扩展字段(例如 `non_rejectable_nodes`)必须原样保留,不得因 lint/build 归一化被删除。
|
|
180
|
+
- 源码依据:插件前端注册 `BPMAX.flow.stepComponent({ field: "plugin_rejection_control" })`;`reject_to_specific_step` 只是在插件运行态临时生成 `targetStep: "anyNode"` 以打开选择器;后端通过 `plugin_rejection_record` 和 `resolve_step_to` hook 改写实际下一跳。
|
|
168
181
|
- 节点级条件路由的反模式包括:
|
|
169
182
|
- 把一个二选一或多选一路由拆成多个并列单目标 `condational_nodes`
|
|
170
183
|
- `condational_nodes` 写成对象,或 `condational_nodes[]` 里混入字符串、数组或空对象,导致平台无法解析条件名、目标数组或脚本
|
|
@@ -714,6 +727,7 @@ bpmax-cli config readback form-template --id <form_template_id> --format json
|
|
|
714
727
|
- 阶段数组与节点 `period` 引用一致
|
|
715
728
|
- `approve_to_step` / `approve_fail` 仍指向存在的节点
|
|
716
729
|
- `approve_actions` / `approve_fail_actions` 每一项都是 `按钮文案|目标`,不能是裸节点 id;目标必须是节点 id、终点、`[source]` / `anyNode` 或条件节点引用
|
|
730
|
+
- 如果启用 `plugin_rejection_control`,确认它配置在审批节点上,`button_text` 非空,至少存在一个可用驳回方式;自由打回应使用 `reject_to_specific_step: true`,不要把插件需求写成 `approve_fail = "anyNode"`;如果唯一驳回方式是 `reject_to_owner`,还必须开启 `data.meta.allow_jump_start`
|
|
717
731
|
- `condational_nodes.result` 目标节点存在
|
|
718
732
|
- `auto_trigger_flows.flows[].flow` 目标流程合法
|
|
719
733
|
- 已有 `plugin_*`、`hook`、`object_events` 未被误清空
|