Tap at the specified coordinates. Args: x: X coordinate. y: Y coordinate. device_id: Optional HDC device ID. delay: Delay in seconds after tap. If None, uses configured default.
(
x: int, y: int, device_id: str | None = None, delay: float | None = None
)
| 78 | |
| 79 | |
| 80 | def tap( |
| 81 | x: int, y: int, device_id: str | None = None, delay: float | None = None |
| 82 | ) -> None: |
| 83 | """ |
| 84 | Tap at the specified coordinates. |
| 85 | |
| 86 | Args: |
| 87 | x: X coordinate. |
| 88 | y: Y coordinate. |
| 89 | device_id: Optional HDC device ID. |
| 90 | delay: Delay in seconds after tap. If None, uses configured default. |
| 91 | """ |
| 92 | if delay is None: |
| 93 | delay = TIMING_CONFIG.device.default_tap_delay |
| 94 | |
| 95 | hdc_prefix = _get_hdc_prefix(device_id) |
| 96 | |
| 97 | # HarmonyOS uses uitest uiInput click |
| 98 | _run_hdc_command( |
| 99 | hdc_prefix + ["shell", "uitest", "uiInput", "click", str(x), str(y)], |
| 100 | capture_output=True |
| 101 | ) |
| 102 | time.sleep(delay) |
| 103 | |
| 104 | |
| 105 | def double_tap( |
nothing calls this directly
no test coverage detected