public class ComponentHostMatchers
extends java.lang.Object
ComponentHost
.Modifier and Type | Method and Description |
---|---|
static <any> |
componentHost() |
static <any> |
componentHost(<any> subMatcher)
Matches a view that is a ComponentHost that matches subMatcher.
|
static <any> |
componentHostWithText(<any> textMatcher)
Matches a ComponentHost which is displaying text that matches
textMatcher |
static <any> |
componentHostWithText(java.lang.String text)
Matches a ComponentHost which is displaying
text . |
static <any> |
isClickable() |
static <any> |
withContentDescription(<any> textMatcher) |
static <any> |
withContentDescription(java.lang.CharSequence text) |
static <any> |
withLifecycle(<any> lifecycleMatcher)
Matches a ComponentHost that has mounted a Component with a lifecycle that's matched by the
lifecycleMatcher . |
static <any> |
withTagKey(int key) |
static <any> |
withTagKey(int key,
<any> value) |
static <any> |
withTagValue(<any> value) |
static <any> |
withText(<any> textMatcher) |
static <any> |
withText(java.lang.String text) |
public static <any> componentHost(<any> subMatcher)
In Espresso tests, when you need to match a View, we recommend using this matcher and nest
any of the other matchers in this class along with it. For example
componentHost(withText("foobar"))
or
componentHost(withContentDescription("foobar"))
.
While it's definitely possible to use Espresso's ViewMatchers directly to match ComponentHosts, using these methods ensure that we can handle weirdness in the view hierarchy that comes from the component stack.
public static <any> withLifecycle(<any> lifecycleMatcher)
lifecycleMatcher
.public static <any> componentHostWithText(<any> textMatcher)
textMatcher
public static <any> withText(<any> textMatcher)
public static <any> componentHostWithText(java.lang.String text)
text
. This is equivalent to componentHostWithText(is(text))
.public static <any> withText(java.lang.String text)
public static <any> withContentDescription(java.lang.CharSequence text)
public static <any> withContentDescription(<any> textMatcher)
public static <any> withTagValue(<any> value)
public static <any> withTagKey(int key)
public static <any> withTagKey(int key, <any> value)
public static <any> isClickable()
public static <any> componentHost()