{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
class ViewAssertions
Collection of common ViewAssertions.
Public constructors |
|
|---|---|
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! |
Returns a generic |
java-static ViewAssertion! |
selectedDescendantsMatch(selector: Matcher<View!>!, matcher: Matcher<View!>!)Returns a generic |
java-static fun doesNotExist(): ViewAssertion!
Returns an assert that ensures the view matcher does not find any matching view in the hierarchy.
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.
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()));