DefaultFailureHandler


class DefaultFailureHandler : FailureHandler


Espresso's default FailureHandler. If this does not fit your needs, feel free to provide your own implementation via Espresso.setFailureHandler(FailureHandler).

Summary

Public constructors

DefaultFailureHandler(
    appContext: Context!,
    captureScreenshotOnFailure: Boolean
)

Public functions

Unit
handle(error: Throwable!, viewMatcher: Matcher<View!>!)

Handle the given error in a manner that makes sense to the environment in which the test is executed (e.g. take a screenshot, output extra debug info, etc).

Public constructors

DefaultFailureHandler

DefaultFailureHandler(appContext: Context!)

DefaultFailureHandler

DefaultFailureHandler(
    appContext: Context!,
    captureScreenshotOnFailure: Boolean
)

Public functions

handle

fun handle(error: Throwable!, viewMatcher: Matcher<View!>!): Unit

Handle the given error in a manner that makes sense to the environment in which the test is executed (e.g. take a screenshot, output extra debug info, etc). Upon handling, most handlers will choose to propagate the error.