assertText

suspend fun assertText(tag: String, expected: String)

Asserts that the UI element matching string tag displays exact text expected.

Includes built-in waiting until the text updates to match the expected value.

Example Usage

assertText("user_name_display", "Alice")

Parameters

tag

The testTag string or visible text of the element.

expected

The exact expected text string.

See also

Throws

If the element text does not match expected within the timeout.


suspend fun assertText(selector: Selector, expected: String)

Asserts that the UI element matching selector displays exact text expected.

Advanced variant using explicit selectors. Includes built-in waiting.

Example Usage

assertText(tag("status_label"), "Connected")

Parameters

selector

Explicit selector targeting the UI element.

expected

The exact expected text string.

Throws

If the element text does not match expected within the timeout.