Until
public class Until
The Until class provides factory methods for constructing common conditions.
Summary
Public methods |
|
|---|---|
static @NonNull UiObject2Condition<Boolean> |
checkable(boolean isCheckable)Returns a condition that depends on a |
static @NonNull UiObject2Condition<Boolean> |
checked(boolean isChecked)Returns a condition that depends on a |
static @NonNull UiObject2Condition<Boolean> |
clickable(boolean isClickable)Returns a condition that depends on a |
static @NonNull UiObject2Condition<Boolean> |
descContains(@NonNull String substring)Returns a condition that is satisfied when the object's content description contains the given string (case-sensitive). |
static @NonNull UiObject2Condition<Boolean> |
descEndsWith(@NonNull String substring)Returns a condition that is satisfied when the object's content description ends with the given string (case-sensitive). |
static @NonNull UiObject2Condition<Boolean> |
descEquals(@NonNull String contentDescription)Returns a condition that is satisfied when the object's content description exactly matches the given string (case-sensitive). |
static @NonNull UiObject2Condition<Boolean> |
descMatches(@NonNull Pattern regex)Returns a condition that is satisfied when the object's content description matches the given regex. |
static @NonNull UiObject2Condition<Boolean> |
descMatches(@NonNull String regex)Returns a condition that is satisfied when the object's content description matches the given regex. |
static @NonNull UiObject2Condition<Boolean> |
descStartsWith(@NonNull String substring)Returns a condition that is satisfied when the object's content description starts with the given string (case-sensitive). |
static @NonNull UiObject2Condition<Boolean> |
enabled(boolean isEnabled)Returns a condition that depends on a |
static @NonNull SearchCondition<UiObject2> |
findObject(@NonNull BySelector selector)Returns a |
static @NonNull SearchCondition<List<UiObject2>> |
findObjects(@NonNull BySelector selector)Returns a |
static @NonNull UiObject2Condition<Boolean> |
focusable(boolean isFocusable)Returns a condition that depends on a |
static @NonNull UiObject2Condition<Boolean> |
focused(boolean isFocused)Returns a condition that depends on a |
static @NonNull SearchCondition<Boolean> |
gone(@NonNull BySelector selector)Returns a |
static @NonNull SearchCondition<Boolean> |
hasObject(@NonNull BySelector selector)Returns a |
static @NonNull UiObject2Condition<Boolean> |
longClickable(boolean isLongClickable)Returns a condition that depends on a |
static @NonNull EventCondition<Boolean> |
Returns a condition that depends on a new window having appeared. |
static @NonNull EventCondition<Boolean> |
scrollFinished(@NonNull Direction direction)Returns a condition that depends on a scroll having reached the end in the given |
static @NonNull UiObject2Condition<Boolean> |
scrollable(boolean isScrollable)Returns a condition that depends on a |
static @NonNull UiObject2Condition<Boolean> |
selected(boolean isSelected)Returns a condition that depends on a |
static @NonNull UiObject2Condition<Boolean> |
textContains(@NonNull String substring)Returns a condition that is satisfied when the object's text value contains the given string (case-sensitive). |
static @NonNull UiObject2Condition<Boolean> |
textEndsWith(@NonNull String substring)Returns a condition that is satisfied when the object's text value ends with the given string (case-sensitive). |
static @NonNull UiObject2Condition<Boolean> |
textEquals(@NonNull String text)Returns a condition that is satisfied when the object's text value exactly matches the given string (case-sensitive). |
static @NonNull UiObject2Condition<Boolean> |
textMatches(@NonNull Pattern regex)Returns a condition that is satisfied when the object's text value matches the given regex. |
static @NonNull UiObject2Condition<Boolean> |
textMatches(@NonNull String regex)Returns a condition that is satisfied when the object's text value matches the given regex. |
static @NonNull UiObject2Condition<Boolean> |
textNotEquals(@NonNull String text)Returns a condition that is satisfied when the object's text value does not match the given string. |
static @NonNull UiObject2Condition<Boolean> |
textStartsWith(@NonNull String substring)Returns a condition that is satisfied when the object's text value starts with the given string (case-sensitive). |
Public methods
checkable
public static @NonNull UiObject2Condition<Boolean> checkable(boolean isCheckable)
Returns a condition that depends on a UiObject2's checkable state.
| Parameters | |
|---|---|
boolean isCheckable |
Whether the object should be checkable to satisfy this condition. |
checked
public static @NonNull UiObject2Condition<Boolean> checked(boolean isChecked)
Returns a condition that depends on a UiObject2's checked state.
| Parameters | |
|---|---|
boolean isChecked |
Whether the object should be checked to satisfy this condition. |
clickable
public static @NonNull UiObject2Condition<Boolean> clickable(boolean isClickable)
Returns a condition that depends on a UiObject2's clickable state.
| Parameters | |
|---|---|
boolean isClickable |
Whether the object should be clickable to satisfy this condition. |
descContains
public static @NonNull UiObject2Condition<Boolean> descContains(@NonNull String substring)
Returns a condition that is satisfied when the object's content description contains the given string (case-sensitive).
descEndsWith
public static @NonNull UiObject2Condition<Boolean> descEndsWith(@NonNull String substring)
Returns a condition that is satisfied when the object's content description ends with the given string (case-sensitive).
descEquals
public static @NonNull UiObject2Condition<Boolean> descEquals(@NonNull String contentDescription)
Returns a condition that is satisfied when the object's content description exactly matches the given string (case-sensitive).
descMatches
public static @NonNull UiObject2Condition<Boolean> descMatches(@NonNull Pattern regex)
Returns a condition that is satisfied when the object's content description matches the given regex.
descMatches
public static @NonNull UiObject2Condition<Boolean> descMatches(@NonNull String regex)
Returns a condition that is satisfied when the object's content description matches the given regex.
descStartsWith
public static @NonNull UiObject2Condition<Boolean> descStartsWith(@NonNull String substring)
Returns a condition that is satisfied when the object's content description starts with the given string (case-sensitive).
enabled
public static @NonNull UiObject2Condition<Boolean> enabled(boolean isEnabled)
Returns a condition that depends on a UiObject2's enabled state.
| Parameters | |
|---|---|
boolean isEnabled |
Whether the object should be enabled to satisfy this condition. |
findObject
public static @NonNull SearchCondition<UiObject2> findObject(@NonNull 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.
findObjects
public static @NonNull SearchCondition<List<UiObject2>> findObjects(@NonNull 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.
focusable
public static @NonNull UiObject2Condition<Boolean> focusable(boolean isFocusable)
Returns a condition that depends on a UiObject2's focusable state.
| Parameters | |
|---|---|
boolean isFocusable |
Whether the object should be focusable to satisfy this condition. |
focused
public static @NonNull UiObject2Condition<Boolean> focused(boolean isFocused)
Returns a condition that depends on a UiObject2's focused state.
| Parameters | |
|---|---|
boolean isFocused |
Whether the object should be focused to satisfy this condition. |
gone
public static @NonNull SearchCondition<Boolean> gone(@NonNull BySelector selector)
Returns a SearchCondition that is satisfied when no elements matching the selector can be found.
hasObject
public static @NonNull SearchCondition<Boolean> hasObject(@NonNull BySelector selector)
Returns a SearchCondition that is satisfied when at least one element matching the selector can be found.
longClickable
public static @NonNull UiObject2Condition<Boolean> longClickable(boolean isLongClickable)
Returns a condition that depends on a UiObject2's long clickable state.
| Parameters | |
|---|---|
boolean isLongClickable |
Whether the object should be long clickable to satisfy this condition. |
newWindow
public static @NonNull EventCondition<Boolean> newWindow()
Returns a condition that depends on a new window having appeared.
scrollFinished
public static @NonNull EventCondition<Boolean> scrollFinished(@NonNull Direction direction)
Returns a condition that depends on a scroll having reached the end in the given direction.
scrollable
public static @NonNull UiObject2Condition<Boolean> scrollable(boolean isScrollable)
Returns a condition that depends on a UiObject2's scrollable state.
| Parameters | |
|---|---|
boolean isScrollable |
Whether the object should be scrollable to satisfy this condition. |
selected
public static @NonNull UiObject2Condition<Boolean> selected(boolean isSelected)
Returns a condition that depends on a UiObject2's selected state.
| Parameters | |
|---|---|
boolean isSelected |
Whether the object should be selected to satisfy this condition. |
textContains
public static @NonNull UiObject2Condition<Boolean> textContains(@NonNull String substring)
Returns a condition that is satisfied when the object's text value contains the given string (case-sensitive).
textEndsWith
public static @NonNull UiObject2Condition<Boolean> textEndsWith(@NonNull String substring)
Returns a condition that is satisfied when the object's text value ends with the given string (case-sensitive).
textEquals
public static @NonNull UiObject2Condition<Boolean> textEquals(@NonNull String text)
Returns a condition that is satisfied when the object's text value exactly matches the given string (case-sensitive).
textMatches
public static @NonNull UiObject2Condition<Boolean> textMatches(@NonNull Pattern regex)
Returns a condition that is satisfied when the object's text value matches the given regex.
textMatches
public static @NonNull UiObject2Condition<Boolean> textMatches(@NonNull String regex)
Returns a condition that is satisfied when the object's text value matches the given regex.
textNotEquals
public static @NonNull UiObject2Condition<Boolean> textNotEquals(@NonNull String text)
Returns a condition that is satisfied when the object's text value does not match the given string.
textStartsWith
public static @NonNull UiObject2Condition<Boolean> textStartsWith(@NonNull String substring)
Returns a condition that is satisfied when the object's text value starts with the given string (case-sensitive).