Skip to content

Commit bb61d57

Browse files
authored
Merge pull request #307 from jvilla17/tap-with-numberoftaps
Add tap with number of taps keyword
2 parents a08bb55 + 9339e82 commit bb61d57

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

AppiumLibrary/keywords/_touch.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,18 @@ def tap(self, locator, x_offset=None, y_offset=None, count=1):
129129
el = self._element_find(locator, True, True)
130130
action = TouchAction(driver)
131131
action.tap(el,x_offset,y_offset, count).perform()
132+
133+
def tap_with_number_of_taps(self, locator, number_of_taps, number_of_touches):
134+
""" Sends one or more taps with one or more touch points.iOS only.
135+
136+
Args:
137+
- ``number_of_taps`` - The number of taps.
138+
- ``number_of_touches`` - The number of touch points.
139+
"""
140+
driver = self._current_application()
141+
element = self._element_find(locator, True, True)
142+
params = {'element': element, 'numberOfTaps': number_of_taps, 'numberOfTouches': number_of_touches}
143+
driver.execute_script("mobile: tapWithNumberOfTaps", params)
132144

133145
def click_a_point(self, x=0, y=0, duration=100):
134146
""" Click on a point"""

0 commit comments

Comments
 (0)