assertVisible

suspend fun assertVisible(tag: String)

Asserts that a UI element matching string tag is present and visible on screen.

Automatically polls the UI tree until the element appears or the timeout is reached.

Example Usage

assertVisible("welcome_header")
assertVisible("Logout")

Parameters

tag

The testTag string or visible text of the element.

See also

Throws

If the element is not visible within the timeout.


suspend fun assertVisible(selector: Selector)

Asserts that a UI element matching selector is present and visible on screen.

Advanced variant using explicit selectors. Automatically polls until visible.

Example Usage

assertVisible(tag("dashboard_card"))
assertVisible(text("Total Items").first())

Parameters

selector

Explicit selector targeting the UI element.

Throws

If no matching visible node appears within the timeout.