Skip to content

Commit 471d703

Browse files
author
Qualify
committed
Swipe By Percent added duration optional variable
1 parent b04aec0 commit 471d703

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/AppiumLibrary/keywords/_touch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def swipe(self, start_x, start_y, offset_x, offset_y, duration=1000):
4747
driver = self._current_application()
4848
driver.swipe(start_x, start_y, offset_x, offset_y, duration)
4949

50-
def swipe_by_percent(self, start_x, start_y, end_x, end_y):
50+
def swipe_by_percent(self, start_x, start_y, end_x, end_y, duration=1000):
5151
"""
5252
Swipe from one percent of the screen to another percent, for an optional duration.
5353
Normal swipe fails to scale for different screen resolutions, this can be avoided using percent.
@@ -77,9 +77,9 @@ def swipe_by_percent(self, start_x, start_y, end_x, end_y):
7777
y_offset = y_end - y_start
7878
platform = self._get_platform()
7979
if platform == 'android':
80-
self.swipe(x_start, y_start, x_end, y_end)
80+
self.swipe(x_start, y_start, x_end, y_end, duration)
8181
else:
82-
self.swipe(x_start, y_start, x_offset, y_offset)
82+
self.swipe(x_start, y_start, x_offset, y_offset, duration)
8383

8484
def scroll(self, start_locator, end_locator):
8585
"""

0 commit comments

Comments
 (0)