wait_for
Wait for a page to reach a condition—element, text, URL, network idle, or JS expression—then continue. Use assert to verify instantly instead of waiting.
Instructions
Wait until a condition holds: element visible, page text present, URL match, network idle, or a JS expression true. Prefer condition 'text' over a JS expression for 'has the page said X yet'. assert: true checks once and fails instead of waiting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Substring of the page URL; required for condition 'url' | |
| text | No | Substring of document.body.innerText, case-sensitive; required for condition 'text' | |
| assert | No | Check once, fail if it does not hold; timeout 0, _meta.code 'assertion_failed' | |
| timeout | No | Max wait in ms (default 10000; 0 when assert is true) | |
| selector | No | CSS selector or ref; required for condition 'element' | |
| condition | Yes | element | text | url | network_idle | js | |
| expression | No | Expression that should become true; required for condition 'js' |