poco.utils.airtest.input module

class AirtestInput[源代码]

基类:InputInterface

applyMotionEvents(events)[源代码]

Apply a motion event on the device touch panel

参数:

events (list) – list of events. each event is MotionEvent data (['u/d/m/s', (x, y), contact_id])

click(x, y)[源代码]

Perform click action as simulated input on target device. Coordinates arguments are all in range of 0~1.

参数:
  • y (float) – y-coordinate

  • x (float) – x-coordinate

double_click(x, y)[源代码]

Perform click action as simulated input on target device. Coordinates arguments are all in range of 0~1.

参数:
  • y (float) – y-coordinate

  • x (float) – x-coordinate

getTouchDownDuration()[源代码]

Get touch down duration for each click operation. Each implementation should provide a default value.

返回:

the touch down duration in seconds

返回类型:

float

get_target_pos(x, y)[源代码]

get real time resolution on device of target (x,y)

longClick(x, y, duration=2.0)[源代码]

Perform press action as simulated input on target device within given seconds. Coordinates arguments are all in range of 0~1.

参数:
  • x (float) – x-coordinate

  • y (float) – y-coordinate

  • duration (float) – time interval to perform the action

setTouchDownDuration(duration)[源代码]

Set touch down duration for each click operation.

参数:

duration (float) – the duration in seconds

swipe(x1, y1, x2, y2, duration=2.0)[源代码]

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.

参数:
  • x1 (float) – x-coordinate of the start point

  • y1 (float) – y-coordinate of the start point

  • x2 (float) – x-coordinate of the end point

  • y2 (float) – y-coordinate of the end point

  • duration (float) – time interval to perform the swipe action