wait_for
Pause automation until a page condition holds: visible element, page text, URL substring, network idle, or JS expression true. Use assert mode to check once and fail immediately.
Instructions
Wait for a condition: element visible, page text present, URL match, network idle, or JS expression true. Prefer condition:'text' over a JS expression for "has the page said X yet". Set assert:true to check once and fail instead of waiting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Substring of the page URL — required when condition is 'url' | |
| text | No | Substring of the page's visible text — required when condition is 'text'. Case-sensitive; matches document.body.innerText, i.e. what a reader sees. | |
| assert | No | Assert instead of wait: check the condition once and fail if it does not hold (default timeout becomes 0). Failures carry _meta.code = 'assertion_failed'. | |
| timeout | No | Maximum wait time in milliseconds (default: 10000, or 0 when assert is true) | |
| selector | No | CSS selector or element ref (e.g. 'e5') — required when condition is 'element' | |
| condition | Yes | What to wait for: element visibility, visible page text, the URL, network idle, or a JS expression returning true | |
| expression | No | JavaScript expression that should evaluate to true — required when condition is 'js' |