poco.utils.airtest.input module
- class AirtestInput[source]
Bases:
InputInterface
- applyMotionEvents(events)[source]
Apply a motion event on the device touch panel
- Parameters:
events (
list
) – list of events. each event is MotionEvent data (['u/d/m/s', (x, y), contact_id]
)
- click(x, y)[source]
Perform click action as simulated input on target device. Coordinates arguments are all in range of 0~1.
- Parameters:
y (
float
) – y-coordinatex (
float
) – x-coordinate
- double_click(x, y)[source]
Perform click action as simulated input on target device. Coordinates arguments are all in range of 0~1.
- Parameters:
y (
float
) – y-coordinatex (
float
) – x-coordinate
- getTouchDownDuration()[source]
Get touch down duration for each click operation. Each implementation should provide a default value.
- Returns:
the touch down duration in seconds
- Return type:
float
- longClick(x, y, duration=2.0)[source]
Perform press action as simulated input on target device within given seconds. Coordinates arguments are all in range of 0~1.
- Parameters:
x (
float
) – x-coordinatey (
float
) – y-coordinateduration (
float
) – time interval to perform the action
- setTouchDownDuration(duration)[source]
Set touch down duration for each click operation.
- Parameters:
duration (
float
) – the duration in seconds
- swipe(x1, y1, x2, y2, duration=2.0)[source]
Perform swipe action as simulated input on target device from point A to B within given time interval to perform the action. Coordinates arguments are all in range of 0~1.
- Parameters:
x1 (
float
) – x-coordinate of the start pointy1 (
float
) – y-coordinate of the start pointx2 (
float
) – x-coordinate of the end pointy2 (
float
) – y-coordinate of the end pointduration (
float
) – time interval to perform the swipe action