page_expectData
Assert that a specific data path on the current page deeply equals an expected value. Detects missing paths versus undefined values to prevent silent failures.
Instructions
一次性断言当前页面某个 data 路径的值是否与 expected 深度相等。expected 为必填——省略会抛错(早期省略会让缺失路径与 undefined 误判为相等而静默判过,故强制传)。返回 {pass,expected,actual,pathResolved,snapshot:{path}}:读 pass;pathResolved(=actual 是否 !==undefined) 用来区分「路径不存在」与「值确实是 undefined」。对象键插入顺序不影响比较结果。结果超过 maxBytes(默认 50000B)会截断。path 为单条点/方括号路径(如 user.profile.name、list[0].id),不支持 page_getData 的 [*] 通配投影。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| expected | Yes | ||
| maxBytes | No | ||
| connection | No | 可选连接覆盖(不传则用默认会话)。可用字段:mode(launch|connect)、cliPath、projectPath、wsEndpoint、timeout、port(【自动化端口】→ cli auto --auto-port,默认 9420;不是 IDE HTTP 服务端口,别把 IDE 服务端口传进来)、account、ticket、trustProject、args、cwd、autoClose、autoLaunch、launchTimeout、connectTimeout。 |