@@ -36,12 +36,13 @@ def __init__(self, driver=None):
3636 def tap (self , element = None , x = None , y = None , count = 1 ):
3737 """Perform a tap action on the element
3838
39- : Args:
40- - element - the element to tap
41- - x - ( optional) x coordinate to tap, relative to the top left corner of the element.
42- - y - ( optional) y coordinate. If y is used, x must also be set, and vice versa
39+ Args:
40+ element (`WebElement`): the element to tap
41+ x (:obj:`int`, optional): x coordinate to tap, relative to the top left corner of the element.
42+ y (:obj:`int`, optional): y coordinate. If y is used, x must also be set, and vice versa
4343
44- :Usage:
44+ Returns:
45+ `TouchAction`: self instance
4546 """
4647 opts = self ._get_opts (element , x , y )
4748 opts ['count' ] = count
@@ -52,26 +53,44 @@ def tap(self, element=None, x=None, y=None, count=1):
5253 def press (self , el = None , x = None , y = None , pressure = None ):
5354 """Begin a chain with a press down action at a particular element or point
5455
55- : Args:
56- - el - ( optional) the element to press
57- - x - ( optional) x coordiate to press. If y is used, x must also be set
58- - y - ( optional) y coordiate to press. If x is used, y must also be set
59- - pressure - ( optional) [iOS Only] press as force touch. Read the description of `force` property on Apple's UITouch class
56+ Args:
57+ el (:obj:`WebElement`, optional): the element to press
58+ x (:obj:`int`, optional): x coordiate to press. If y is used, x must also be set
59+ y (:obj:`int`, optional): y coordiate to press. If x is used, y must also be set
60+ pressure (:obj:`float`, optional): [iOS Only] press as force touch. Read the description of `force` property on Apple's UITouch class
6061 (https://developer.apple.com/documentation/uikit/uitouch?language=objc) for more details on possible value ranges.
62+
63+ Returns:
64+ `TouchAction`: self instance
6165 """
6266 self ._add_action ('press' , self ._get_opts (el , x , y , pressure = pressure ))
6367
6468 return self
6569
6670 def long_press (self , el = None , x = None , y = None , duration = 1000 ):
6771 """Begin a chain with a press down that lasts `duration` milliseconds
72+
73+ Args:
74+ el (:obj:`WebElement`, optional): the element to press
75+ x (:obj:`int`, optional): x coordiate to press. If y is used, x must also be set
76+ y (:obj:`int`, optional): y coordiate to press. If x is used, y must also be set
77+ duration (:obj:`int`, optional): Duration to press
78+
79+ Returns:
80+ `TouchAction`: self instance
6881 """
6982 self ._add_action ('longPress' , self ._get_opts (el , x , y , duration ))
7083
7184 return self
7285
7386 def wait (self , ms = 0 ):
7487 """Pause for `ms` milliseconds.
88+
89+ Args:
90+ ms (int): The time to pause
91+
92+ Returns:
93+ `TouchAction`: self instance
7594 """
7695 if ms is None :
7796 ms = 0
@@ -84,20 +103,34 @@ def wait(self, ms=0):
84103
85104 def move_to (self , el = None , x = None , y = None ):
86105 """Move the pointer from the previous point to the element or point specified
106+
107+ Args:
108+ el (:obj:`WebElement`, optional): the element to be moved to
109+ x (:obj:`int`, optional): x coordiate to be moved to. If y is used, x must also be set
110+ y (:obj:`int`, optional): y coordiate to be moved to. If x is used, y must also be set
111+
112+ Returns:
113+ `TouchAction`: self instance
87114 """
88115 self ._add_action ('moveTo' , self ._get_opts (el , x , y ))
89116
90117 return self
91118
92119 def release (self ):
93120 """End the action by lifting the pointer off the screen
121+
122+ Returns:
123+ `TouchAction`: self instance
94124 """
95125 self ._add_action ('release' , {})
96126
97127 return self
98128
99129 def perform (self ):
100130 """Perform the action by sending the commands to the server to be operated upon
131+
132+ Returns:
133+ `TouchAction`: self instance
101134 """
102135 params = {'actions' : self ._actions }
103136 self ._driver .execute (Command .TOUCH_ACTION , params )
0 commit comments