public class TouchAction<T extends TouchAction<T>> extends java.lang.Object implements PerformsActions<T>
Modifier and Type | Class and Description |
---|---|
protected class |
TouchAction.ActionParameter
Just holds values to eventually return the parameters required for the mjsonwp.
|
Modifier and Type | Field and Description |
---|---|
protected com.google.common.collect.ImmutableList.Builder<TouchAction.ActionParameter> |
parameterBuilder |
Constructor and Description |
---|
TouchAction(PerformsTouchActions performsTouchActions) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel this action, if it was partially completed by the performsTouchActions.
|
protected T |
clearParameters()
Clears all the existing action parameters and resets the instance to the initial state.
|
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> |
getParameters()
Get the mjsonwp parameters for this Action.
|
T |
longPress(int x,
int y)
Deprecated.
use
longPress(PointOption) instead |
T |
longPress(int x,
int y,
java.time.Duration duration)
Deprecated.
use
longPress(LongPressOptions) instead |
T |
longPress(LongPressOptions longPressOptions)
Press and hold the at the center of an element until the context menu event has fired.
|
T |
longPress(PointOption longPressOptions)
Press and hold the at the center of an element until the context menu event has fired.
|
T |
longPress(WebElement el)
Deprecated.
use
longPress(PointOption) instead |
T |
longPress(WebElement el,
java.time.Duration duration)
Deprecated.
use
longPress(LongPressOptions) instead |
T |
longPress(WebElement el,
int x,
int y)
Deprecated.
use
longPress(PointOption) instead |
T |
longPress(WebElement el,
int x,
int y,
java.time.Duration duration)
Deprecated.
use
longPress(LongPressOptions) instead |
T |
moveTo(int x,
int y)
Deprecated.
moveTo(PointOption) instead |
T |
moveTo(PointOption moveToOptions)
Moves current touch to a new position.
|
T |
moveTo(WebElement el)
Deprecated.
moveTo(PointOption) instead |
T |
moveTo(WebElement el,
int x,
int y)
Deprecated.
moveTo(PointOption) instead |
T |
perform()
Perform this chain of actions on the performsTouchActions.
|
T |
press(int x,
int y)
Deprecated.
use
press(PointOption) instead |
T |
press(PointOption pressOptions)
Press action on the screen.
|
T |
press(WebElement el)
Deprecated.
use
press(PointOption) instead |
T |
press(WebElement el,
int x,
int y)
Deprecated.
use
press(PointOption) instead |
T |
release()
Remove the current touching implement from the screen (withdraw your touch).
|
T |
tap(int x,
int y)
Deprecated.
use
tap(PointOption) instead. |
T |
tap(PointOption tapOptions)
Tap on a position.
|
T |
tap(TapOptions tapOptions)
Tap on an element.
|
T |
tap(WebElement el)
Deprecated.
use
tap(PointOption) instead. |
T |
tap(WebElement el,
int x,
int y)
Deprecated.
use
tap(PointOption) instead. |
T |
waitAction()
A wait action, used as a NOP in multi-chaining.
|
T |
waitAction(java.time.Duration duration)
Deprecated.
use
waitAction(WaitOptions) instead. |
T |
waitAction(WaitOptions waitOptions)
Waits for specified amount of time to pass before continue to next touch action.
|
protected com.google.common.collect.ImmutableList.Builder<TouchAction.ActionParameter> parameterBuilder
public TouchAction(PerformsTouchActions performsTouchActions)
public T press(PointOption pressOptions)
pressOptions
- see PointOption
and ElementOption
.@Deprecated public T press(WebElement el)
press(PointOption)
insteadel
- element to press on.@Deprecated public T press(int x, int y)
press(PointOption)
insteadx
- x coordinate.y
- y coordinate.@Deprecated public T press(WebElement el, int x, int y)
press(PointOption)
insteadel
- element to press on.x
- x offset.y
- y offset.public T release()
public T moveTo(PointOption moveToOptions)
moveToOptions
- see PointOption
and ElementOption
@Deprecated public T moveTo(WebElement el)
moveTo(PointOption)
insteadel
- element to move to.@Deprecated public T moveTo(int x, int y)
moveTo(PointOption)
insteadx
- change in x coordinate to move through.y
- change in y coordinate to move through.@Deprecated public T moveTo(WebElement el, int x, int y)
moveTo(PointOption)
insteadel
- element to move current touch to.x
- x offset.y
- y offset.public T tap(TapOptions tapOptions)
tapOptions
- see TapOptions
.public T tap(PointOption tapOptions)
tapOptions
- see PointOption
and ElementOption
@Deprecated public T tap(WebElement el)
tap(PointOption)
instead.el
- element to tap.@Deprecated public T tap(int x, int y)
tap(PointOption)
instead.x
- x coordinate.y
- y coordinate.@Deprecated public T tap(WebElement el, int x, int y)
tap(PointOption)
instead.el
- element to tap.x
- x offset.y
- y offset.public T waitAction()
public T waitAction(WaitOptions waitOptions)
waitOptions
- see WaitOptions
.@Deprecated public T waitAction(java.time.Duration duration)
waitAction(WaitOptions)
instead.duration
- of the wait action. Minimum time reolution unit is one millisecond.public T longPress(LongPressOptions longPressOptions)
longPressOptions
- see LongPressOptions
.public T longPress(PointOption longPressOptions)
longPressOptions
- see PointOption
and ElementOption
.@Deprecated public T longPress(WebElement el)
longPress(PointOption)
insteadel
- element to long-press.@Deprecated public T longPress(WebElement el, java.time.Duration duration)
longPress(LongPressOptions)
insteadel
- element to long-press.duration
- of the long-press. Minimum time resolution unit is one millisecond.@Deprecated public T longPress(int x, int y)
longPress(PointOption)
insteadx
- x coordinate.y
- y coordinate.@Deprecated public T longPress(int x, int y, java.time.Duration duration)
longPress(LongPressOptions)
insteadx
- x coordinate.y
- y coordinate.duration
- of the long-press. Minimum time resolution unit is one millisecond.@Deprecated public T longPress(WebElement el, int x, int y)
longPress(PointOption)
insteadel
- element to long-press.x
- x offset.y
- y offset.@Deprecated public T longPress(WebElement el, int x, int y, java.time.Duration duration)
longPress(LongPressOptions)
insteadel
- element to long-press.x
- x offset.y
- y offset.duration
- of the long-press. Minimum time resolution unit is one millisecond.public void cancel()
public T perform()
perform
in interface PerformsActions<T extends TouchAction<T>>
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getParameters()
protected T clearParameters()