assert

Function

Common
fun SemanticsNodeInteraction.assert(
    matcher: SemanticsMatcher,
    messagePrefixOnError: (() -> String)? = null,
): SemanticsNodeInteraction

Asserts that the provided matcher is satisfied for this node.

Parameters

matcherMatcher to verify.
messagePrefixOnErrorPrefix to be put in front of an error that gets thrown in case this assert fails. This can be helpful in situations where this assert fails as part of a bigger operation that used this assert as a precondition check.