Skip to content

Commit acdcff0

Browse files
authored
Merge pull request #376 from sergey-plevako-badoo/add_double_tap_and_two_finger_tap
Added double_tap and two_finger_tap to Appium::TouchAction
2 parents ac03116 + eea3a6f commit acdcff0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

lib/appium_lib/device/touch_actions.rb

+23
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,29 @@ def tap(opts)
8484
chain_method(:tap, args)
8585
end
8686

87+
# Double tap an element on the screen
88+
#
89+
# @option opts [WebDriver::Element] :element (Optional) Element to restrict scope too.
90+
# @option opts [integer] :x x co-ordinate to tap
91+
# @option opts [integer] :y y co-ordinate to tap
92+
93+
def double_tap(opts)
94+
args = opts.select { |k, _v| [:element, :x, :y].include? k }
95+
args = args_with_ele_ref(args)
96+
chain_method(:doubleTap, args) # doubleTap is what the appium server expects
97+
end
98+
99+
# Two finger tap an element on the screen
100+
#
101+
# @option opts [WebDriver::Element] :element (Optional) Element to restrict scope too.
102+
# @option opts [integer] :x x co-ordinate to tap
103+
# @option opts [integer] :y y co-ordinate to tap
104+
def two_finger_tap(opts)
105+
args = opts.select { |k, _v| [:element, :x, :y].include? k }
106+
args = args_with_ele_ref(args)
107+
chain_method(:twoFingerTap, args) # twoFingerTap is what the appium server expects
108+
end
109+
87110
# Pause for a number of milliseconds before the next action
88111
# @param milliseconds [integer] Number of milliseconds to pause for
89112
def wait(milliseconds)

0 commit comments

Comments
 (0)