Handle tap action.
(self, action: dict, width: int, height: int)
| 128 | return ActionResult(False, False, f"App not found: {app_name}") |
| 129 | |
| 130 | def _handle_tap(self, action: dict, width: int, height: int) -> ActionResult: |
| 131 | """Handle tap action.""" |
| 132 | element = action.get("element") |
| 133 | if not element: |
| 134 | return ActionResult(False, False, "No element coordinates") |
| 135 | |
| 136 | x, y = self._convert_relative_to_absolute(element, width, height) |
| 137 | |
| 138 | # Check for sensitive operation |
| 139 | if "message" in action: |
| 140 | if not self.confirmation_callback(action["message"]): |
| 141 | return ActionResult( |
| 142 | success=False, |
| 143 | should_finish=True, |
| 144 | message="User cancelled sensitive operation", |
| 145 | ) |
| 146 | |
| 147 | device_factory = get_device_factory() |
| 148 | device_factory.tap(x, y, self.device_id) |
| 149 | return ActionResult(True, False) |
| 150 | |
| 151 | def _handle_type(self, action: dict, width: int, height: int) -> ActionResult: |
| 152 | """Handle text input action.""" |
nothing calls this directly
no test coverage detected