ui_wait_for
Wait for a UI condition—element visible, hidden, enabled, detached, or text present—and return the moment it holds, with a clear page-state report instead of a generic timeout.
Instructions
Block until the page reaches a state: an element appears, disappears, becomes enabled, or some text shows up. This is the honest alternative to guessing a sleep — it returns as soon as the condition holds, and when it does not, it says what the page looked like instead of just timing out.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nth | No | Which match to use when several qualify, 0-based. | |
| role | No | Narrow the matches to this ARIA role. | |
| text | No | Visible text on the control. Matches the innermost element that carries it, and follows a <label> to its input. | |
| exact | No | Require the whole text to match rather than a substring. | |
| frame | No | 'main' (default) or a substring of a frame's origin/name. Single-page apps often render the screen you want in a child frame. | main |
| state | No | What to wait for: 'visible' (default), 'hidden', 'enabled', 'detached', or 'stable' (present and no longer moving). | visible |
| testid | No | Value of a test attribute (data-testid and friends — see the testAttributes setting). | |
| selector | No | CSS selector. Descends into open shadow roots. | |
| timeout_ms | No | How long to wait for the element to become actionable before giving up. | |
| contains_text | No | Also require the element to contain this text. |