bpmax-cli 0.2.1-beta.8 → 0.2.1-beta.81
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 +30 -7
- package/dist/bin.js +41819 -11180
- package/dist/bin.js.map +1 -1
- package/package.json +12 -5
- package/scripts/install-skills.mjs +27 -60
- package/scripts/run-source-cli.mjs +145 -0
- package/skills/bpmax-ai-taskbook/SKILL.md +13 -1
- package/skills/bpmax-ai-taskbook/references/blueprint-taskbook-gates.md +121 -0
- package/skills/bpmax-ai-taskbook/references/taskbook-template.md +42 -2
- 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 +15 -2
- package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +8 -0
- package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +13 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-modeling-review.xml +23 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-paragraph-flow-details.xml +27 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +45 -28
- package/skills/bpmax-blueprint-doc-workflow/references/source-traceability-and-flow-modeling.md +115 -0
- package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +386 -5
- 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-business-skill/SKILL.md +3 -1
- package/skills/bpmax-cli/SKILL.md +46 -0
- package/skills/bpmax-config-latest/SKILL.md +4 -0
- package/skills/bpmax-console-template-editor/SKILL.md +113 -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 +131 -594
- package/skills/bpmax-dataset-field-template-editor/references/full-detail-guide.md +570 -0
- package/skills/bpmax-dataset-field-template-editor/references/nested-field-patterns.md +8 -8
- 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 +123 -778
- package/skills/bpmax-dataset-template-editor/references/dataset-script-runtime-matrix.md +11 -0
- package/skills/bpmax-dataset-template-editor/references/full-detail-guide.md +753 -0
- package/skills/bpmax-dataset-template-editor/references/runtime-gotchas.md +12 -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 +174 -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 +181 -15
- package/skills/bpmax-e2e-flow-test-operator/references/browser-action-dsl.md +167 -0
- package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +15 -7
- package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +589 -0
- package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +12 -8
- 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-e2e-flow-test-operator-v2/SKILL.md +64 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/agents/openai.yaml +7 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/automation-generation-pipeline.md +33 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/autonomous-execution.md +40 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/batch-generation-and-execution.md +17 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/browser-action-runner.md +19 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/browser-recording-and-replay.md +95 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/form-script-generation.md +41 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/identity-and-failure-routing.md +90 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/multi-request-mutation.md +9 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/scenario-coverage-generation.md +17 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/scoped-execution.md +13 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/step-restartability-and-state.md +23 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/test-assets-and-evidence.md +9 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/test-data-and-selector-contract.md +51 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/test-preflight-and-confirmation.md +32 -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 +129 -1123
- 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 +1158 -0
- package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +1 -1
- package/skills/bpmax-flow-template-editor/references/payload-checklist.md +2 -0
- 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 +12 -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 +138 -1151
- 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-home-portal-editor/SKILL.md +81 -0
- package/skills/bpmax-icon-catalog/SKILL.md +18 -0
- package/skills/bpmax-icon-catalog/agents/openai.yaml +4 -0
- package/skills/bpmax-icon-catalog/assets/ri-icons.json +3140 -0
- package/skills/bpmax-icon-catalog/references/source-contract.md +3 -0
- package/skills/bpmax-list-template-editor/SKILL.md +131 -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 +461 -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/runtime-verified-workflow.md +50 -2
- 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 +14 -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-page-composition-template-editor/SKILL.md +315 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/catalog.json +41 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/full-capability-workbench.json +294 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/project-detail-step-panel.json +184 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/project-list-quick-process.json +177 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/project-operations-dashboard.json +400 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/project-operations-visual-light.json +214 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/step-related-projects.json +184 -0
- package/skills/bpmax-page-composition-template-editor/references/resource-api.md +9 -0
- package/skills/bpmax-plugin-config/SKILL.md +55 -5
- 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 +11 -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 +58 -56
- package/skills/bpmax-user-mock-operator/agents/openai.yaml +2 -2
- package/skills/bpmax-user-mock-operator/scripts/chrome_identity_bridge.mjs +1766 -0
- package/skills/bpmax-user-model-editor/SKILL.md +24 -0
- package/skills/bpmax-workspace-editor/SKILL.md +1 -0
- package/skills/form-control-library/references/form-template-submit-schema.md +3 -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,8 @@
|
|
|
8
8
|
<scenario_id>/
|
|
9
9
|
README.md
|
|
10
10
|
cases.csv
|
|
11
|
+
case_steps.csv
|
|
12
|
+
automation.json
|
|
11
13
|
review.json
|
|
12
14
|
.copy_diff/
|
|
13
15
|
last.diff
|
|
@@ -16,6 +18,8 @@
|
|
|
16
18
|
<scenario_id>/
|
|
17
19
|
README.md
|
|
18
20
|
cases.csv
|
|
21
|
+
case_steps.csv
|
|
22
|
+
automation.json
|
|
19
23
|
review.json
|
|
20
24
|
.copy_diff/
|
|
21
25
|
last.diff
|
|
@@ -24,10 +28,23 @@
|
|
|
24
28
|
<YYYYMMDD-NNN>/
|
|
25
29
|
summary.md
|
|
26
30
|
<scenario_id>.md
|
|
31
|
+
ux-findings.json
|
|
27
32
|
screenshots/
|
|
28
33
|
```
|
|
29
34
|
|
|
30
|
-
`suite` 是正式用例库,`suite_draft`
|
|
35
|
+
`suite` 是正式用例库,`suite_draft` 是生成或更新后的待确认草稿,`report` 是每次运行的证据目录。`automation init/compile` 只能修改 `suite_draft`;正式 `suite` 中的 `automation.json` 只能来自 lint/review 后的 promote。
|
|
36
|
+
|
|
37
|
+
正式用例设计必须使用 `bpmax-functional-test-design`;本轮页面体验审计必须使用 `bpmax-ui-ux-audit`。场景报告必须包含:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
test_design_skill: bpmax-functional-test-design
|
|
41
|
+
ux_audit_skill: bpmax-ui-ux-audit
|
|
42
|
+
ux_audit_status: completed|blocked
|
|
43
|
+
ux_findings: ux-findings.json
|
|
44
|
+
ux_bug_counts: P0=<n>,P1=<n>,P2=<n>,P3=<n>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
所有确认的体验问题都是 `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`。
|
|
31
48
|
|
|
32
49
|
`.copy_diff/` 是覆盖同名场景目录时自动生成的覆盖审计证据,只在 `draft-update --replace` 或 `promote --replace` 的目标目录已存在时出现。
|
|
33
50
|
|
|
@@ -61,10 +78,10 @@ owner_skill: bpmax-e2e-flow-test-operator
|
|
|
61
78
|
|
|
62
79
|
## cases.csv 字段
|
|
63
80
|
|
|
64
|
-
|
|
81
|
+
`cases.csv` 只保存用例级元数据,字段必须完全一致:
|
|
65
82
|
|
|
66
83
|
```csv
|
|
67
|
-
case_id,priority,type,title,preconditions,config_basis,prep_data,
|
|
84
|
+
case_id,priority,type,title,preconditions,config_basis,prep_data,expected_result,test_data,roles,evidence_required,tags,status,updated_at
|
|
68
85
|
```
|
|
69
86
|
|
|
70
87
|
字段说明:
|
|
@@ -76,7 +93,6 @@ case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_
|
|
|
76
93
|
- `preconditions`:前置数据和环境。
|
|
77
94
|
- `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
95
|
- `prep_data`:结构化前置数据准备,至少包含 `账号=`、`入口=`、`样本=`、`准备操作=`、`预期=`、`precondition_check=`、`browser_tool=`、`live_draft=`,并提供 `state_file=` 或 `report_run=`。
|
|
79
|
-
- `steps`:可读步骤,用 ` > ` 分隔。
|
|
80
96
|
- `expected_result`:明确可判定结果。
|
|
81
97
|
- `test_data`:客户真实业务测试数据说明,不写 token、cookie、手机号、密码或完整 payload。必须使用英文分号分隔的 `key=value`,至少包含 `业务场景=`、`业务逻辑=`、`样本数据=`、`合理性=`。
|
|
82
98
|
- `roles`:涉及角色,用逗号分隔。
|
|
@@ -85,11 +101,128 @@ case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_
|
|
|
85
101
|
- `status`:`active`、`deprecated`、`draft`。
|
|
86
102
|
- `updated_at`:`YYYY-MM-DD`。
|
|
87
103
|
|
|
88
|
-
|
|
104
|
+
`case_steps.csv` 每行只能描述一个测试步骤:
|
|
105
|
+
|
|
106
|
+
```csv
|
|
107
|
+
case_id,step_id,step_no,actor,runner,action,target,input_data,expected_result,evidence_required
|
|
108
|
+
C001,S001,1,store_staff,browser_action,打开客户换货创建页面,客户换货创建页,无,页面展示换货表单,screenshot+url+dom
|
|
109
|
+
C001,S002,2,store_staff,browser_action,填写客户换货字段,换货表单旧机和新机字段,真实旧机SN和新机SN,页面显示真实业务数据,screenshot+dom
|
|
110
|
+
C001,S003,3,store_staff,browser_action,点击提交客户换货申请,创建页提交按钮,无,项目创建成功并进入审批链,screenshot+project_detail
|
|
111
|
+
C001,S004,4,store_staff,identity,切换测试身份,当前浏览器会话,目标用户ID,会话切换为目标审批人,identity+mock+readback
|
|
112
|
+
C001,S005,5,dealer_owner,browser_action,审批通过客户换货申请,经销商负责人审批环节,审批意见为同意,审批完成并进入终态,screenshot+step_context+submit+readback
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
规则:
|
|
116
|
+
|
|
117
|
+
- 正式 `runner` 只能是 `browser_action`、`identity`、`observe`。draft 首次准备时可暂用 `browser` 标记待编译页面步骤;旧 `e2e_create_page`、`e2e_step_run` 只能作为 automation init/compile 的迁移输入,不能通过正式 lint/review/promote。身份 status/mock/unmock 必须使用 `identity`,在 `input_data` 声明 `identity_transport=chrome_bridge`。mock 前要有 status,每个 mock 后要有 unmock。`observe` 只能核对同一 run 更早步骤已经登记的 evidence,`input_data` 必须声明 `source_case_step_id=<case_id>/<step_id>`,禁止页面操作、确认动作、身份切换、数据写入和任意未登记文件引用。
|
|
118
|
+
- `step_no` 从 1 开始连续递增;`step_id` 在 case 内唯一。
|
|
119
|
+
- `actor` 必须属于 cases.csv 的 roles,系统观察步骤可写 `system`。
|
|
120
|
+
- `action` 一行只能有一个动作,禁止 `>`、连续编号和“然后/接着/再然后”;上传附件是合法单一步骤,必须写清具体附件和目标控件。
|
|
121
|
+
- `target`、`input_data`、即时 `expected_result`、`evidence_required` 都必须明确;无输入写“无”。
|
|
122
|
+
|
|
123
|
+
旧聚合格式使用以下命令迁移到 draft,生成的 `REVIEW_REQUIRED` 字段必须逐行补齐:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
bpmax-cli test-suite steps migrate --scenario <scenario_id> --draft-root .ai_test/suite_draft --latest-proof <proof.json> --format json
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
正式执行前必须先生成并审查确定性脚本:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
bpmax-cli test-suite automation init --scenario <scenario_id> --root .ai_test/suite_draft --out .codex/tmp/<scenario_id>-automation-input.json --latest-proof <proof.json> --format json
|
|
133
|
+
bpmax-cli test-suite automation compile --scenario <scenario_id> --root .ai_test/suite_draft --source .codex/tmp/<scenario_id>-automation-input.json --latest-proof <proof.json> --format json
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
`automation init` 之后优先读取平台源码;必要时只用 Chrome Control 做不触发业务 mutation 的页面结构探索。编译输入绑定当前场景快照,编译结果同时绑定编译后的 case assets 和 automation 内容哈希;`README.md`、`cases.csv`、`case_steps.csv`、actions 或 expected checks 变化后必须重新生成并 review。场景文件写入与 compile 共用进程锁;陈旧的死亡进程锁可自动恢复,活动写入期间 migrate、draft-update、lint、promote 和 run start 都必须停止。完成 scoped lint/review/promote 后,CLI 会在正式场景写入 promotion receipt;缺少 receipt 或 promote 后资产漂移时不得启动 execution manifest:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
bpmax-cli test-suite run start --scenario <scenario_id> --case-id <case_id> --profile <profile> --latest-proof <proof.json> --format json
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
`run start` 只创建本轮隔离空间,不直接授权执行。CLI 同时生成 pending 的 `precondition-<run_id>.json`。核对真实样本、身份、入口、主数据和依赖状态后,在本轮报告目录写结构化 evidence,再登记:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
bpmax-cli test-suite run precondition --manifest <execution-manifest.json> --evidence <current-run-precondition-evidence.json> --profile <profile> --format json
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
evidence 必须声明 `kind=bpmax_e2e_precondition_evidence`、当前 `run_id/evidence_nonce/scenario_id/case_id/profile`、`precondition_verified=true`,并包含至少一条有名称且 `passed=true` 的 `checks`。CLI 会把 evidence 和 canonical record 的 SHA-256 锚定进 manifest。未通过、目录外、旧时间戳、身份不匹配或登记后被修改时,`next`、正式 record 和场景执行都会在页面/mutation 前阻断。
|
|
149
|
+
|
|
150
|
+
稳定浏览器步骤使用 `runner=browser_action`,并在场景目录维护覆盖完整场景所有 active case 的 `automation.json`。只编译当前选中的 case 不足以启动正式 run。前置检查登记通过后,正式执行只能使用 `run start` 返回的 run-scoped automation 副本,由一次 `bpmax-cli e2e scenario execute` 连续读取 manifest、操作真实页面并自动记录本轮证据。共享 suite、draft 或外部 automation 不能直接驱动本轮执行。
|
|
151
|
+
|
|
152
|
+
`automation.json` 必须声明确定性 `operation_flow`。一个 case step 最多包含一个远端 mutation;多个提交必须拆成多个步骤。每个 mutation 必须同时有 `resolution_checks.committed` 和 `resolution_checks.not_committed`,并分别包含强只读检查,两组检查不能语义等价。所有正式 `browser_action` 只能通过 `scenario execute` 运行,直接 `browser-run` 必须阻断,避免无 mutation 步骤也被拆成 Agent 逐步循环。mutation 前异常由 CLI 保存 repair request;页面/脚本漂移只在 reviewed draft 中改当前或未来步骤,runner、控件或环境问题可以修兼容层。重新 compile 并刷新 review asset snapshot 后,执行 `test-suite automation repair --checkpoint <checkpoint> --automation <draft automation.json>`;CLI 先在 manifest 的 `automation_repair_guard` 锚定 checkpoint、source automation、review、completed step、旧新脚本和不可变 receipt hash,再更新本轮副本。中断恢复只能完成这笔已锚定 repair,resume 必须消费该 receipt 并更新 manifest automation hash。禁止直接改本轮副本或共享 suite。mutation 点击前先持久化绑定目标 checkpoint 的 manifest `mutation_attempt_guard`,再保存 operation checkpoint,并让 `mutation-state.json` 使用同一 attempt ID;这只代表 `mutation_attempted`,只有观察到匹配目标写请求后才能记录 `mutation_request_observed=true` 和 `remote_submitted=true`。删除 checkpoint 不会解除 manifest guard,同一 scenario/case/profile 即使换 report root 也不能新建 run 绕过。execute、resolve、repair 对同一 manifest 共用 operation lock,不受自定义 checkpoint 路径影响。结果不确定时,`scenario resolve` 在两个独立页面分别运行 committed/not_committed 的只读检查,并要求恰好一个分支通过;未观察到写请求时,not_committed 可以用 `mutation.assert_no_request` 核对本轮网络证据,但仍必须配合实时页面强检查。调用方 outcome 只能作为预期校验。确定性 Playwright runner 生成 source evidence、`resolution-receipt.json` 和 `evidence-files.json`,再把三者 SHA-256 锚定到 manifest;证据还要绑定当前 run nonce、checkpoint revision、mutation attempt ID、case/step 和同一 `automation_step_sha256`,手写或仅文件内自洽的 bundle 不能清除 guard。已完成 manifest 不允许 resume,重新运行必须 `run start` 新建 run。
|
|
153
|
+
|
|
154
|
+
完整 DSL、页面指纹、mutation 和缓存边界见 [browser-action-dsl.md](browser-action-dsl.md)。
|
|
155
|
+
|
|
156
|
+
源码 CLI 联调时显式增加:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
--source-skill <bpmax-cli-repo>/skills/bpmax-e2e-flow-test-operator/SKILL.md
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
不传该参数时,`run start` 会硬检查已安装 skill stamp 必须与当前 CLI 版本一致;出现 `test_suite.run.skills_out_of_sync` 时先执行 `bpmax-cli update`,不得混用旧 skill。
|
|
163
|
+
|
|
164
|
+
正式 `bpmax-cli e2e` 命令必须带 manifest/case/step;只有排障可显式使用 `--diagnostic`,且不能形成通过结论。
|
|
165
|
+
|
|
166
|
+
正式 browser step 的证据 JSON 最小结构:
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"run_id": "20260801-001",
|
|
171
|
+
"evidence_nonce": "<由 CLI 生成并写入>",
|
|
172
|
+
"case_id": "C001",
|
|
173
|
+
"case_step_id": "S001",
|
|
174
|
+
"browser_verified": true,
|
|
175
|
+
"runtime_scope": "page",
|
|
176
|
+
"runtime_environment": "profile",
|
|
177
|
+
"runtime_url": "https://example.com/w:workspace/project/123",
|
|
178
|
+
"screenshot": "../../screenshots/C001-S001.png",
|
|
179
|
+
"assertions": [{ "name": "page_loaded", "passed": true }],
|
|
180
|
+
"dom_snapshot": "dom.txt"
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
`evidence_nonce` 是当前 run 的内部隔离标识,应由 CLI/runner 在证据生成时写入,不要求人类手工填写,也不得在登记旧文件时补写。缺少当前 run/case/step 绑定的证据不能进入 formal pass。
|
|
185
|
+
|
|
186
|
+
`runner=observe` 使用专用的原始 evidence;这里的 `status=observed` 描述只读观察结果,随后由 `test-suite run record --result pass` 把 manifest 步骤登记为 PASS,二者不能混用。最小结构如下:
|
|
187
|
+
|
|
188
|
+
```json
|
|
189
|
+
{
|
|
190
|
+
"kind": "bpmax_e2e_observe_evidence",
|
|
191
|
+
"run_id": "<manifest.run_id>",
|
|
192
|
+
"evidence_nonce": "<manifest.evidence_nonce>",
|
|
193
|
+
"case_id": "C001",
|
|
194
|
+
"case_step_id": "S002",
|
|
195
|
+
"status": "observed",
|
|
196
|
+
"observed": true,
|
|
197
|
+
"source_case_step_id": "C001/S001",
|
|
198
|
+
"source_evidence": "source.json",
|
|
199
|
+
"assertions": [{ "name": "项目状态与预期一致", "passed": true }]
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
`source_case_step_id` 必须与 `case_steps.csv` 当前 observe 步骤 `input_data` 中的声明一致;`source_evidence` 必须指向同一 run 内、已由该前序 PASS 步骤登记的 evidence 文件。缺少 kind、错误 status、缺少 observed、断言失败、来源绑定不一致、来源缺失或未登记会分别返回稳定 rule id。
|
|
204
|
+
|
|
205
|
+
证据必须位于本轮 report 目录。仅写 `browser_verified: true`、引用历史截图、复用前一步相同截图、断言为空/失败,或在要求 DOM 时缺少 `dom_snapshot`,都不能记录为 pass。
|
|
206
|
+
|
|
207
|
+
`runtime_scope` 规则:`page` 证明首页、列表、搜索等页面,不要求项目 ID;`project` 必须提供数字 `project_id`;`step` 必须同时提供数字 `project_id` 和业务 `step_id`。禁止用 `case_steps.csv.step_no` 填业务 `step_id`。
|
|
208
|
+
|
|
209
|
+
`runtime_environment=profile` 时,`runtime_url` origin 必须与 run start 固化的 `profile_origin` 一致。源码本地浏览器测试使用 `runtime_environment=local-browser`,并且只允许 loopback URL。manifest 只能由 CLI record/append 更新;禁止手工回滚,禁止多个 agent 同时读写同一 manifest,也不得删除或重建 manifest 相邻的 state、journal、transaction、suite 根目录的 `.bpmax-active-runs/` lease 以及 report root 下 `.bpmax-run-integrity/` 高水位文件。即使 manifest/state/journal 一起恢复到旧的一致前缀,也必须按 rollback 阻断。run start 还会固定 E2E Skill 完整 bundle 的内容哈希,包括 `SKILL.md`、references、scripts、profiles 和其他分发文件;bundle 内禁止符号链接。安装过程有任一 adapter 失败时不得更新 `skills.stamp`,运行中 Skill bundle 变化必须重新开始正式 run。
|
|
210
|
+
|
|
211
|
+
最后一步 record 后 CLI 会从 manifest 自动同步 `<scenario_id>.md`。需要重试时使用:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
bpmax-cli test-suite run report-sync --manifest .ai_test/report/<run_id>/execution-manifest.json --format json
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
`execution_plan_generated`、`browser_execution_pending`、`bootstrap_required` 表示尚未形成正式执行证据;只有真实提交或正式记录后才能出现 `execution_evidence_recorded`。不得依据 plan/template/dry-run 状态推进用例结论。
|
|
218
|
+
|
|
219
|
+
报告同步只更新执行状态,不会替代理解页面并完成 UX 审计。`scenario execute` 的 `status=functional_complete` 和 manifest 的 `result=pass` 只表示功能步骤完成;此时报告在 UX 审计未完成时仍为 `result=partial`,命令明确返回 `formal_conclusion_ready=false`。必须基于本轮证据更新 `ux-findings.json` 和场景报告,再运行 `bpmax-cli test-suite lint-report`;lint 通过后才能对外给正式 E2E 结论。
|
|
220
|
+
|
|
221
|
+
旧版聚合示例已废弃;以下是用例级示例:
|
|
89
222
|
|
|
90
223
|
```csv
|
|
91
|
-
case_id,priority,type,title,preconditions,config_basis,prep_data,
|
|
92
|
-
C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"think_flow
|
|
224
|
+
case_id,priority,type,title,preconditions,config_basis,prep_data,expected_result,test_data,roles,evidence_required,tags,status,updated_at
|
|
225
|
+
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=.ai_test/report/<run_id>/precondition-<run_id>.json;browser_tool=Chrome Control;live_draft=live;state_file=.ai_test/report/<run_id>/execution-manifest.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
226
|
```
|
|
94
227
|
|
|
95
228
|
## latest gate
|
|
@@ -97,10 +230,21 @@ C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"t
|
|
|
97
230
|
- 生成、检查、更新 `.ai_test` 用例前,都必须先调用当前仓库对应的 `latest-*` 更新方法,并带 `ALLOW_DIRTY=1`。
|
|
98
231
|
- 使用当前环境对应的 latest sync 能力;脚本等价命令必须显式设置 `ALLOW_DIRTY=1` 或对应的安全允许脏工作区参数。
|
|
99
232
|
- latest 后记录:命令、`ALLOW_DIRTY=1`、更新前后 `git rev-parse HEAD`、`git status --short` 摘要。
|
|
100
|
-
- latest 后必须写 `.codex/tmp/ai_test_suite/latest-<
|
|
233
|
+
- latest 后必须写 `.codex/tmp/ai_test_suite/latest-<env>-proof.json`,至少包含 `method`、`allow_dirty`、`before`、`after`、`head`、`status_short`。
|
|
101
234
|
- `bpmax-cli test-suite lint/index/draft-update/promote` 必须传 `--latest-proof <path>`;缺失或 proof 不合格时命令拒绝执行。
|
|
102
235
|
- latest 失败或远端基线无法确认时,不得继续生成、检查、更新或 promote 用例。
|
|
103
236
|
|
|
237
|
+
## 单流程隔离门禁
|
|
238
|
+
|
|
239
|
+
- 共享 `.ai_test/suite` 可以保存多个流程的场景,但批量迁移、修复和晋级必须以单个 `flow_type` 为失败域。
|
|
240
|
+
- 迁移器必须显式保存当前流程的 `scenario_ids`。不要通过扫描并验证整个 suite 来反推当前流程范围,因为其他流程的损坏 README、case 或 step 会造成无关阻断。
|
|
241
|
+
- 单流程 lint 使用可重复的 `--scenario`:`bpmax-cli test-suite lint --root .ai_test/suite_draft --scenario <main_scenario> --scenario <return_scenario> --latest-proof <proof.json> --format json`。
|
|
242
|
+
- scoped lint 的 JSON 必须是 `scope=selected_scenarios`,并核对 `selected_scenarios`、`ignored_scenario_count` 和 `flow_types`。该结果只代表所选场景,不代表全仓 suite。
|
|
243
|
+
- `e2e_acceleration.missing_cases` 也必须只包含所选场景;其他流程缺少 reusable evidence 时不得污染当前流程。
|
|
244
|
+
- review 始终逐场景完成。一个流程有多个场景时,全部 review 的 `unresolved.P0/P1` 都清零后,才允许在一次 promote 中重复传入这些 `--scenario`。
|
|
245
|
+
- 单次多场景 promote 只允许一个 `flow_type`。CLI 必须先验证全部场景及 review,再复制任何场景;其中一个失败时,本流程不得部分晋级。其他流程使用另一个独立 promote 批次。
|
|
246
|
+
- 省略 `--scenario` 的 lint 保留给全仓测试资产治理,不应用作单流程迁移的默认门禁。
|
|
247
|
+
|
|
104
248
|
## 配置依据规则
|
|
105
249
|
|
|
106
250
|
- 每条用例都必须填写 `config_basis`。
|
|
@@ -123,7 +267,7 @@ C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"t
|
|
|
123
267
|
- `prep_data` 是执行前必须先完成的准备清单,不是备注。
|
|
124
268
|
- 最少写明 `账号=`、`入口=`、`样本=`、`准备操作=`、`预期=`、`precondition_check=`、`browser_tool=`、`live_draft=`,并提供 `state_file=` 或 `report_run=`。
|
|
125
269
|
- `precondition_check=` 必须指向本轮执行前置检查记录;没有该记录时只能进入准备阶段,不能写正式执行结论。
|
|
126
|
-
- `browser_tool=`
|
|
270
|
+
- `browser_tool=` 必须写明本轮实际执行的真实页面通道,只允许 `Chrome Control`、`chrome:control-chrome`、`Chrome DevTools`、`DevTools`、`Playwright` 或 `AppleScript`。首次只读探索和异常诊断优先 `Chrome Control`,稳定 `browser_action` 正式执行使用 `Playwright`;如果没有可用浏览器工具,报告必须走 browser blocked 模板,不能在工具名后写 unavailable 仍声明通过。
|
|
127
271
|
- `live_draft=` 必须写清本轮测的是 `live` 发布态还是 `draft` 草稿态。
|
|
128
272
|
- `state_file=` 或 `report_run=` 必须能定位本轮状态/报告证据。
|
|
129
273
|
- `准备操作=` 必须写正式执行步骤前要做的具体动作,例如打开入口、创建或搜索样本、确认主数据、确认权限、确认自动化发布状态。
|
|
@@ -306,13 +450,26 @@ run_id: 20260618-001
|
|
|
306
450
|
scenario_id: customer-exchange-main-flow
|
|
307
451
|
source_suite: .ai_test/suite/customer-exchange-main-flow
|
|
308
452
|
result: pass
|
|
453
|
+
functional_result: pass
|
|
454
|
+
rerun_policy: full_rerun
|
|
309
455
|
tested_at: 2026-06-18
|
|
456
|
+
started_at: 2026-06-18T10:00:00+08:00
|
|
457
|
+
finished_at: 2026-06-18T11:00:00+08:00
|
|
310
458
|
|
|
311
459
|
planned_cases: C001,C002,C003
|
|
312
460
|
executed_cases: C001,C002,C003
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
461
|
+
planned_steps: C001/S001,C001/S002,C002/S001,C003/S001
|
|
462
|
+
executed_steps: C001/S001,C001/S002,C002/S001,C003/S001
|
|
463
|
+
execution_manifest: execution-manifest.json
|
|
464
|
+
precondition_check: .ai_test/report/20260618-001/precondition-20260618-001.json
|
|
465
|
+
state_file: .ai_test/report/20260618-001/execution-manifest.json
|
|
466
|
+
report_run: .ai_test/report/20260618-001
|
|
467
|
+
browser_tool: Chrome Control
|
|
468
|
+
runtime_url: https://yaditest.yitaiyitai.com/w:store_mgr/project_detail/0/<project_id>
|
|
469
|
+
runtime_user: store_staff
|
|
470
|
+
browser_action_log: C001 打开创建页 -> 填写真实业务字段 -> 点击提交 -> 打开详情页
|
|
471
|
+
visible_assertions: C001 页面显示客户换货主链路、当前环节和提交成功结果
|
|
472
|
+
project_id: <project_id>
|
|
316
473
|
|
|
317
474
|
## 1. 测试范围
|
|
318
475
|
|
|
@@ -347,9 +504,18 @@ bpmax-cli test-suite lint-report --root .ai_test/report
|
|
|
347
504
|
```
|
|
348
505
|
|
|
349
506
|
报告 lint 会硬检查:
|
|
350
|
-
- `planned_cases:`
|
|
351
|
-
- `
|
|
352
|
-
-
|
|
507
|
+
- `planned_cases:` / `executed_cases:` 与 `planned_steps:` / `executed_steps:` 必须存在并逐条对账;`execution_manifest:` 必须指向本轮报告目录中的 manifest。任何未登记步骤、跳步或缺证据步骤都会阻断完整通过。
|
|
508
|
+
- `run_id:` 必须等于当前 `.ai_test/report/<YYYYMMDD-NNN>/` 目录名。
|
|
509
|
+
- `precondition_check:`、`state_file:`、`report_run:`、`browser_tool:`、`rerun_policy:` 必须存在。
|
|
510
|
+
- `precondition_check:` 必须与 execution manifest 锚定的本轮 canonical record 完全一致;完整结论要求其状态为 `passed`,evidence/checks 绑定当前 run/scenario/case/profile 且文件哈希未变化。文件名带本轮日期但记录不存在或仍为 pending 不能通过。
|
|
511
|
+
- `rerun_policy: full_rerun` 表示本轮重新运行,不能直接引用旧结果、旧报告、旧状态文件或旧截图填充本轮 `executed_cases` 和 pass 结论。
|
|
512
|
+
- `full_rerun` 下 `state_file:`、`precondition_check:`、`report_run:` 必须指向本轮 run 或本轮日期;截图必须位于本轮 `screenshots/`,且文件修改时间落在 `started_at:` / `finished_at:` 时间窗内。没有时间窗时按 run 日期校验。
|
|
513
|
+
- 每个 `executed_cases` 里的通过用例都必须有本轮 case evidence:结果表 evidence、截图 alt/path、项目 ID、step ID 或本轮证据路径需能定位该 case。
|
|
514
|
+
- 页面/浏览器结论(页面通过、浏览器回归通过、完整链路通过)必须有 `browser_tool`、本轮截图和结构化运行态证据:`runtime_url:`、`runtime_user:` 或 `runtime_profile:`、`browser_action_log:`、`visible_assertions:`、`project_id:` 或 `step_id:`。
|
|
515
|
+
- `result:` 使用受支持枚举:`pass` / `pass-with-warnings`、`partial` / `stage` / `blocked` / `diagnostic`、`fail`;不得使用 `all_green` 等未定义同义词。完整通过时 `runtime_url:` 必须是 BPMAX 页面路由且与声明的 project/step id 对齐,动作与断言不得是 TODO、接口回读或 JSON 响应占位文本。
|
|
516
|
+
- 截图必须是本轮生成、可解析、至少 100x80,且内容 MIME 与扩展名一致的 PNG 或 JPEG;文本改后缀、损坏图片和空白占位文件不算页面证据。Chrome identity bridge 的规范 JPEG 可以直接用于同一步 record,不得改名或转换成伪 PNG。
|
|
517
|
+
- 接口回读、缓存命中、状态矩阵只能作为辅助证据;如果报告用这些作为通过依据却缺少真实浏览器动作日志和可见断言,只能写 `diagnostic` / `partial`,不能写完整通过。
|
|
353
518
|
- 出现 `not run` 但 `result: pass` 的报告必须降级为 `partial` 或 `stage`。
|
|
354
519
|
- 浏览器 blocked 报告必须使用 `browser_status: blocked` 模板并停止页面结论。
|
|
520
|
+
- `checkpoint` / `evidence_only` 可以引用历史证据作为对照,但只能写局部/对照结论,不能写完整重新运行通过。
|
|
355
521
|
- 报告中的乱码/空洞步骤会通过用例内容 lint 拦截。
|
|
@@ -0,0 +1,167 @@
|
|
|
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
|
+
"operation_flow": {
|
|
16
|
+
"mode": "deterministic",
|
|
17
|
+
"on_repairable_failure": "pause_for_script_repair",
|
|
18
|
+
"resume_from": "step_start",
|
|
19
|
+
"on_write_state_unknown": "require_readback_resolution"
|
|
20
|
+
},
|
|
21
|
+
"steps": {
|
|
22
|
+
"C001/S001": {
|
|
23
|
+
"runner": "browser_action",
|
|
24
|
+
"surface": "pc",
|
|
25
|
+
"page_fingerprint": {
|
|
26
|
+
"route": "/project/create",
|
|
27
|
+
"fields": ["subject", "amount"],
|
|
28
|
+
"buttons": ["提交"]
|
|
29
|
+
},
|
|
30
|
+
"actions": [
|
|
31
|
+
{
|
|
32
|
+
"type": "navigation.open",
|
|
33
|
+
"route": "/w:new_oa/project/create?flow_type={{data.flow_type}}"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "form.set_value",
|
|
37
|
+
"target": { "field": "subject" },
|
|
38
|
+
"value": "{{data.subject}}"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "button.click",
|
|
42
|
+
"target": { "role": "button", "name": "提交" },
|
|
43
|
+
"mutation": true,
|
|
44
|
+
"retry": "never",
|
|
45
|
+
"url_pattern": "/project"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"expected_checks": [
|
|
49
|
+
{ "type": "wait.route", "route": "/projectContinue" },
|
|
50
|
+
{ "type": "page.assert_step", "expected": "部门审批" }
|
|
51
|
+
],
|
|
52
|
+
"resolution_checks": {
|
|
53
|
+
"committed": [
|
|
54
|
+
{ "type": "page.assert_step", "expected": "部门审批" }
|
|
55
|
+
],
|
|
56
|
+
"not_committed": [
|
|
57
|
+
{ "type": "page.assert_step", "expected": "创建申请" }
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
H5 步骤必须显式声明运行面与经过审查的 viewport:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"runner": "browser_action",
|
|
70
|
+
"surface": "h5",
|
|
71
|
+
"viewport": { "width": 412, "height": 844 }
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
正式 runner 会在认证 probe 之前设置 viewport,并在每个步骤执行前再次设置和回读实际尺寸;尺寸不一致时以 `e2e.browser.viewport_mismatch` hard fail。实际 viewport 会进入步骤 evidence,DOM 快照记录页面 `innerWidth/innerHeight`,动作 trace 记录声明值,因此都受 evidence file hash 链保护。PC 步骤可声明其他经过审查的 viewport;一轮连续执行在 PC/H5 步骤间切换时会按步骤重新应用。
|
|
76
|
+
|
|
77
|
+
认证 probe 的动态 `page_fingerprint` 使用当前 run 的 data profile 解析 `{{data.*}}`。缺少变量时返回独立的 `e2e.browser.auth_fingerprint_variables_invalid`,不得吞掉并误报为登录无效。
|
|
78
|
+
|
|
79
|
+
## 支持动作
|
|
80
|
+
|
|
81
|
+
- 页面与等待:`navigation.open`、`wait.visible`、`wait.network`、`wait.route`。
|
|
82
|
+
- 主表单:`form.set_value`、`form.set_date_range`、`form.select_option`、`cascader.search_select`、`form.assert_value`。
|
|
83
|
+
- 流程日志顺序:`page.assert_text_sequence`,使用唯一 `target.test_id` 或 `target.css`、`values` 数组和可选 `match: "exact" | "contains"`,在同一可见容器内按 DOM 文本顺序断言。
|
|
84
|
+
|
|
85
|
+
`cascader.search_select` 专用于 Element UI Cascader。target 只能是外层控件的语义定位(`field`、`label` 等),不能提供组件内部 CSS。value 固定为 `{"search":"叶子名称","path":["完整","层级","叶子名称"]}`:runner 打开唯一外层控件,并要求其 `aria-controls`/`aria-owns` 精确绑定唯一可见 Cascader 弹层;在该弹层内填充内部搜索框,只接受其 `title` 或 `aria-label` 与完整有序 path 精确一致的唯一候选,hover 后点击,并读取外层已选值/标签确认叶子。候选或路径不唯一、弹层绑定/搜索框缺失、完整路径无法验证,均 hard fail;不能降级为宽泛文本点击。
|
|
86
|
+
- 明细表:`detail.add_row`、`detail.set_value`、`detail.assert_rows`。
|
|
87
|
+
- 命令动作:`button.click`、`dialog.confirm`。
|
|
88
|
+
- 上下文与断言:`context.extract`、`page.assert_step`、`list.assert_record`、`evidence.capture`。
|
|
89
|
+
- 消息送达:`message.open`、`message.assert_delivery`。
|
|
90
|
+
|
|
91
|
+
`message.open` 是受控的附带写入动作:消息抽屉加载 `GET message` 后会把未读消息通过 `PUT message/read` 标记为已读。脚本必须显式声明 `collateral_mutation: "message.read"`、`list_url_pattern` 和已读 `url_pattern`;不得声明主业务 `mutation`。runner 在点击前同时安装 GET/PUT response wait,记录各自的 response cursor、method/status,只把消息 ID、收件人 ID、标题、正文和业务 URL 的脱敏投影放入当前步骤 context。未声明附带写入、缺少任一网络模式或未观察到对应 GET/PUT 时 hard fail,不能把打开消息抽屉伪装为 `observe`。
|
|
92
|
+
|
|
93
|
+
`form.upload_file` 是受控附件上传动作,不是主业务提交。文件必须位于当前场景 `fixtures/` 目录,且 action 为每个文件声明 `path`、`sha256`、`mime`、`size`,同时声明 `collateral_mutation: "file.upload"` 和附件接口 `url_pattern`。runner 校验 realpath、普通文件、非符号链接、内容 MIME、大小和哈希后才调用 `setInputFiles`,再核对原生 `input.files` 和本轮附件接口响应。证据分别记录 `local_selection_confirmed=true`、`remote_upload_confirmed=true`、`business_submission_confirmed=false`;附件成功不能代替后续表单提交 mutation。
|
|
94
|
+
|
|
95
|
+
`message.assert_delivery` 必须声明 `title`、`content`、`url_pattern`、当前 run 的 `recipient_id`、`project_id`,需要环节绑定时再声明 `step_id`,并固定 `count: 1`。断言要求唯一消息同时匹配收件人、标题/正文、业务链接以及当前 project/step;零条、重复消息、错误收件人或链接绑定不一致均失败。证据只保留所选消息的脱敏字段,不保存完整消息接口 payload。
|
|
96
|
+
|
|
97
|
+
`wait.network` 默认只接受紧邻前一个 action 开始后产生的新响应。runner 会在每个 action 开始时记录 response cursor;同 URL、同 method、同 status 的历史响应不能被复用。筛选或查询场景必须把触发查询的 `button.click mutation=false` 与对应 `wait.network` 紧邻编排,再执行 `list.assert_record` 或其他强断言;连续两次查询必须各自等待各自的新响应。
|
|
98
|
+
|
|
99
|
+
日期区间控件使用 `form.set_date_range`,通过一个语义 target 定位同一表单项中的两个可见输入框,`value` 固定为 `[start,end]` 两个非空字符串。例如:`{"type":"form.set_date_range","target":{"label":"申请日期"},"value":["2026-08-02","2026-08-02"]}`。不要用两个带 `nth` 的 `form.set_value` 猜测日期区间内部 DOM 顺序。
|
|
100
|
+
|
|
101
|
+
`list.assert_record` 默认断言至少有一条可见匹配记录;可选 `count` 用于精确计数。`count: 1` 证明唯一匹配。`count: 0` 证明同一业务键不存在时,必须用 `target.css` 或 `target.test_id` 锚定恰好一个可见列表容器;无锚点的 absence 断言会被 lint 拒绝,避免页面中的无关表或隐藏旧表形成假阳性。正向断言按候选类型寻找首组可见且命中业务键的主表 body、ARIA row 或已知列表/卡片 record;固定列镜像表不会重复计数。禁止退化为整页文本匹配,筛选输入、空状态、toast、分页文案都不能充当记录。evidence 会保存命中记录的截断 DOM 文本摘要。使用前必须先在同一步按唯一业务键执行查询,避免分页或未筛选结果削弱证据。
|
|
102
|
+
|
|
103
|
+
`resolution_checks` 可以包含自包含的只读探针序列:`navigation.open`、`form.set_value` / `form.set_date_range` / `form.select_option`、明确 `mutation: false` 的筛选查询按钮,以及等待和强断言。两条分支会在独立页面中分别执行;禁止 `mutation: true`、`dialog.confirm`、上传、明细写入、身份切换或任意脚本。典型模式是两边都重新打开列表、按同一唯一业务键查询,再分别用 `list.assert_record count: 1` 和 `count: 0` 证明已提交与未提交互斥。只有 `not_committed` 分支可以增加 `{ "type": "mutation.assert_no_request", "url_pattern": "/project" }`,用于核对本轮 manifest 绑定的 attempt evidence 确实没有观察到目标写请求;它必须与实时 `wait.route`、`page.assert_step` 或 `list.assert_record` 同时使用,不能单独形成未提交结论。
|
|
104
|
+
|
|
105
|
+
一个 `case_steps.csv` 行只能描述一个业务动作,但该动作可以包含多个技术原子动作。
|
|
106
|
+
|
|
107
|
+
## 步骤起点重建
|
|
108
|
+
|
|
109
|
+
每个 `browser_action` 都必须能从新的 Playwright 进程恢复到自己的步骤起点,不能假设上一步留下的标签页、DOM、输入值或 `context.extract` 仍存在。
|
|
110
|
+
|
|
111
|
+
- 推荐把 `navigation.open` 作为第一个动作。
|
|
112
|
+
- 如果本步正常连续执行时应保留当前页面,可在 `page_fingerprint.route` 声明恢复路由;CLI 只在新页面或路由不匹配时自动恢复。
|
|
113
|
+
- 恢复路由可以使用当前 run 明确提供的 `{{data.*}}`,不得使用上一浏览器进程才存在的 `{{context.*}}`。
|
|
114
|
+
- 如果本步依赖此前填写的字段,本步 `actions` 必须重新包含这些幂等前置填值/选择动作,再执行本步业务动作。已通过步骤不会被重新记录或回放。
|
|
115
|
+
|
|
116
|
+
缺少可恢复路由时,lint 返回 `test_suite.automation.step_start_route_missing`;跨进程依赖 `{{context.*}}` 时返回 `test_suite.automation.step_start_context_volatile`。
|
|
117
|
+
|
|
118
|
+
## 定位规则
|
|
119
|
+
|
|
120
|
+
优先使用 `field`、`label`、`role + name`、`text`、`test_id`。CSS 只允许稳定 id、`name`、`aria-label` 或 `data-*` 属性。
|
|
121
|
+
|
|
122
|
+
禁止坐标、绝对 XPath、依赖 DOM 层级的长 CSS,以及写死本轮 `project_id`、`step_id`、流水号或 trace id。
|
|
123
|
+
|
|
124
|
+
## mutation 与重试
|
|
125
|
+
|
|
126
|
+
所有 `button.click` 必须声明 `mutation=true|false`。会远端提交的点击和确认动作必须使用:
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{ "mutation": true, "retry": "never", "url_pattern": "/project" }
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`url_pattern` 用于锁定本次写请求。每个 case step 最多只能有一个 `mutation=true` 动作;需要两个写请求时拆成两个独立步骤。CLI 在 mutation 前验证页面指纹和证据目录,在点击前先把尝试与目标 checkpoint 写入 execution manifest `mutation_attempt_guard`,再保存 operation-flow checkpoint,runner evidence 同时写入同一 attempt ID 的 `mutation-state.json=attempted_unconfirmed`。此时只设置 `mutation_attempted=true`;只有 Playwright 的 request 事件实际观察到匹配模式的 POST/PUT/PATCH/DELETE,才设置 `mutation_request_observed=true` 和 `remote_submitted=true`。匹配响应返回 4xx/5xx 时立即失败。mutation 后必须使用 `wait.route`、`page.assert_step` 或 `list.assert_record` 做强回读,`wait.visible` 只能作为辅助断言。
|
|
133
|
+
|
|
134
|
+
每个 mutation 步骤必须同时提供 `resolution_checks.committed` 和 `resolution_checks.not_committed`。两组检查都只能执行只读动作,并至少包含一个 `wait.route`、`page.assert_step` 或 `list.assert_record`,分别证明“已经写入”和“没有写入”;不能用同一条模糊可见性断言覆盖两个结果。
|
|
135
|
+
|
|
136
|
+
写入和强回读确认后,`mutation-state.json` 更新为 `confirmed`,并和截图、DOM、动作 trace、步骤 evidence 一起写入 `evidence-files.json`,每个文件记录 SHA-256。进程在点击后中断时,持久化的 `attempted_unconfirmed` 会阻止自动重放。
|
|
137
|
+
|
|
138
|
+
## 操作流程与断点
|
|
139
|
+
|
|
140
|
+
正式场景由 `scenario execute` 一次运行到完成或受控暂停。`run start` 先把 promote 后的 automation 复制到本轮报告目录;execute 只接受 manifest 绑定的 run-scoped 文件。所有正式 `browser_action` 都不得直接调用 `browser-run`,因为只有 orchestrator 能保证整段流程不会退化成 Agent 逐步骤循环,并在 mutation dispatch 前持久化 manifest guard 和 checkpoint。execute、resolve 和 automation repair 对同一 execution manifest 共用 `<execution-manifest>.operation.lock`;调用方即使指定不同 checkpoint,也不能并行进入执行、写入或恢复链路。CLI 在同一目录维护 `operation-flow-state.json`,记录脚本绑定、已通过步骤哈希、当前步骤和 mutation 状态;execution manifest 还保存正式步骤顺序、最终结果和未确认 mutation guard,不能手工编辑。删除 checkpoint 不能解除 guard,必须通过匹配本轮 nonce、revision、attempt ID 和步骤哈希的 resolve 闭环。
|
|
141
|
+
|
|
142
|
+
- `paused_repairable`:异常发生在 mutation 之前。CLI 保存截图、DOM、Console/Network、动作 trace 和 `repair-request.json`,当前步骤保持 `planned`。页面、选择器或脚本漂移只允许在 draft 修改当前或未来步骤;重新 init/compile、刷新 review asset snapshot 后,必须通过 `test-suite automation repair` 应用到本轮副本。该命令与 execute/resolve 共用 manifest operation lock,先在 manifest 写 `automation_repair_guard`,锚定 checkpoint/source/review/旧新脚本 hash 和不可变 receipt hash,再替换本轮脚本。guard 已写但 run automation 尚未替换时,resume 必须停止且不能启动浏览器;崩溃恢复只能完成同一笔已锚定 repair。
|
|
143
|
+
- `paused_external_action`:当前是身份桥或其他已注册的非浏览器 runner。CLI 返回一个完整外部动作,不返回逐个页面点击。外部动作完成并产生本轮证据后续跑。
|
|
144
|
+
- `paused_write_state_unknown`:mutation intent 已记录但结果未确认。禁止 resume、脚本改写、自动重试或换 report root 新建同 scenario/case/profile run。若 `mutation_request_observed=false`,状态仍保持未决,但不得伪报 `remote_submitted=true`。`scenario resolve` 在两个独立页面分别运行 committed/not_committed 两组只读 `resolution_checks`,只有唯一命中才形成结论;调用方不能选择 outcome。对已发生的无请求第三态,如果 attempt evidence 证明未观察到目标写请求,且当前页面仍匹配尝试步骤已审核的起点 route 和提交按钮 fingerprint,runner 可以生成 `mutation.no_request_page_fingerprint` 受控断言,不要求事后修改已哈希锁定的 automation。确定性 Playwright runner 会生成截图、DOM、trace、source evidence、`resolution-receipt.json` 和 `evidence-files.json`;CLI 将 receipt、source evidence 和 file manifest 的 SHA-256 锚定到 manifest guard 后才接受结果。resolution evidence 必须匹配当前 run nonce、checkpoint revision、mutation attempt ID、case/step,且 `automation_step_sha256` 等于实际尝试步骤的哈希;手写或仅文件内自洽的 JSON bundle 不能独立清除 guard。
|
|
145
|
+
- `pass`:全部步骤和证据闭环。再次运行必须创建新的 full-rerun manifest,不能复用该 checkpoint。
|
|
146
|
+
|
|
147
|
+
断点固定在步骤边界。续跑会创建新的浏览器上下文,并通过当前步骤自己的首个 `navigation.open` 或 `page_fingerprint.route` 恢复页面;当前步骤 mutation 尚未尝试时,可安全重放该步骤的导航、等待、填值和断言。已通过步骤不能修改或重放,CLI 会比较其稳定哈希,发现变化立即阻断。
|
|
148
|
+
|
|
149
|
+
## 运行与重跑
|
|
150
|
+
|
|
151
|
+
正式运行前先完成 `test-suite automation init`、只读来源审查和 `test-suite automation compile`,确保所有页面步骤都已变为 `runner=browser_action`;之后创建新的 test-suite run,登记 manifest 锚定的本轮 passed precondition checks,再以 `scenario execute` 作为唯一正式入口。公开 `browser-run` 只保留兼容命令名并硬阻断直接执行;页面探索和异常诊断使用 `chrome:control-chrome`,不得由 Agent 编排单步 runner 形成正式结果。`scenario execute` 返回 `functional_complete` 后仍需 UX 审计和 `lint-report`,不能直接等同正式 pass。`--resume` 只继续同一个未完成 run;已完成 run 必须新建,历史 pass 不得让本轮 case 被跳过。
|
|
152
|
+
|
|
153
|
+
每轮重新解析动态 ID,并生成新的截图、DOM、Console/Network、动作 trace 和 manifest 记录。缓存只包含动作和页面语义。
|
|
154
|
+
|
|
155
|
+
`runner=observe` 只允许读取同一 run 中更早通过步骤已经登记的 evidence。`input_data` 必须声明 `source_case_step_id=<case_id>/<step_id>`,observe evidence 必须回写相同字段;来源步骤必须在同一 case 中更早且已经 pass。打开、点击、填写、提交、搜索、确认、身份切换或引用未登记文件都必须 hard fail,不能借 observe 形成 pass。
|
|
156
|
+
|
|
157
|
+
## 首次脚本生成
|
|
158
|
+
|
|
159
|
+
首次正式运行前,先在 `.ai_test/suite_draft` 由 `test-suite automation init` 生成待审编译输入。init/compile 均拒绝直接修改 `.ai_test/suite`。优先读取平台源码;仍需确认页面结构时,使用 `chrome:control-chrome` 复用当前 Chrome 标签页和登录态做只读探索,不得提交、审批、驳回或执行其他业务 mutation。不要默认启动独立 Playwright 或 Chrome DevTools 来探索页面;只有 Chrome Control 不可用或按其排障流程处理后仍失败时才降级 Chrome DevTools。
|
|
160
|
+
|
|
161
|
+
在编译输入中为每个步骤填写 `source_basis`、`page_fingerprint`、`actions` 和 `expected_checks`,review 后运行 `test-suite automation compile` 写入 `automation.json` 并把对应步骤改为 `runner=browser_action`。编译元数据会绑定 case assets、actions 和 expected checks,任何后改都必须重新 compile。`source_basis` 每一项必须使用 `platform_source:`、`chrome_control_read_only:`、`reviewed_pattern:` 或 `business_requirement:` 前缀并写清具体依据。确定性执行后的 `browser-action-trace.json` 和 `record-from-evidence --automation-out ...` 只能在 `.codex/tmp` 生成待审候选;候选不能直接作为场景 `automation.json`,必须重新进入 compile/review/promote,或在受控暂停时经 review 后通过 automation repair 应用到当前 run。
|
|
162
|
+
|
|
163
|
+
如果页面动作和 manifest 记录已经成功,只是报告同步失败,操作流程器会暂停在 `report_sync_failed`,当前步骤指向下一待执行步骤。恢复时只同步报告;CLI 会重新校验证据的 realpath、mtime、run nonce 和 case/step 绑定,再从 manifest 当前步骤继续。不得修改或回放已通过步骤。
|
|
164
|
+
|
|
165
|
+
`cache_stale`、不支持控件或 lint 失败时,不得直接改成宽泛 CSS 绕过;应优先用 `chrome:control-chrome` 重新录制语义定位并 review。
|
|
166
|
+
|
|
167
|
+
修复脚本时必须保留场景、manifest 和已通过步骤。允许增加兼容选择器、等待、控件分支和稳定断言;禁止直接编辑报告目录中的 automation、修改 completed step、写死本轮动态 ID、删除 mutation 后置断言或把 `retry=never` 改成可重试。
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# 浏览器保留点
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
以下动作不得完全替换成接口;接口只能辅助取证,不能代替真实页面结论:
|
|
4
|
+
|
|
5
|
+
## 浏览器工具优先级
|
|
6
|
+
- 已有稳定 `browser_action`:使用 bpmax-cli Browser Action Runner V2 的 Playwright 执行。
|
|
7
|
+
- 首次正式运行前的脚本准备:优先读取平台源码;必要时使用 `chrome:control-chrome` 复用当前 Chrome 标签页和登录态做只读页面结构探索,禁止提前执行业务 mutation。
|
|
8
|
+
- `cache_stale`、未支持控件或执行异常:优先使用 `chrome:control-chrome` 定位并修复当前/未来脚本或 runner 兼容层。
|
|
9
|
+
- Chrome Control 不可用或按其排障流程处理后仍失败:降级 Chrome DevTools;DevTools 再失败才允许使用 AppleScript。
|
|
10
|
+
- 报告必须记录实际使用的工具,不能把 Chrome Control 探索证据写成 Playwright 自动执行证据。
|
|
4
11
|
|
|
5
12
|
## 1. 页面入口与最终视觉验真
|
|
6
13
|
- 列表入口是否真的挂在目标导航下
|
|
@@ -10,12 +17,13 @@
|
|
|
10
17
|
原因:
|
|
11
18
|
- 这些结论属于“用户看见什么”,不是单纯接口成功就能证明
|
|
12
19
|
|
|
13
|
-
## 2.
|
|
14
|
-
-
|
|
15
|
-
-
|
|
20
|
+
## 2. 浏览器运行态证据边界
|
|
21
|
+
- 浏览器只保留运行态 URL、截图、DOM 可见断言、console/network 脱敏摘要和用户可见操作结果。
|
|
22
|
+
- 接口脚本不得依赖浏览器 Cookie、浏览器存储、手工 header 或页面会话凭据。
|
|
23
|
+
- 报告写“页面通过 / 浏览器回归完成 / 完整链路通过”时,必须有真实浏览器动作日志和可见断言;接口回读、缓存命中或状态矩阵只能作为辅助证据。
|
|
16
24
|
|
|
17
25
|
原因:
|
|
18
|
-
-
|
|
26
|
+
- E2E 证明的是“用户在页面里真实看见并完成动作”,不是脚本借用页面会话跑接口。
|
|
19
27
|
|
|
20
28
|
## 3. 缺失真实请求骨架时的首次取证
|
|
21
29
|
- 新流程第一次接口化时,若没有现成 `.codex/tmp` 抓包
|
|
@@ -33,9 +41,9 @@
|
|
|
33
41
|
- skill 已明确:凡是报告写“页面真实结果”,都必须有截图证据
|
|
34
42
|
|
|
35
43
|
## 5. 多角色身份切换与恢复
|
|
36
|
-
-
|
|
44
|
+
- 需要以发起人、审批人、查看人等不同用户身份验证页面行为时,必须使用 Chrome Control 身份桥在当前浏览器会话里完成 status/mock/unmock,不得导出 Cookie。
|
|
37
45
|
- mock 后必须刷新或调用 `/api/user/current` 验证当前身份。
|
|
38
|
-
- unmock
|
|
46
|
+
- unmock 后必须验证已经恢复原始管理账号身份,并确认 identity lease 已释放。
|
|
39
47
|
|
|
40
48
|
原因:
|
|
41
49
|
- 多角色结论证明的是“真实用户在页面里能否看见并完成动作”,不能只用接口调用成功替代。
|