Assertions
Tools for verifying text content, element visibility, and element count. All assertions support polling with timeoutMs for async UI updates.
assert_text
Assert that text exists on the screen.
Parameters
Example
Tips
- Matches by substring —
"Welcome"will match"Welcome back, John". - Use
selectorto avoid false positives when the same text appears in multiple places. - Use
timeoutMsfor elements that appear after async operations (API calls, animations, etc.).
assert_visible
Assert that an element matching a selector is visible on screen.
Parameters
Example
Tips
- Queries the React Fiber tree, not the native view hierarchy.
- An element is "visible" if it exists in the tree and has non-zero dimensions.
assert_not_visible
Assert that an element matching a selector is not visible. Useful for verifying that modals, toasts, or loading indicators have disappeared.
Parameters
Example
Tips
- Use
timeoutMsto wait for disappearing animations or async operations to complete. - Passes if the element does not exist in the tree or has zero dimensions.
assert_element_count
Assert the number of elements matching a selector. Supports exact count or min/max range.
Parameters
Example
Tips
- Use
expectedCountfor exact matches,minCount/maxCountfor range checks. expectedCountandminCount/maxCountare mutually exclusive — do not combine them.