waitForNonUi

fun waitForNonUi(    timeoutMs: Long,     intervalMs: Long = DEFAULT_INTERVAL_MS,     predicate: () -> Boolean): Boolean

Utility function to wait for a predicate to return true. The predicate is invoked periodically with intervalMs as interval until the timeoutMs timeout is reached.

This function should not be used for ui/view interactions. For waiting for views, use ViewInteraction.waitFor or waitForView instead.

Return

true when predicate returns true before reaching timeoutMs, false otherwise.

Parameters

timeoutMs

The timeout in milliseconds to wait for the predicate to return true.

intervalMs

The interval in milliseconds in between calling predicate.

predicate

Invoked until it returns true or a timeoutMs occurs.