assert
Verify page conditions by polling until timeout: check element presence, visibility, count, text, URL, or title. Fails with a clear mismatch error for test replay.
Instructions
Assert a page condition, polling until timeout: element exists/visible (optionally with count or containing text), text on page, tab url/title. Patterns: substring, or "/…/" for regex. Recorded flows replay it as a test. Unlike wait_for, which returns found: false, a failure is an error naming what did not match; success returns passed and waited_ms.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Tab url pattern | |
| text | No | In the element (with selector) or anywhere on the page | |
| count | No | Exact match count for selector | |
| state | No | attached means present in the DOM, visible also requires a rendered box | attached |
| title | No | Tab title pattern | |
| tab_id | No | Target tab; omitted = last tab navigated in this session, else the active one | |
| timeout | No | Max ms to wait for the condition before failing | |
| selector | No | Element the assertion is about; ">>>" pierces shadow DOM |