class Until


The Until class provides factory methods for constructing common conditions.

Summary

Public functions

java-static UiObject2Condition<Boolean!>
checkable(isCheckable: Boolean)

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

java-static UiObject2Condition<Boolean!>
checked(isChecked: Boolean)

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

java-static UiObject2Condition<Boolean!>
clickable(isClickable: Boolean)

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

java-static UiObject2Condition<Boolean!>
descContains(substring: String)

Returns a condition that is satisfied when the object's content description contains the given string (case-sensitive).

java-static UiObject2Condition<Boolean!>
descEndsWith(substring: String)

Returns a condition that is satisfied when the object's content description ends with the given string (case-sensitive).

java-static UiObject2Condition<Boolean!>
descEquals(contentDescription: String)

Returns a condition that is satisfied when the object's content description exactly matches the given string (case-sensitive).

java-static UiObject2Condition<Boolean!>

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

java-static UiObject2Condition<Boolean!>

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

java-static UiObject2Condition<Boolean!>
descStartsWith(substring: String)

Returns a condition that is satisfied when the object's content description starts with the given string (case-sensitive).

java-static UiObject2Condition<Boolean!>
enabled(isEnabled: Boolean)

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

java-static SearchCondition<UiObject2!>

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

java-static SearchCondition<(Mutable)List<UiObject2!>!>

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

java-static UiObject2Condition<Boolean!>
focusable(isFocusable: Boolean)

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

java-static UiObject2Condition<Boolean!>
focused(isFocused: Boolean)

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

java-static SearchCondition<Boolean!>
gone(selector: BySelector)

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

java-static SearchCondition<Boolean!>
hasObject(selector: BySelector)

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

java-static UiObject2Condition<Boolean!>
longClickable(isLongClickable: Boolean)

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

java-static EventCondition<Boolean!>

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

java-static EventCondition<Boolean!>

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

java-static UiObject2Condition<Boolean!>
scrollable(isScrollable: Boolean)

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

java-static UiObject2Condition<Boolean!>
selected(isSelected: Boolean)

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

java-static UiObject2Condition<Boolean!>
textContains(substring: String)

Returns a condition that is satisfied when the object's text value contains the given string (case-sensitive).

java-static UiObject2Condition<Boolean!>
textEndsWith(substring: String)

Returns a condition that is satisfied when the object's text value ends with the given string (case-sensitive).

java-static UiObject2Condition<Boolean!>

Returns a condition that is satisfied when the object's text value exactly matches the given string (case-sensitive).

java-static UiObject2Condition<Boolean!>

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

java-static UiObject2Condition<Boolean!>

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

java-static UiObject2Condition<Boolean!>

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

java-static UiObject2Condition<Boolean!>
textStartsWith(substring: String)

Returns a condition that is satisfied when the object's text value starts with the given string (case-sensitive).

Public functions

checkable

Added in 2.2.0
java-static fun checkable(isCheckable: Boolean): UiObject2Condition<Boolean!>

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

Parameters
isCheckable: Boolean

Whether the object should be checkable to satisfy this condition.

checked

Added in 2.2.0
java-static fun checked(isChecked: Boolean): UiObject2Condition<Boolean!>

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

Parameters
isChecked: Boolean

Whether the object should be checked to satisfy this condition.

clickable

Added in 2.2.0
java-static fun clickable(isClickable: Boolean): UiObject2Condition<Boolean!>

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

Parameters
isClickable: Boolean

Whether the object should be clickable to satisfy this condition.

descContains

Added in 2.2.0
java-static fun descContains(substring: String): UiObject2Condition<Boolean!>

Returns a condition that is satisfied when the object's content description contains the given string (case-sensitive).

descEndsWith

Added in 2.2.0
java-static fun descEndsWith(substring: String): UiObject2Condition<Boolean!>

Returns a condition that is satisfied when the object's content description ends with the given string (case-sensitive).

descEquals

Added in 2.2.0
java-static fun descEquals(contentDescription: String): UiObject2Condition<Boolean!>

Returns a condition that is satisfied when the object's content description exactly matches the given string (case-sensitive).

descMatches

Added in 2.2.0
java-static fun descMatches(regex: Pattern): UiObject2Condition<Boolean!>

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

descMatches

Added in 2.2.0
java-static fun descMatches(regex: String): UiObject2Condition<Boolean!>

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

descStartsWith

Added in 2.2.0
java-static fun descStartsWith(substring: String): UiObject2Condition<Boolean!>

Returns a condition that is satisfied when the object's content description starts with the given string (case-sensitive).

enabled

Added in 2.2.0
java-static fun enabled(isEnabled: Boolean): UiObject2Condition<Boolean!>

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

Parameters
isEnabled: Boolean

Whether the object should be enabled to satisfy this condition.

findObject

Added in 2.2.0
java-static fun findObject(selector: BySelector): SearchCondition<UiObject2!>

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

Added in 2.2.0
java-static fun findObjects(selector: BySelector): SearchCondition<(Mutable)List<UiObject2!>!>

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

Added in 2.2.0
java-static fun focusable(isFocusable: Boolean): UiObject2Condition<Boolean!>

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

Parameters
isFocusable: Boolean

Whether the object should be focusable to satisfy this condition.

focused

Added in 2.2.0
java-static fun focused(isFocused: Boolean): UiObject2Condition<Boolean!>

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

Parameters
isFocused: Boolean

Whether the object should be focused to satisfy this condition.

gone

Added in 2.2.0
java-static fun gone(selector: BySelector): SearchCondition<Boolean!>

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

hasObject

Added in 2.2.0
java-static fun hasObject(selector: BySelector): SearchCondition<Boolean!>

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

longClickable

Added in 2.2.0
java-static fun longClickable(isLongClickable: Boolean): UiObject2Condition<Boolean!>

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

Parameters
isLongClickable: Boolean

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

newWindow

Added in 2.2.0
java-static fun newWindow(): EventCondition<Boolean!>

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

scrollFinished

Added in 2.2.0
java-static fun scrollFinished(direction: Direction): EventCondition<Boolean!>

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

Parameters
direction: Direction

The direction of the scroll.

scrollable

Added in 2.2.0
java-static fun scrollable(isScrollable: Boolean): UiObject2Condition<Boolean!>

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

Parameters
isScrollable: Boolean

Whether the object should be scrollable to satisfy this condition.

selected

Added in 2.2.0
java-static fun selected(isSelected: Boolean): UiObject2Condition<Boolean!>

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

Parameters
isSelected: Boolean

Whether the object should be selected to satisfy this condition.

textContains

Added in 2.2.0
java-static fun textContains(substring: String): UiObject2Condition<Boolean!>

Returns a condition that is satisfied when the object's text value contains the given string (case-sensitive).

textEndsWith

Added in 2.2.0
java-static fun textEndsWith(substring: String): UiObject2Condition<Boolean!>

Returns a condition that is satisfied when the object's text value ends with the given string (case-sensitive).

textEquals

Added in 2.2.0
java-static fun textEquals(text: String): UiObject2Condition<Boolean!>

Returns a condition that is satisfied when the object's text value exactly matches the given string (case-sensitive).

textMatches

Added in 2.2.0
java-static fun textMatches(regex: Pattern): UiObject2Condition<Boolean!>

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

textMatches

Added in 2.2.0
java-static fun textMatches(regex: String): UiObject2Condition<Boolean!>

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

textNotEquals

Added in 2.2.0
java-static fun textNotEquals(text: String): UiObject2Condition<Boolean!>

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

textStartsWith

Added in 2.2.0
java-static fun textStartsWith(substring: String): UiObject2Condition<Boolean!>

Returns a condition that is satisfied when the object's text value starts with the given string (case-sensitive).