public final class ViewAssertions
extends java.lang.Object
ViewAssertion
s.Modifier and Type | Method and Description |
---|---|
static ViewAssertion |
doesNotExist()
Returns an assert that ensures the view matcher does not find any matching view in the
hierarchy.
|
static ViewAssertion |
matches(
Returns a generic
ViewAssertion that asserts that a view exists in the view hierarchy
and is matched by the given view matcher. |
static ViewAssertion |
selectedDescendantsMatch(
Returns a generic
ViewAssertion that asserts that the descendant views selected by the
selector match the specified matcher. |
public static ViewAssertion doesNotExist()
public static ViewAssertion matches(viewMatcher)
ViewAssertion
that asserts that a view exists in the view hierarchy
and is matched by the given view matcher.public static ViewAssertion selectedDescendantsMatch(selector, matcher)
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()));