awaitNotification

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

Waits until a matching notification is active (one already posted counts) and returns the newest. title and text match with mode (any when null); packageName narrows it to one app's notifications (App.awaitNotification passes its own). Notifications are read as data from a notification listener in the Tap driver app, not from the shade, so nothing is opened on screen; the server gives the driver notification access for the session (taken back on detach). Group summaries are left out. Throws WaitTimeoutException (NO_NOTIFICATION) when none matches within timeout.