waitForTag

fun ComposeUiTest.waitForTag(tag: String, timeout: Duration = DefaultUiTimeout, useUnmergedTree: Boolean = false): SemanticsNodeInteraction(source)

Waits until a node with tag is displayed and returns it.

Return

The first displayed node with the tag.

Parameters

tag

The exact test tag.

timeout

The nonnegative wait budget.

useUnmergedTree

Whether to search the unmerged semantics tree.

Throws

when no matching node is displayed in time.

fun ComposeTestRule.waitForTag(tag: String, timeout: Duration = DefaultUiTimeout, useUnmergedTree: Boolean = false): SemanticsNodeInteraction(source)

Waits until a node with tag is displayed and returns it.

Return

The first displayed node with the tag.

Parameters

tag

The exact test tag.

timeout

The nonnegative wait budget.

useUnmergedTree

Whether to search the unmerged semantics tree.

Throws

androidx.compose.ui.test.ComposeTimeoutException

when no matching node is displayed in time.