public final class ViewActions
extends java.lang.Object
ViewActions
.Modifier and Type | Method and Description |
---|---|
static ViewAction |
clearText()
Returns an action that clears text on the view.
View constraints: must be displayed on screen |
static ViewAction |
click()
Returns an action that clicks the view.
View constraints: must be displayed on screen |
static ViewAction |
click(ViewAction rollbackAction)
Returns an action that performs a single click on the view.
|
static ViewAction |
closeSoftKeyboard()
Returns an action that closes soft keyboard.
|
static ViewAction |
doubleClick()
Returns an action that double clicks the view.
View preconditions: must be displayed on screen |
static ViewAction |
longClick()
Returns an action that long clicks the view.
View preconditions: must be displayed on screen |
static ViewAction |
pressBack()
Returns an action that clicks the back button.
|
static ViewAction |
pressImeActionButton()
Returns an action that presses the current action button (next, done, search, etc) on the IME
(Input Method Editor).
|
static ViewAction |
pressKey(EspressoKey key)
Returns an action that presses the specified key with the specified modifiers.
|
static ViewAction |
pressKey(int keyCode)
Returns an action that presses the key specified by the keyCode (eg.
|
static ViewAction |
pressMenuKey()
Returns an action that presses the hardware menu key.
|
static ViewAction |
scrollTo()
Returns an action that scrolls to the view.
View preconditions: must be a descendant of ScrollView must have visibility set to View.VISIBLE |
static ViewAction |
swipeLeft()
Returns an action that performs a swipe right-to-left across the vertical center of the
view.
View constraints: must be displayed on screen |
static ViewAction |
swipeRight()
Returns an action that performs a swipe left-to-right across the vertical center of the
view.
View constraints: must be displayed on screen |
static ViewAction |
typeText(java.lang.String stringToBeTyped)
Returns an action that selects the view (by clicking on it) and types the provided string into
the view.
|
static ViewAction |
typeTextIntoFocusedView(java.lang.String stringToBeTyped)
Returns an action that types the provided string into the view.
|
public static ViewAction clearText()
public static ViewAction click()
public static ViewAction click(ViewAction rollbackAction)
public static ViewAction swipeLeft()
public static ViewAction swipeRight()
public static ViewAction closeSoftKeyboard()
public static ViewAction pressImeActionButton()
public static ViewAction pressBack()
public static ViewAction pressMenuKey()
public static ViewAction pressKey(int keyCode)
public static ViewAction pressKey(EspressoKey key)
public static ViewAction doubleClick()
public static ViewAction longClick()
public static ViewAction scrollTo()
public static ViewAction typeTextIntoFocusedView(java.lang.String stringToBeTyped)
public static ViewAction typeText(java.lang.String stringToBeTyped)