(self, x=-1, y=-1, selector=None)
| 4130 | self.touch(x=x, y=y, selector=selector) |
| 4131 | |
| 4132 | def touch(self, x=-1, y=-1, selector=None): |
| 4133 | if self.uiAutomatorHelper: |
| 4134 | if selector: |
| 4135 | if DEBUG_UI_AUTOMATOR_HELPER: |
| 4136 | print("Touching View by selector=%s through UiAutomatorHelper" % selector, file=sys.stderr) |
| 4137 | # FIXME: is `selector` a `bySlector`? |
| 4138 | object_ref = self.uiAutomatorHelper.ui_device.find_object(by_selector=selector) |
| 4139 | if DEBUG_UI_AUTOMATOR_HELPER: |
| 4140 | print("♦️ object_ref=%s" % object_ref, file=sys.stderr) |
| 4141 | self.uiAutomatorHelper.ui_object2.click(oid=object_ref.oid) |
| 4142 | else: |
| 4143 | if DEBUG_UI_AUTOMATOR_HELPER: |
| 4144 | print("Touching (%d, %d) through UiAutomatorHelper" % (x, y), file=sys.stderr) |
| 4145 | self.uiAutomatorHelper.ui_device.click(x=int(x), y=int(y)) |
| 4146 | else: |
| 4147 | self.device.touch(x, y) |
| 4148 | |
| 4149 | def longTouch(self, x=-1, y=-1, selector=None): |
| 4150 | if self.uiAutomatorHelper: |
no test coverage detected