ViewAssertions


class ViewAssertions


Collection of common ViewAssertions.

Summary

Public functions

java-static ViewAssertion!

Returns an assert that ensures the view matcher does not find any matching view in the hierarchy.

java-static ViewAssertion!
matches(viewMatcher: Matcher<Any!>!)

Returns a generic ViewAssertion that asserts that a view exists in the view hierarchy and is matched by the given view matcher.

java-static ViewAssertion!
selectedDescendantsMatch(selector: Matcher<View!>!, matcher: Matcher<View!>!)

Returns a generic ViewAssertion that asserts that the descendant views selected by the selector match the specified matcher.

Public functions

doesNotExist

java-static fun doesNotExist(): ViewAssertion!

Returns an assert that ensures the view matcher does not find any matching view in the hierarchy.

matches

java-static fun matches(viewMatcher: Matcher<Any!>!): ViewAssertion!

Returns a generic ViewAssertion that asserts that a view exists in the view hierarchy and is matched by the given view matcher.

selectedDescendantsMatch

java-static fun selectedDescendantsMatch(selector: Matcher<View!>!, matcher: Matcher<View!>!): ViewAssertion!

Returns a generic ViewAssertion that asserts that the descendant views selected by the selector match the specified matcher.

Example: onView(rootView).check(selectedDescendantsMatch(not(isAssignableFrom(TextView.class)), hasContentDescription()));