validation_run
Run a complete browser acceptance test plan: clear errors, inject probes, record traces, execute test cases, assert results, investigate failures, and export HAR with evidence artifacts.
Instructions
Execute a complete browser acceptance plan: auto-clear errors, inject probes, record trace, run browser_flow per case, assert, investigate failures, export HAR, and persist evidence artifacts.
中文详情:
用途:执行完整的浏览器端到端验收测试计划,自动完成错误清空、探针注入、trace 录制、按用例执行 browser_flow、断言、失败调查、HAR 导出和证据保存
何时使用:需要一次性运行多个测试用例并产出完整证据链时;CI/CD 流水线中需要 gate 检查时;版本发布前回归验证时;复杂业务流程端到端验证时
输出:{ ok: boolean, planName: string, totalCases: number, passedCases: number, failedCases: number, artifacts: { screenshots: [], traces: [], har: string, report: string }, summary: string }
参数:
name (string, 可选):验证计划名称,用于报告标识
cases (array, 必填):测试用例列表,每项含 name/sessionName/steps/assertions/focus/symptom/expected/continueOnError
clearArtifacts (boolean, 可选):执行前是否清理旧截图/trace/har,默认 false
clearErrors (boolean, 可选):执行前是否清空错误 checkpoint,默认 true
instrument (boolean, 可选):是否注入运行时探针,默认 true
trace (boolean, 可选):是否录制 trace,默认 true
har (boolean, 可选):是否导出 HAR JSON,默认 true
investigateOnFailure (boolean, 可选):失败时是否自动调用 debug_investigate,默认 true
continueOnFailure (boolean, 可选):用例失败后是否继续执行后续用例,默认 false
错误:cases 为空抛出 'No test cases provided';浏览器未启动抛出 'Browser not launched';单个用例断言失败会在 result 中标记 failed 但不抛出
示例:{"name":"login-regression","cases":[{"name":"valid-login","steps":[{"action":"navigate","url":"https://example.com/login"}],"assertions":{"urlContains":"dashboard"}}],"clearArtifacts":true}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| har | No | 是否导出 HAR JSON,默认 true | |
| name | No | 验证计划名称 | |
| cases | Yes | 测试用例列表 | |
| trace | No | 是否录制 trace,默认 true | |
| instrument | No | 是否注入运行时探针,默认 true | |
| clearErrors | No | 执行前是否清空错误 checkpoint,默认 true | |
| clearArtifacts | No | 执行前是否清理截图、trace、har,默认 false | |
| continueOnFailure | No | 用例失败后是否继续执行后续用例,默认 false | |
| investigateOnFailure | No | 失败时是否自动调用 debug_investigate,默认 true |