{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
public final class ViewAssertions
Collection of common ViewAssertions.
Public constructors |
|
|---|---|
Public methods |
|
|---|---|
static ViewAssertion |
Returns an assert that ensures the view matcher does not find any matching view in the hierarchy. |
static ViewAssertion |
Returns a generic |
static ViewAssertion |
selectedDescendantsMatch(Matcher<View> selector, Matcher<View> matcher)Returns a generic |
public static ViewAssertion doesNotExist()
Returns an assert that ensures the view matcher does not find any matching view in the hierarchy.
public static ViewAssertion matches(Matcher<Object> viewMatcher)
Returns a generic ViewAssertion that asserts that a view exists in the view hierarchy and is matched by the given view matcher.
public static ViewAssertion selectedDescendantsMatch(Matcher<View> selector, Matcher<View> matcher)
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()));