ViewAssertions

public final class ViewAssertions
extends Object

java.lang.Object
   ↳ android.support.test.espresso.assertion.ViewAssertions


共同的 ViewAssertion s的集合。

Summary

Public methods

static ViewAssertion doesNotExist()

返回一个断言,确保视图匹配器在层次结构中找不到任何匹配的视图。

static ViewAssertion matches(Matcher<? super View> viewMatcher)

返回一个通用的 ViewAssertion ,声明视图存在于视图层次结构中,并与给定的视图匹配器匹配。

static ViewAssertion selectedDescendantsMatch(Matcher<View> selector, Matcher<View> matcher)

返回声明由选择器选择的后代视图匹配指定的匹配器的通用 ViewAssertion

Inherited methods

From class java.lang.Object

Public methods

doesNotExist

ViewAssertion doesNotExist ()

返回一个断言,确保视图匹配器在层次结构中找不到任何匹配的视图。

Returns
ViewAssertion

matches

ViewAssertion matches (Matcher<? super View> viewMatcher)

返回一个通用的 ViewAssertion ,声明视图存在于视图层次结构中,并与给定的视图匹配器匹配。

Parameters
viewMatcher Matcher
Returns
ViewAssertion

selectedDescendantsMatch

ViewAssertion selectedDescendantsMatch (Matcher<View> selector, 
                Matcher<View> matcher)

返回一个通用的ViewAssertion ,声明由选择器选择的后代视图匹配指定的匹配器。 示例:onView(rootView).check(selectedDescendantsMatch(not(isAssignableFrom(TextView.class)),hasContentDescription()));

Parameters
selector Matcher
matcher Matcher
Returns
ViewAssertion