mouse

Source code: mouse.py

A factory test to test the functionality of a mouse/trackpoint.

Description

A mouse/trackpoint test for moving and clicking.

Test Procedure

  1. Move the mouse in all 4 directions. The corresponding grid will become green once you move in that direction. The moving speed must be greater than move_threshold for the test to detect the moving direction of the mouse.

  2. Click the left, middle and right button of the mouse. The corresponding grid will become green once you click the button.

If you don’t pass the test in timeout_secs seconds, the test will fail.

Dependency

  • Based on Linux evdev.

Examples

To test mouse/trackpoint with default parameters, add this in test list:

{
  "pytest_name": "mouse"
}

If you want to change the time limit to 100 seconds:

{
  "pytest_name": "mouse",
  "args": {
    "timeout_secs": 100
  }
}

Test Arguments

Name

Type

Description

device_filter

int, str, None

(optional; default: None) Mouse input event id or evdev name. The test will probe for event id if it is not given.

timeout_secs

int

(optional; default: 20) Timeout for thte test.

button_updown_secs

float

(optional; default: 0.6) Max duration between button up and down.

move_threshold

int

(optional; default: 3) Speed threshold to detect the move direction