Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions appium/webdriver/common/touch_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def press(self, el=None, x=None, y=None):
def long_press(self, el=None, x=None, y=None, duration=1000):
"""Begin a chain with a press down that lasts `duration` milliseconds
"""
self._add_action('longPress', self._get_opts(el, x, y))
self._add_action('longPress', self._get_opts(el, x, y, duration))

return self

Expand Down Expand Up @@ -112,7 +112,7 @@ def _add_action(self, action, options):
}
self._actions.append(gesture)

def _get_opts(self, element, x, y):
def _get_opts(self, element, x, y, duration = None):
opts = {}
if element is not None:
opts['element'] = element.id
Expand All @@ -122,6 +122,9 @@ def _get_opts(self, element, x, y):
x, y = None, None
opts['x'] = x
opts['y'] = y

if duration is not None:
opts['duration'] = duration

return opts