page_waitRoute
Poll until the current page route matches the specified path, verifying that indirect navigation triggered by tap or callMethod has completed. Returns matched status and wait time.
Instructions
轮询等待当前页面路径变为指定值,用于验证跳转真正完成(尤其是由 tap / callMethod 间接触发的跳转)。path 传页面路由,与 page.path 同形:无前导 /、不含 query(如 pages/detail/detail)。成功返回 {path,matched:true,waitTime,query};超时抛错并附当前实际 path 便于排查。注意:mp_navigate 返回的 activePage 已是可信的最新路由,导航后通常无需再 waitRoute;本工具主要用于间接跳转。timeout 默认 5000ms,retryInterval 默认 200ms。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| timeout | 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。 | |
| retryInterval | No |