MCPcopy
hub / github.com/AirtestProject/Poco / double_click

Method double_click

poco/proxy.py:375–404  ·  view source on GitHub ↗

Perform the double 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. It is also possible to click another poi

(self, focus=None, sleep_interval=None)

Source from the content-addressed store, hash-verified

373
374 @wait
375 def double_click(self, focus=None, sleep_interval=None):
376 """
377 Perform the double click action on the UI element(s) represented by the UI proxy. If this UI proxy represents a set of
378 UI elements, the first one in the set is clicked and the anchor point of the UI element is used as the default
379 one. It is also possible to click another point offset by providing ``focus`` argument.
380
381 See ``CoordinateSystem`` for more details.
382
383 Args:
384 focus (2-:obj:`tuple`/2-:obj:`list`/:obj:`str`): an offset point (x, y) from the top left corner of the UI
385 element(s), values must be in range of 0~1. This argument can be also specified by 'anchor' or 'center'.
386 'Center' means to double click the center of bounding box of UI element.
387 sleep_interval: number of seconds to wait after this action. Default is None which is the default sleep
388 interval. This value can be configured by Poco initialization. See configuration at poco
389 :py:class:`initialization <poco.pocofw.Poco>` for more details.
390
391 Raises:
392 PocoNoSuchNodeException: raised when the UI element does not exist
393 """
394
395 focus = focus or self._focus or 'center'
396 pos_in_percentage = self.get_position(focus)
397 self.poco.pre_action('double_click', self, pos_in_percentage)
398 ret = self.poco.double_click(pos_in_percentage)
399 if sleep_interval:
400 time.sleep(sleep_interval)
401 else:
402 self.poco.wait_stable()
403 self.poco.post_action('double_click', self, pos_in_percentage)
404 return ret
405
406 @wait
407 def long_click(self, duration=2.0):

Callers

nothing calls this directly

Calls 4

get_positionMethod · 0.95
pre_actionMethod · 0.80
wait_stableMethod · 0.80
post_actionMethod · 0.80

Tested by

no test coverage detected