awaitToast

suspend fun awaitToast(text: String? = null, mode: MatchMode = MatchMode.EXACT, packageName: String? = null, timeout: Duration = timeouts.wait): Toast(source)

Waits for a toast and returns it: one shown in the last 3.5 s (the longest a toast stays up) or arriving within timeout. text matches with mode (any text when null); a toast from any package counts unless packageName names one (App.awaitToast passes its own). Not consuming: the same toast can satisfy two calls in a row. Throws WaitTimeoutException (NO_TOAST) when none matches.