waitUntilNodeCount

Function

Common
@ExperimentalTestApi
fun ComposeUiTest.waitUntilNodeCount(
    matcher: SemanticsMatcher,
    count: Int,
    timeoutMillis: Long = 1_000L,
)

Blocks until the number of nodes matching the given matcher is equal to the given count.

Parameters

matcherThe matcher that will be used to filter nodes.
countThe number of nodes that are expected to be matched.
timeoutMillisThe time after which this method throws an exception if the number of nodes that match the matcher is not count. This observes wall clock time, not frame time.