assert_that
Check page or element conditions like presence, visibility, text, title, or URL, and receive a clear error when the assertion fails.
Instructions
Assert a condition about the page or an element. Raises an exception
(surfaced back as an error string) if the assertion fails within the
timeout (default 7 seconds). timeout applies only to element/text checks.
(For url or title checks, the assertion either passes or fails right away.)
Args:
check: 'element_present', 'element_visible' (need selector);
'text' (substring of expected within selector, default
'html'); 'title', 'url' (exact match), or 'url_contains'
(need expected).
selector: Element to check. Used by 'element_present',
'element_visible', and 'text'.
expected: The text/title/url to check against. Not used for the
element-only checks.
exact: For check='text', require an exact match instead of a
substring match.
timeout: Seconds to wait before failing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| check | No | element_visible | |
| exact | No | ||
| timeout | No | ||
| expected | No | ||
| selector | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |