ElementWait

Wait builder returned by App.await / Screen.await / Element.await. Every wait but count polls on the device in a single RPC; count polls from the host with delay-based polling, so test-root cancellation and sibling failure cancel it promptly.

All terminal methods are suspend and require an owning scope (tapScope/tapTest).

Functions

Link copied to clipboard
suspend fun checked(): Element

until(checked()); a node that is not checkable never is.

Link copied to clipboard
suspend fun count(expected: Int): Element

Waits until exactly expected matches are visible.

Link copied to clipboard
suspend fun disabled(): Element

until(enabled(false)).

Link copied to clipboard
suspend fun enabled(): Element

until(enabled()): wait until the one matching node is enabled.

Link copied to clipboard
suspend fun focused(): Element

until(focused()): wait until the one matching node has input focus.

Link copied to clipboard
suspend fun gone()

Waits until no match exists. A timeout's reason is WaitReason.STILL_PRESENT, with the count.

Link copied to clipboard
suspend fun one(): Element

Waits until exactly one match exists — what a mutation such as tap() needs — and returns the lazy element. A timeout's WaitTimeoutException.reason is WaitReason.NO_MATCH or WaitReason.AMBIGUOUS with WaitTimeoutException.matchCount from the last poll.

Link copied to clipboard
suspend fun textContains(part: String): Element

until(text(part, MatchMode.CONTAINS)): the raw accessibility text contains part (non-empty).

Link copied to clipboard
suspend fun textEquals(expected: String): Element

until(text(expected)): the raw accessibility text equals expected.

Link copied to clipboard
suspend fun unchecked(): Element

until(checked(false)).

Link copied to clipboard
suspend fun until(condition: Selector): Element

Waits until the one node the selector picks satisfies condition, then returns it.

Link copied to clipboard
suspend fun visible(): Element

Waits until at least one match exists; returns the lazy element. A timeout's WaitTimeoutException.reason is WaitReason.NO_MATCH.