Perform the long click action on the UI element(s) represented by the UI proxy. If this UI proxy represents a set of UI elements, the first one in the set is clicked and the anchor point of the UI element is used as the default one. Similar to click but press the screen fo
(self, duration=2.0)
| 405 | |
| 406 | @wait |
| 407 | def long_click(self, duration=2.0): |
| 408 | """ |
| 409 | Perform the long click action on the UI element(s) represented by the UI proxy. If this UI proxy represents a |
| 410 | set of UI elements, the first one in the set is clicked and the anchor point of the UI element is used as the |
| 411 | default one. Similar to click but press the screen for the given time interval and then release. |
| 412 | |
| 413 | Args: |
| 414 | duration (:py:obj:`float`): whole action duration. |
| 415 | |
| 416 | Return: |
| 417 | the same as :py:meth:`poco.pocofw.Poco.long_click`, depending on poco agent implementation. |
| 418 | """ |
| 419 | |
| 420 | try: |
| 421 | duration = float(duration) |
| 422 | except ValueError: |
| 423 | raise ValueError('Argument `duration` should be <float>. Got {}'.format(repr(duration))) |
| 424 | |
| 425 | pos_in_percentage = self.get_position(self._focus or 'center') |
| 426 | self.poco.pre_action('long_click', self, pos_in_percentage) |
| 427 | ret = self.poco.long_click(pos_in_percentage, duration) |
| 428 | self.poco.post_action('long_click', self, pos_in_percentage) |
| 429 | return ret |
| 430 | |
| 431 | @wait |
| 432 | def swipe(self, direction, focus=None, duration=0.5): |
nothing calls this directly
no test coverage detected