bpmax-cli 0.2.1-beta.5 → 0.2.1-beta.51
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/README.md +13 -5
- package/dist/bin.js +24980 -12332
- package/dist/bin.js.map +1 -1
- package/package.json +10 -5
- package/scripts/run-source-cli.mjs +121 -0
- package/skills/bpmax-ai-taskbook/SKILL.md +2 -0
- package/skills/bpmax-api-platform-editor/SKILL.md +24 -31
- package/skills/bpmax-api-platform-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-api-platform-editor/references/platform-api-map.md +2 -2
- package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +3 -3
- package/skills/bpmax-approval-matrix/SKILL.md +54 -2
- package/skills/bpmax-blueprint-doc-workflow/SKILL.md +87 -0
- package/skills/bpmax-blueprint-doc-workflow/agents/openai.yaml +4 -0
- package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +60 -0
- package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +98 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-forbidden-term.xml +12 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-mermaid-codeblock.xml +12 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-boundary.xml +10 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-whiteboard.xml +10 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +55 -0
- package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +257 -0
- package/skills/bpmax-bug-reporting/SKILL.md +72 -0
- package/skills/bpmax-builder-shared/SKILL.md +1 -0
- package/skills/bpmax-builder-shared/configuration-impact-review.md +76 -0
- package/skills/bpmax-builder-shared/template_script_hard_rules.py +3 -1
- package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +16 -0
- package/skills/bpmax-cli/SKILL.md +43 -0
- package/skills/bpmax-config-latest/SKILL.md +4 -0
- package/skills/bpmax-console-template-editor/SKILL.md +112 -523
- package/skills/bpmax-console-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-console-template-editor/references/full-detail-guide.md +45 -0
- package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +13 -12
- package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +299 -78
- package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +344 -30
- package/skills/bpmax-dataset-field-template-editor/SKILL.md +127 -594
- package/skills/bpmax-dataset-field-template-editor/references/full-detail-guide.md +570 -0
- package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +1 -1
- package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +11 -77
- package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +4 -57
- package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +2 -0
- package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +4 -78
- package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +3 -89
- package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +14 -0
- package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +2 -0
- package/skills/bpmax-dataset-template-editor/SKILL.md +116 -778
- package/skills/bpmax-dataset-template-editor/references/full-detail-guide.md +753 -0
- package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +1 -0
- package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +2 -2
- package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +9 -90
- package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +1 -2
- package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +8 -1
- package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +6 -40
- package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +18 -4
- package/skills/bpmax-e2e-flow-config-orchestrator/agents/openai.yaml +2 -2
- package/skills/bpmax-e2e-flow-config-orchestrator/references/orchestration-matrix.md +13 -9
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +151 -546
- package/skills/bpmax-e2e-flow-test-operator/agents/openai.yaml +2 -3
- package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +137 -14
- package/skills/bpmax-e2e-flow-test-operator/references/browser-action-dsl.md +87 -0
- package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +12 -5
- package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +577 -0
- package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +2 -0
- package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +4 -4
- package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +1 -1
- package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +3 -1
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +7 -5
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +2 -2
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +5 -1
- package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +71 -0
- package/skills/bpmax-filter-template-editor/SKILL.md +114 -551
- package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +18 -18
- package/skills/bpmax-filter-template-editor/references/filter-content-schema.md +21 -0
- package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +29 -26
- package/skills/bpmax-filter-template-editor/references/filter-runtime-patterns.md +19 -2
- package/skills/bpmax-filter-template-editor/references/full-detail-guide.md +56 -0
- package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +10 -9
- package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +7 -57
- package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +4 -48
- package/skills/bpmax-flow/SKILL.md +2 -0
- package/skills/bpmax-flow-detail-template-editor/SKILL.md +53 -0
- package/skills/bpmax-flow-template-editor/SKILL.md +120 -1084
- package/skills/bpmax-flow-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-flow-template-editor/references/diff-strategy.md +3 -3
- package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +9 -9
- package/skills/bpmax-flow-template-editor/references/flow-template-api-workflow.md +2 -1
- package/skills/bpmax-flow-template-editor/references/full-detail-guide.md +1157 -0
- package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +1 -1
- package/skills/bpmax-flow-template-editor/references/project-create-runtime-gotchas.md +17 -0
- package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +8 -3
- package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +7 -7
- package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +2 -2
- package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +8 -2
- package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +7 -23
- package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +1 -1
- package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +19 -75
- package/skills/bpmax-form-template-editor/SKILL.md +133 -1104
- package/skills/bpmax-form-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-form-template-editor/references/dynamic-field-state.md +167 -0
- package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +51 -51
- package/skills/bpmax-form-template-editor/references/full-detail-guide.md +1115 -0
- package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +4 -4
- package/skills/bpmax-form-template-editor/references/payload-checklist.md +3 -1
- package/skills/bpmax-form-template-editor/references/sub-form-patterns.md +6 -0
- package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +8 -0
- package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +42 -19
- package/skills/bpmax-functional-test-design/LICENSE.upstream +24 -0
- package/skills/bpmax-functional-test-design/SKILL.md +80 -0
- package/skills/bpmax-functional-test-design/agents/openai.yaml +4 -0
- package/skills/bpmax-functional-test-design/references/bpmax-test-suite-output.md +95 -0
- package/skills/bpmax-functional-test-design/references/decision-table-testing.md +50 -0
- package/skills/bpmax-functional-test-design/references/domain-testing.md +43 -0
- package/skills/bpmax-functional-test-design/references/state-transition-testing.md +47 -0
- package/skills/bpmax-functional-test-design/references/technique-selection.md +38 -0
- package/skills/bpmax-functional-test-design/references/use-case-testing.md +55 -0
- package/skills/bpmax-group-model-editor/SKILL.md +24 -0
- package/skills/bpmax-list-template-editor/SKILL.md +119 -466
- package/skills/bpmax-list-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-list-template-editor/references/content-config-shape.md +16 -4
- package/skills/bpmax-list-template-editor/references/full-detail-guide.md +458 -0
- package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +6 -9
- package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +1 -1
- package/skills/bpmax-list-template-editor/references/special-formats.md +5 -2
- package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +9 -78
- package/skills/bpmax-memory-protocol/SKILL.md +7 -6
- package/skills/bpmax-nav-config-editor/SKILL.md +13 -17
- package/skills/bpmax-nav-config-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-nav-config-editor/references/api-workflow.md +2 -2
- package/skills/bpmax-nav-config-editor/references/runtime-probing.md +11 -12
- package/skills/bpmax-plugin-config/SKILL.md +20 -4
- package/skills/bpmax-project/SKILL.md +37 -1
- package/skills/bpmax-project-detail-template-editor/SKILL.md +13 -39
- package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-role-editor/SKILL.md +7 -30
- package/skills/bpmax-shared/SKILL.md +19 -9
- package/skills/bpmax-team-editor/SKILL.md +27 -0
- package/skills/bpmax-ui-ux-audit/LICENSE.upstream +23 -0
- package/skills/bpmax-ui-ux-audit/SKILL.md +42 -0
- package/skills/bpmax-ui-ux-audit/agents/openai.yaml +4 -0
- package/skills/bpmax-ui-ux-audit/references/audit-framework.md +39 -0
- package/skills/bpmax-ui-ux-audit/references/bpmax-ux-findings.md +56 -0
- package/skills/bpmax-user/SKILL.md +33 -1
- package/skills/bpmax-user-mock-operator/SKILL.md +20 -48
- package/skills/bpmax-user-mock-operator/agents/openai.yaml +2 -2
- package/skills/bpmax-user-model-editor/SKILL.md +24 -0
- package/skills/form-control-library/references/form-template-submit-schema.md +1 -1
- package/skills/bpmax-user-mock-operator/scripts/switch_user_identity.py +0 -37
- package/skills/bpmax-user-mock-operator/scripts/user_mock_operator_common.py +0 -136
- package/skills/bpmax-user-mock-operator/tests/test_user_mock_operator.py +0 -138
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "BPMAX E2E Flow Test Operator"
|
|
3
|
-
short_description: "
|
|
4
|
-
default_prompt: "使用 $bpmax-e2e-flow-test-operator 对当前 BPMAX
|
|
5
|
-
|
|
3
|
+
short_description: "用功能设计与 UX BUG 审计完成 BPMAX E2E 回归"
|
|
4
|
+
default_prompt: "使用 $bpmax-e2e-flow-test-operator 对当前 BPMAX 流程做全链路测试,强制结合 bpmax-functional-test-design 和 bpmax-ui-ux-audit,并以 lint-report 收口。"
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
<scenario_id>/
|
|
9
9
|
README.md
|
|
10
10
|
cases.csv
|
|
11
|
+
case_steps.csv
|
|
11
12
|
review.json
|
|
12
13
|
.copy_diff/
|
|
13
14
|
last.diff
|
|
@@ -24,11 +25,24 @@
|
|
|
24
25
|
<YYYYMMDD-NNN>/
|
|
25
26
|
summary.md
|
|
26
27
|
<scenario_id>.md
|
|
28
|
+
ux-findings.json
|
|
27
29
|
screenshots/
|
|
28
30
|
```
|
|
29
31
|
|
|
30
32
|
`suite` 是正式用例库,`suite_draft` 是 AI 生成或更新后的待确认草稿,`report` 是每次运行的证据目录。
|
|
31
33
|
|
|
34
|
+
正式用例设计必须使用 `bpmax-functional-test-design`;本轮页面体验审计必须使用 `bpmax-ui-ux-audit`。场景报告必须包含:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
test_design_skill: bpmax-functional-test-design
|
|
38
|
+
ux_audit_skill: bpmax-ui-ux-audit
|
|
39
|
+
ux_audit_status: completed|blocked
|
|
40
|
+
ux_findings: ux-findings.json
|
|
41
|
+
ux_bug_counts: P0=<n>,P1=<n>,P2=<n>,P3=<n>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
所有确认的体验问题都是 `classification: "BUG"`。`ux-findings.json` 的 run/scenario 必须匹配当前报告,每个 BUG 必须有严重度、影响、复现步骤、启发式引用、本轮证据、整改建议和 `open|fixed|verified` 状态。证据必须由当前 execution manifest 登记或引用;`verified` 还必须提供不同且更晚的 `retest_evidence`。`ux_bug_counts` 只统计未解决的 `open|fixed` BUG:P0/P1 要求 `fail`;仅 P2/P3 时为 `pass-with-warnings`;无未解决 BUG 才允许 `pass`;审计 blocked 时只能 `partial|blocked`。
|
|
45
|
+
|
|
32
46
|
`.copy_diff/` 是覆盖同名场景目录时自动生成的覆盖审计证据,只在 `draft-update --replace` 或 `promote --replace` 的目标目录已存在时出现。
|
|
33
47
|
|
|
34
48
|
## README 模板
|
|
@@ -61,10 +75,10 @@ owner_skill: bpmax-e2e-flow-test-operator
|
|
|
61
75
|
|
|
62
76
|
## cases.csv 字段
|
|
63
77
|
|
|
64
|
-
|
|
78
|
+
`cases.csv` 只保存用例级元数据,字段必须完全一致:
|
|
65
79
|
|
|
66
80
|
```csv
|
|
67
|
-
case_id,priority,type,title,preconditions,config_basis,prep_data,
|
|
81
|
+
case_id,priority,type,title,preconditions,config_basis,prep_data,expected_result,test_data,roles,evidence_required,tags,status,updated_at
|
|
68
82
|
```
|
|
69
83
|
|
|
70
84
|
字段说明:
|
|
@@ -76,7 +90,6 @@ case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_
|
|
|
76
90
|
- `preconditions`:前置数据和环境。
|
|
77
91
|
- `config_basis`:每条用例依据的配置位置和覆盖原因,必须至少包含一个可定位位置,例如 `think_flow/...`、`think_form_template/...`、`think_data_set/...`、`think_data_set_field/...`、`think_flow_page_template/...`、`think_configuration/...`、`think_role/...`、`think_category/...`、`think_api_platform/...`、`think_api_proxy/...`、`think_workspace/...`、`.ai_test/...`、`skills/...` 或 `.codex/skills/...`,并说明为什么这条用例要覆盖该配置点。
|
|
78
92
|
- `prep_data`:结构化前置数据准备,至少包含 `账号=`、`入口=`、`样本=`、`准备操作=`、`预期=`、`precondition_check=`、`browser_tool=`、`live_draft=`,并提供 `state_file=` 或 `report_run=`。
|
|
79
|
-
- `steps`:可读步骤,用 ` > ` 分隔。
|
|
80
93
|
- `expected_result`:明确可判定结果。
|
|
81
94
|
- `test_data`:客户真实业务测试数据说明,不写 token、cookie、手机号、密码或完整 payload。必须使用英文分号分隔的 `key=value`,至少包含 `业务场景=`、`业务逻辑=`、`样本数据=`、`合理性=`。
|
|
82
95
|
- `roles`:涉及角色,用逗号分隔。
|
|
@@ -85,11 +98,90 @@ case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_
|
|
|
85
98
|
- `status`:`active`、`deprecated`、`draft`。
|
|
86
99
|
- `updated_at`:`YYYY-MM-DD`。
|
|
87
100
|
|
|
88
|
-
|
|
101
|
+
`case_steps.csv` 每行只能描述一个测试步骤:
|
|
102
|
+
|
|
103
|
+
```csv
|
|
104
|
+
case_id,step_id,step_no,actor,runner,action,target,input_data,expected_result,evidence_required
|
|
105
|
+
C001,S001,1,store_staff,browser,打开客户换货创建页面,客户换货创建页,无,页面展示换货表单,screenshot+url+dom
|
|
106
|
+
C001,S002,2,store_staff,browser,填写客户换货字段,换货表单旧机和新机字段,真实旧机SN和新机SN,页面显示真实业务数据,screenshot+dom
|
|
107
|
+
C001,S003,3,store_staff,e2e_create_page,点击提交客户换货申请,创建页提交按钮,无,项目创建成功并进入审批链,screenshot+project_detail
|
|
108
|
+
C001,S004,4,store_staff,identity,切换测试身份,当前浏览器会话,目标用户ID,会话切换为目标审批人,identity+mock+readback
|
|
109
|
+
C001,S005,5,dealer_owner,e2e_step_run,审批通过客户换货申请,经销商负责人审批环节,审批意见为同意,审批完成并进入终态,step_context+submit+readback
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
规则:
|
|
113
|
+
|
|
114
|
+
- `runner` 只能是 `browser`、`identity`、`e2e_create_page`、`e2e_step_run`、`observe`;身份 mock/status/unmock 必须使用 `identity`,不得声明为 `e2e_step_run`。
|
|
115
|
+
- `step_no` 从 1 开始连续递增;`step_id` 在 case 内唯一。
|
|
116
|
+
- `actor` 必须属于 cases.csv 的 roles,系统观察步骤可写 `system`。
|
|
117
|
+
- `action` 一行只能有一个动作,禁止 `>`、连续编号和“然后/接着/再然后”;上传附件是合法单一步骤,必须写清具体附件和目标控件。
|
|
118
|
+
- `target`、`input_data`、即时 `expected_result`、`evidence_required` 都必须明确;无输入写“无”。
|
|
119
|
+
|
|
120
|
+
旧聚合格式使用以下命令迁移到 draft,生成的 `REVIEW_REQUIRED` 字段必须逐行补齐:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
bpmax-cli test-suite steps migrate --scenario <scenario_id> --draft-root .ai_test/suite_draft --latest-proof <proof.json> --format json
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
正式执行必须先启动 execution manifest:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
bpmax-cli test-suite run start --scenario <scenario_id> --case-id <case_id> --profile <profile> --latest-proof <proof.json> --format json
|
|
130
|
+
bpmax-cli test-suite run next --manifest .ai_test/report/<run_id>/execution-manifest.json --format json
|
|
131
|
+
bpmax-cli test-suite run record --manifest .ai_test/report/<run_id>/execution-manifest.json --case-id <case_id> --case-step-id <step_id> --result pass --evidence <path> --format json
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
稳定浏览器步骤使用 `runner=browser_action`,并在场景目录维护 `automation.json`。正式执行由 `bpmax-cli e2e browser-run` 读取 manifest 当前步骤并自动写入本轮证据;已完成 manifest 不允许 resume,重新运行必须 `run start` 新建 run。
|
|
135
|
+
|
|
136
|
+
完整 DSL、页面指纹、mutation 和缓存边界见 [browser-action-dsl.md](browser-action-dsl.md)。
|
|
137
|
+
|
|
138
|
+
源码 CLI 联调时显式增加:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
--source-skill <bpmax-cli-repo>/skills/bpmax-e2e-flow-test-operator/SKILL.md
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
不传该参数时,`run start` 会硬检查已安装 skill stamp 必须与当前 CLI 版本一致;出现 `test_suite.run.skills_out_of_sync` 时先执行 `bpmax-cli update`,不得混用旧 skill。
|
|
145
|
+
|
|
146
|
+
正式 `bpmax-cli e2e` 命令必须带 manifest/case/step;只有排障可显式使用 `--diagnostic`,且不能形成通过结论。
|
|
147
|
+
|
|
148
|
+
正式 browser step 的证据 JSON 最小结构:
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"case_id": "C001",
|
|
153
|
+
"case_step_id": "S001",
|
|
154
|
+
"browser_verified": true,
|
|
155
|
+
"runtime_scope": "page",
|
|
156
|
+
"runtime_environment": "profile",
|
|
157
|
+
"runtime_url": "https://example.com/w:workspace/project/123",
|
|
158
|
+
"screenshot": "../../screenshots/C001-S001.png",
|
|
159
|
+
"assertions": [{ "name": "page_loaded", "passed": true }],
|
|
160
|
+
"dom_snapshot": "dom.txt"
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
证据必须位于本轮 report 目录。仅写 `browser_verified: true`、引用历史截图、复用前一步相同截图、断言为空/失败,或在要求 DOM 时缺少 `dom_snapshot`,都不能记录为 pass。
|
|
165
|
+
|
|
166
|
+
`runtime_scope` 规则:`page` 证明首页、列表、搜索等页面,不要求项目 ID;`project` 必须提供数字 `project_id`;`step` 必须同时提供数字 `project_id` 和业务 `step_id`。禁止用 `case_steps.csv.step_no` 填业务 `step_id`。
|
|
167
|
+
|
|
168
|
+
`runtime_environment=profile` 时,`runtime_url` origin 必须与 run start 固化的 `profile_origin` 一致。源码本地浏览器测试使用 `runtime_environment=local-browser`,并且只允许 loopback URL。manifest 只能由 CLI record/append 更新;禁止手工回滚,禁止多个 agent 同时写同一 manifest。
|
|
169
|
+
|
|
170
|
+
最后一步 record 后 CLI 会从 manifest 自动同步 `<scenario_id>.md`。需要重试时使用:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
bpmax-cli test-suite run report-sync --manifest .ai_test/report/<run_id>/execution-manifest.json --format json
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
`execution_plan_generated`、`browser_execution_pending`、`bootstrap_required` 表示尚未形成正式执行证据;只有真实提交或正式记录后才能出现 `execution_evidence_recorded`。不得依据 plan/template/dry-run 状态推进用例结论。
|
|
177
|
+
|
|
178
|
+
报告同步只更新执行状态,不会替代理解页面并完成 UX 审计。必须人工/agent 基于本轮证据更新 `ux-findings.json` 和场景报告,然后运行 `bpmax-cli test-suite lint-report`。
|
|
179
|
+
|
|
180
|
+
旧版聚合示例已废弃;以下是用例级示例:
|
|
89
181
|
|
|
90
182
|
```csv
|
|
91
|
-
case_id,priority,type,title,preconditions,config_basis,prep_data,
|
|
92
|
-
C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"think_flow
|
|
183
|
+
case_id,priority,type,title,preconditions,config_basis,prep_data,expected_result,test_data,roles,evidence_required,tags,status,updated_at
|
|
184
|
+
C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"think_flow/.../flow 校验主流程节点和审批链; think_data_set/.../data_set 覆盖库存联动落库依据","账号=store_staff,dealer_owner;入口=https://yaditest.yitaiyitai.com/w:store_mgr/project?flow_type=flow451422190;样本=新建换货样本;准备操作=确认真实库存;预期=审批链可达;precondition_check=.codex/tmp/e2e_states/customer-exchange.json;browser_tool=Chrome Control;live_draft=live;state_file=.codex/tmp/e2e_states/customer-exchange.json;report_run=.ai_test/report/<run_id>;resume_policy=full_rerun",旧机入库且新机出库并完成审批,"业务场景=客户换货补录;业务逻辑=旧机回收入库且新机出库;样本数据=真实旧机和新机库存;合理性=符合客户一退一发规则","store_staff,dealer_owner",screenshot+project_detail,"core,inventory,approval",active,2026-06-18
|
|
93
185
|
```
|
|
94
186
|
|
|
95
187
|
## latest gate
|
|
@@ -97,10 +189,21 @@ C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"t
|
|
|
97
189
|
- 生成、检查、更新 `.ai_test` 用例前,都必须先调用当前仓库对应的 `latest-*` 更新方法,并带 `ALLOW_DIRTY=1`。
|
|
98
190
|
- 使用当前环境对应的 latest sync 能力;脚本等价命令必须显式设置 `ALLOW_DIRTY=1` 或对应的安全允许脏工作区参数。
|
|
99
191
|
- latest 后记录:命令、`ALLOW_DIRTY=1`、更新前后 `git rev-parse HEAD`、`git status --short` 摘要。
|
|
100
|
-
- latest 后必须写 `.codex/tmp/ai_test_suite/latest-<
|
|
192
|
+
- latest 后必须写 `.codex/tmp/ai_test_suite/latest-<env>-proof.json`,至少包含 `method`、`allow_dirty`、`before`、`after`、`head`、`status_short`。
|
|
101
193
|
- `bpmax-cli test-suite lint/index/draft-update/promote` 必须传 `--latest-proof <path>`;缺失或 proof 不合格时命令拒绝执行。
|
|
102
194
|
- latest 失败或远端基线无法确认时,不得继续生成、检查、更新或 promote 用例。
|
|
103
195
|
|
|
196
|
+
## 单流程隔离门禁
|
|
197
|
+
|
|
198
|
+
- 共享 `.ai_test/suite` 可以保存多个流程的场景,但批量迁移、修复和晋级必须以单个 `flow_type` 为失败域。
|
|
199
|
+
- 迁移器必须显式保存当前流程的 `scenario_ids`。不要通过扫描并验证整个 suite 来反推当前流程范围,因为其他流程的损坏 README、case 或 step 会造成无关阻断。
|
|
200
|
+
- 单流程 lint 使用可重复的 `--scenario`:`bpmax-cli test-suite lint --root .ai_test/suite_draft --scenario <main_scenario> --scenario <return_scenario> --latest-proof <proof.json> --format json`。
|
|
201
|
+
- scoped lint 的 JSON 必须是 `scope=selected_scenarios`,并核对 `selected_scenarios`、`ignored_scenario_count` 和 `flow_types`。该结果只代表所选场景,不代表全仓 suite。
|
|
202
|
+
- `e2e_acceleration.missing_cases` 也必须只包含所选场景;其他流程缺少 reusable evidence 时不得污染当前流程。
|
|
203
|
+
- review 始终逐场景完成。一个流程有多个场景时,全部 review 的 `unresolved.P0/P1` 都清零后,才允许在一次 promote 中重复传入这些 `--scenario`。
|
|
204
|
+
- 单次多场景 promote 只允许一个 `flow_type`。CLI 必须先验证全部场景及 review,再复制任何场景;其中一个失败时,本流程不得部分晋级。其他流程使用另一个独立 promote 批次。
|
|
205
|
+
- 省略 `--scenario` 的 lint 保留给全仓测试资产治理,不应用作单流程迁移的默认门禁。
|
|
206
|
+
|
|
104
207
|
## 配置依据规则
|
|
105
208
|
|
|
106
209
|
- 每条用例都必须填写 `config_basis`。
|
|
@@ -123,7 +226,7 @@ C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"t
|
|
|
123
226
|
- `prep_data` 是执行前必须先完成的准备清单,不是备注。
|
|
124
227
|
- 最少写明 `账号=`、`入口=`、`样本=`、`准备操作=`、`预期=`、`precondition_check=`、`browser_tool=`、`live_draft=`,并提供 `state_file=` 或 `report_run=`。
|
|
125
228
|
- `precondition_check=` 必须指向本轮执行前置检查记录;没有该记录时只能进入准备阶段,不能写正式执行结论。
|
|
126
|
-
- `browser_tool=`
|
|
229
|
+
- `browser_tool=` 必须写明本轮实际执行的真实页面通道,只允许 `Chrome Control`、`chrome:control-chrome`、`Chrome DevTools`、`DevTools`、`Playwright` 或 `AppleScript`。首次录制和异常探索优先 `Chrome Control`,稳定 `browser_action` 复跑使用 `Playwright`;如果没有可用浏览器工具,报告必须走 browser blocked 模板,不能在工具名后写 unavailable 仍声明通过。
|
|
127
230
|
- `live_draft=` 必须写清本轮测的是 `live` 发布态还是 `draft` 草稿态。
|
|
128
231
|
- `state_file=` 或 `report_run=` 必须能定位本轮状态/报告证据。
|
|
129
232
|
- `准备操作=` 必须写正式执行步骤前要做的具体动作,例如打开入口、创建或搜索样本、确认主数据、确认权限、确认自动化发布状态。
|
|
@@ -306,13 +409,25 @@ run_id: 20260618-001
|
|
|
306
409
|
scenario_id: customer-exchange-main-flow
|
|
307
410
|
source_suite: .ai_test/suite/customer-exchange-main-flow
|
|
308
411
|
result: pass
|
|
412
|
+
rerun_policy: full_rerun
|
|
309
413
|
tested_at: 2026-06-18
|
|
414
|
+
started_at: 2026-06-18T10:00:00+08:00
|
|
415
|
+
finished_at: 2026-06-18T11:00:00+08:00
|
|
310
416
|
|
|
311
417
|
planned_cases: C001,C002,C003
|
|
312
418
|
executed_cases: C001,C002,C003
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
419
|
+
planned_steps: C001/S001,C001/S002,C002/S001,C003/S001
|
|
420
|
+
executed_steps: C001/S001,C001/S002,C002/S001,C003/S001
|
|
421
|
+
execution_manifest: execution-manifest.json
|
|
422
|
+
precondition_check: .codex/tmp/e2e_states/customer-exchange-20260618.json
|
|
423
|
+
state_file: .codex/tmp/e2e_states/customer-exchange-20260618.json
|
|
424
|
+
report_run: .ai_test/report/20260618-001
|
|
425
|
+
browser_tool: Chrome Control
|
|
426
|
+
runtime_url: https://yaditest.yitaiyitai.com/w:store_mgr/project_detail/0/<project_id>
|
|
427
|
+
runtime_user: store_staff
|
|
428
|
+
browser_action_log: C001 打开创建页 -> 填写真实业务字段 -> 点击提交 -> 打开详情页
|
|
429
|
+
visible_assertions: C001 页面显示客户换货主链路、当前环节和提交成功结果
|
|
430
|
+
project_id: <project_id>
|
|
316
431
|
|
|
317
432
|
## 1. 测试范围
|
|
318
433
|
|
|
@@ -347,9 +462,17 @@ bpmax-cli test-suite lint-report --root .ai_test/report
|
|
|
347
462
|
```
|
|
348
463
|
|
|
349
464
|
报告 lint 会硬检查:
|
|
350
|
-
- `planned_cases:`
|
|
351
|
-
- `
|
|
352
|
-
-
|
|
465
|
+
- `planned_cases:` / `executed_cases:` 与 `planned_steps:` / `executed_steps:` 必须存在并逐条对账;`execution_manifest:` 必须指向本轮报告目录中的 manifest。任何未登记步骤、跳步或缺证据步骤都会阻断完整通过。
|
|
466
|
+
- `run_id:` 必须等于当前 `.ai_test/report/<YYYYMMDD-NNN>/` 目录名。
|
|
467
|
+
- `precondition_check:`、`state_file:`、`report_run:`、`browser_tool:`、`rerun_policy:` 必须存在。
|
|
468
|
+
- `rerun_policy: full_rerun` 表示本轮重新运行,不能直接引用旧结果、旧报告、旧状态文件或旧截图填充本轮 `executed_cases` 和 pass 结论。
|
|
469
|
+
- `full_rerun` 下 `state_file:`、`precondition_check:`、`report_run:` 必须指向本轮 run 或本轮日期;截图必须位于本轮 `screenshots/`,且文件修改时间落在 `started_at:` / `finished_at:` 时间窗内。没有时间窗时按 run 日期校验。
|
|
470
|
+
- 每个 `executed_cases` 里的通过用例都必须有本轮 case evidence:结果表 evidence、截图 alt/path、项目 ID、step ID 或本轮证据路径需能定位该 case。
|
|
471
|
+
- 页面/浏览器结论(页面通过、浏览器回归通过、完整链路通过)必须有 `browser_tool`、本轮截图和结构化运行态证据:`runtime_url:`、`runtime_user:` 或 `runtime_profile:`、`browser_action_log:`、`visible_assertions:`、`project_id:` 或 `step_id:`。
|
|
472
|
+
- `result:` 使用受支持枚举:`pass` / `pass-with-warnings`、`partial` / `stage` / `blocked` / `diagnostic`、`fail`;不得使用 `all_green` 等未定义同义词。完整通过时 `runtime_url:` 必须是 BPMAX 页面路由且与声明的 project/step id 对齐,动作与断言不得是 TODO、接口回读或 JSON 响应占位文本。
|
|
473
|
+
- 截图必须是本轮生成、可解析且至少 100x80 的 PNG;文本改后缀、损坏图片和空白占位文件不算页面证据。
|
|
474
|
+
- 接口回读、缓存命中、状态矩阵只能作为辅助证据;如果报告用这些作为通过依据却缺少真实浏览器动作日志和可见断言,只能写 `diagnostic` / `partial`,不能写完整通过。
|
|
353
475
|
- 出现 `not run` 但 `result: pass` 的报告必须降级为 `partial` 或 `stage`。
|
|
354
476
|
- 浏览器 blocked 报告必须使用 `browser_status: blocked` 模板并停止页面结论。
|
|
477
|
+
- `checkpoint` / `evidence_only` 可以引用历史证据作为对照,但只能写局部/对照结论,不能写完整重新运行通过。
|
|
355
478
|
- 报告中的乱码/空洞步骤会通过用例内容 lint 拦截。
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Browser Action Runner V2
|
|
2
|
+
|
|
3
|
+
## 目标
|
|
4
|
+
|
|
5
|
+
Browser Action Runner V2 把稳定、重复的真实页面步骤变成可审计代码。`case_steps.csv` 仍描述业务动作,`automation.json` 描述完成该业务动作所需的技术原子动作。
|
|
6
|
+
|
|
7
|
+
正常复跑不再由 Agent 临场逐字段点击。首次 bootstrap、页面指纹变化、未支持控件或执行失败时,优先使用 `chrome:control-chrome` 复用当前 Chrome 完成探索、操作、取证和重新录制。
|
|
8
|
+
|
|
9
|
+
## 场景文件
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"version": 1,
|
|
14
|
+
"scenario": "procurement-main",
|
|
15
|
+
"steps": {
|
|
16
|
+
"C001/S001": {
|
|
17
|
+
"runner": "browser_action",
|
|
18
|
+
"page_fingerprint": {
|
|
19
|
+
"route": "/project/create",
|
|
20
|
+
"fields": ["subject", "amount"],
|
|
21
|
+
"buttons": ["提交"]
|
|
22
|
+
},
|
|
23
|
+
"actions": [
|
|
24
|
+
{
|
|
25
|
+
"type": "navigation.open",
|
|
26
|
+
"route": "/w:new_oa/project/create?flow_type={{data.flow_type}}"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "form.set_value",
|
|
30
|
+
"target": { "field": "subject" },
|
|
31
|
+
"value": "{{data.subject}}"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "button.click",
|
|
35
|
+
"target": { "role": "button", "name": "提交" },
|
|
36
|
+
"mutation": true,
|
|
37
|
+
"retry": "never"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"expected_checks": [
|
|
41
|
+
{ "type": "wait.route", "route": "/projectContinue" },
|
|
42
|
+
{ "type": "page.assert_step", "expected": "部门审批" }
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 支持动作
|
|
50
|
+
|
|
51
|
+
- 页面与等待:`navigation.open`、`wait.visible`、`wait.network`、`wait.route`。
|
|
52
|
+
- 主表单:`form.set_value`、`form.select_option`、`form.assert_value`。
|
|
53
|
+
- 明细表:`detail.add_row`、`detail.set_value`、`detail.assert_rows`。
|
|
54
|
+
- 命令动作:`button.click`、`dialog.confirm`。
|
|
55
|
+
- 上下文与断言:`context.extract`、`page.assert_step`、`list.assert_record`、`evidence.capture`。
|
|
56
|
+
|
|
57
|
+
一个 `case_steps.csv` 行只能描述一个业务动作,但该动作可以包含多个技术原子动作。
|
|
58
|
+
|
|
59
|
+
## 定位规则
|
|
60
|
+
|
|
61
|
+
优先使用 `field`、`label`、`role + name`、`text`、`test_id`。CSS 只允许稳定 id、`name`、`aria-label` 或 `data-*` 属性。
|
|
62
|
+
|
|
63
|
+
禁止坐标、绝对 XPath、依赖 DOM 层级的长 CSS,以及写死本轮 `project_id`、`step_id`、流水号或 trace id。
|
|
64
|
+
|
|
65
|
+
## mutation 与重试
|
|
66
|
+
|
|
67
|
+
所有 `button.click` 必须声明 `mutation=true|false`。会远端提交的点击和确认动作必须使用:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{ "mutation": true, "retry": "never" }
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
CLI 在 mutation 前验证页面指纹。mutation 发出后即使页面等待超时,也按“可能已经提交”处理,停止盲目重试并保留证据。
|
|
74
|
+
|
|
75
|
+
## 运行与重跑
|
|
76
|
+
|
|
77
|
+
正式运行先创建新的 test-suite run,再执行 `browser-run` 或 `scenario execute`。`--resume` 只继续同一个未完成 run;已完成 run 必须新建,历史 pass 不得让本轮 case 被跳过。
|
|
78
|
+
|
|
79
|
+
每轮重新解析动态 ID,并生成新的截图、DOM、Console/Network、动作 trace 和 manifest 记录。缓存只包含动作和页面语义。
|
|
80
|
+
|
|
81
|
+
## 首次录制
|
|
82
|
+
|
|
83
|
+
首次录制必须先使用 `chrome:control-chrome`,复用当前 Chrome 标签页和登录态执行真实用户动作。不要默认启动独立 Playwright 或 Chrome DevTools 来探索页面;只有 Chrome Control 不可用或按其排障流程处理后仍失败时才降级 Chrome DevTools。
|
|
84
|
+
|
|
85
|
+
首次页面操作后保存 `browser-action-trace.json`,内容包含 `page_fingerprint`、`actions`、`expected_checks`。使用 `record-from-evidence --automation-out ...` 合并到场景 `automation.json`,人工 review 后再把对应步骤改为 `runner=browser_action`。
|
|
86
|
+
|
|
87
|
+
`cache_stale`、不支持控件或 lint 失败时,不得直接改成宽泛 CSS 绕过;应优先用 `chrome:control-chrome` 重新录制语义定位并 review。
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# 浏览器保留点
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
以下动作不得完全替换成接口;接口只能辅助取证,不能代替真实页面结论:
|
|
4
|
+
|
|
5
|
+
## 浏览器工具优先级
|
|
6
|
+
- 已有稳定 `browser_action`:使用 bpmax-cli Browser Action Runner V2 的 Playwright 执行。
|
|
7
|
+
- 首次录制、`cache_stale`、未支持控件或执行异常:优先使用 `chrome:control-chrome`,复用当前 Chrome 标签页和登录态。
|
|
8
|
+
- Chrome Control 不可用或按其排障流程处理后仍失败:降级 Chrome DevTools;DevTools 再失败才允许使用 AppleScript。
|
|
9
|
+
- 报告必须记录实际使用的工具,不能把 Chrome Control 探索证据写成 Playwright 自动执行证据。
|
|
4
10
|
|
|
5
11
|
## 1. 页面入口与最终视觉验真
|
|
6
12
|
- 列表入口是否真的挂在目标导航下
|
|
@@ -10,12 +16,13 @@
|
|
|
10
16
|
原因:
|
|
11
17
|
- 这些结论属于“用户看见什么”,不是单纯接口成功就能证明
|
|
12
18
|
|
|
13
|
-
## 2.
|
|
14
|
-
-
|
|
15
|
-
-
|
|
19
|
+
## 2. 浏览器运行态证据边界
|
|
20
|
+
- 浏览器只保留运行态 URL、截图、DOM 可见断言、console/network 脱敏摘要和用户可见操作结果。
|
|
21
|
+
- 接口脚本不得依赖浏览器 Cookie、浏览器存储、手工 header 或页面会话凭据。
|
|
22
|
+
- 报告写“页面通过 / 浏览器回归完成 / 完整链路通过”时,必须有真实浏览器动作日志和可见断言;接口回读、缓存命中或状态矩阵只能作为辅助证据。
|
|
16
23
|
|
|
17
24
|
原因:
|
|
18
|
-
-
|
|
25
|
+
- E2E 证明的是“用户在页面里真实看见并完成动作”,不是脚本借用页面会话跑接口。
|
|
19
26
|
|
|
20
27
|
## 3. 缺失真实请求骨架时的首次取证
|
|
21
28
|
- 新流程第一次接口化时,若没有现成 `.codex/tmp` 抓包
|