public class

Until

extends Object
java.lang.Object
   ↳ android.support.test.uiautomator.Until

Class Overview

The Until class provides factory methods for constructing common conditions.

Summary

Public Constructors
Until()
Public Methods
static UiObject2Condition<Boolean> checkable(boolean isCheckable)
Returns a condition that depends on a UiObject2's checkable state.
static UiObject2Condition<Boolean> checked(boolean isChecked)
Returns a condition that depends on a UiObject2's checked state.
static UiObject2Condition<Boolean> clickable(boolean isClickable)
Returns a condition that depends on a UiObject2's clickable state.
static UiObject2Condition<Boolean> descContains(String substring)
Returns a condition that is satisfied when the object's content description contains the given string.
static UiObject2Condition<Boolean> descEndsWith(String substring)
Returns a condition that is satisfied when the object's content description ends with the given string.
static UiObject2Condition<Boolean> descEquals(String contentDescription)
Returns a condition that is satisfied when the object's content description exactly matches the given string.
static UiObject2Condition<Boolean> descMatches(Pattern regex)
Returns a condition that is satisfied when the object's content description matches the given regex.
static UiObject2Condition<Boolean> descMatches(String regex)
Returns a condition that is satisfied when the object's content description matches the given regex.
static UiObject2Condition<Boolean> descStartsWith(String substring)
Returns a condition that is satisfied when the object's content description starts with the given string.
static UiObject2Condition<Boolean> enabled(boolean isEnabled)
Returns a condition that depends on a UiObject2's enabled state.
static SearchCondition<UiObject2> findObject(BySelector selector)
Returns a SearchCondition that is satisfied when at least one element matching the selector can be found.
static SearchCondition<List<UiObject2>> findObjects(BySelector selector)
Returns a SearchCondition that is satisfied when at least one element matching the selector can be found.
static UiObject2Condition<Boolean> focusable(boolean isFocusable)
Returns a condition that depends on a UiObject2's focusable state.
static UiObject2Condition<Boolean> focused(boolean isFocused)
Returns a condition that depends on a UiObject2's focused state.
static SearchCondition<Boolean> gone(BySelector selector)
Returns a SearchCondition that is satisfied when no elements matching the selector can be found.
static SearchCondition<Boolean> hasObject(BySelector selector)
Returns a SearchCondition that is satisfied when at least one element matching the selector can be found.
static UiObject2Condition<Boolean> longClickable(boolean isLongClickable)
Returns a condition that depends on a UiObject2's long clickable state.
static EventCondition<Boolean> newWindow()
Returns a condition that depends on a new window having appeared.
static EventCondition<Boolean> scrollFinished(Direction direction)
Returns a condition that depends on a scroll having reached the end in the given direction.
static UiObject2Condition<Boolean> scrollable(boolean isScrollable)
Returns a condition that depends on a UiObject2's scrollable state.
static UiObject2Condition<Boolean> selected(boolean isSelected)
Returns a condition that depends on a UiObject2's selected state.
static UiObject2Condition<Boolean> textContains(String substring)
Returns a condition that is satisfied when the object's text value contains the given string.
static UiObject2Condition<Boolean> textEndsWith(String substring)
Returns a condition that is satisfied when the object's text value ends with the given string.
static UiObject2Condition<Boolean> textEquals(String text)
Returns a condition that is satisfied when the object's text value exactly matches the given string.
static UiObject2Condition<Boolean> textMatches(String regex)
Returns a condition that is satisfied when the object's text value matches the given regex.
static UiObject2Condition<Boolean> textMatches(Pattern regex)
Returns a condition that is satisfied when the object's text value matches the given regex.
static UiObject2Condition<Boolean> textNotEquals(String text)
static UiObject2Condition<Boolean> textStartsWith(String substring)
Returns a condition that is satisfied when the object's text value starts with the given string.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Until ()

Public Methods

public static UiObject2Condition<Boolean> checkable (boolean isCheckable)

Returns a condition that depends on a UiObject2's checkable state.

Parameters
isCheckable Whether the object should be checkable to satisfy this condition.

public static UiObject2Condition<Boolean> checked (boolean isChecked)

Returns a condition that depends on a UiObject2's checked state.

Parameters
isChecked Whether the object should be checked to satisfy this condition.

public static UiObject2Condition<Boolean> clickable (boolean isClickable)

Returns a condition that depends on a UiObject2's clickable state.

Parameters
isClickable Whether the object should be clickable to satisfy this condition.

public static UiObject2Condition<Boolean> descContains (String substring)

Returns a condition that is satisfied when the object's content description contains the given string.

public static UiObject2Condition<Boolean> descEndsWith (String substring)

Returns a condition that is satisfied when the object's content description ends with the given string.

public static UiObject2Condition<Boolean> descEquals (String contentDescription)

Returns a condition that is satisfied when the object's content description exactly matches the given string.

public static UiObject2Condition<Boolean> descMatches (Pattern regex)

Returns a condition that is satisfied when the object's content description matches the given regex.

public static UiObject2Condition<Boolean> descMatches (String regex)

Returns a condition that is satisfied when the object's content description matches the given regex.

public static UiObject2Condition<Boolean> descStartsWith (String substring)

Returns a condition that is satisfied when the object's content description starts with the given string.

public static UiObject2Condition<Boolean> enabled (boolean isEnabled)

Returns a condition that depends on a UiObject2's enabled state.

Parameters
isEnabled Whether the object should be enabled to satisfy this condition.

public static SearchCondition<UiObject2> findObject (BySelector selector)

Returns a SearchCondition that is satisfied when at least one element matching the selector can be found. The condition will return the first matching element.

public static SearchCondition<List<UiObject2>> findObjects (BySelector selector)

Returns a SearchCondition that is satisfied when at least one element matching the selector can be found. The condition will return all matching elements.

public static UiObject2Condition<Boolean> focusable (boolean isFocusable)

Returns a condition that depends on a UiObject2's focusable state.

Parameters
isFocusable Whether the object should be focusable to satisfy this condition.

public static UiObject2Condition<Boolean> focused (boolean isFocused)

Returns a condition that depends on a UiObject2's focused state.

Parameters
isFocused Whether the object should be focused to satisfy this condition.

public static SearchCondition<Boolean> gone (BySelector selector)

Returns a SearchCondition that is satisfied when no elements matching the selector can be found.

public static SearchCondition<Boolean> hasObject (BySelector selector)

Returns a SearchCondition that is satisfied when at least one element matching the selector can be found.

public static UiObject2Condition<Boolean> longClickable (boolean isLongClickable)

Returns a condition that depends on a UiObject2's long clickable state.

Parameters
isLongClickable Whether the object should be long clickable to satisfy this condition.

public static EventCondition<Boolean> newWindow ()

Returns a condition that depends on a new window having appeared.

public static EventCondition<Boolean> scrollFinished (Direction direction)

Returns a condition that depends on a scroll having reached the end in the given direction.

Parameters
direction The direction of the scroll.

public static UiObject2Condition<Boolean> scrollable (boolean isScrollable)

Returns a condition that depends on a UiObject2's scrollable state.

Parameters
isScrollable Whether the object should be scrollable to satisfy this condition.

public static UiObject2Condition<Boolean> selected (boolean isSelected)

Returns a condition that depends on a UiObject2's selected state.

Parameters
isSelected Whether the object should be selected to satisfy this condition.

public static UiObject2Condition<Boolean> textContains (String substring)

Returns a condition that is satisfied when the object's text value contains the given string.

public static UiObject2Condition<Boolean> textEndsWith (String substring)

Returns a condition that is satisfied when the object's text value ends with the given string.

public static UiObject2Condition<Boolean> textEquals (String text)

Returns a condition that is satisfied when the object's text value exactly matches the given string.

public static UiObject2Condition<Boolean> textMatches (String regex)

Returns a condition that is satisfied when the object's text value matches the given regex.

public static UiObject2Condition<Boolean> textMatches (Pattern regex)

Returns a condition that is satisfied when the object's text value matches the given regex.

public static UiObject2Condition<Boolean> textNotEquals (String text)

public static UiObject2Condition<Boolean> textStartsWith (String substring)

Returns a condition that is satisfied when the object's text value starts with the given string.