expectDeath

suspend fun expectDeath(kind: AppDeath.Kind? = null, timeout: Duration = device.timeouts.wait, block: suspend () -> Unit): AppDeath(source)

Runs block, which should make this app crash or stop responding, and returns the death (Device.expectDeath); for crash-recovery and process-death tests:

val death = app.expectDeath { app.element(desc("crash")).tap() }
assertEquals("java.lang.IllegalStateException", death.exceptionClass)