Skip to content

Commit 4c816e2

Browse files
committed
Fix wait
1 parent 9861a88 commit 4c816e2

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

lib/appium_lib/device/device.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def multi_touch(actions)
274274
end
275275
end
276276

277-
actions = Appium::TouchAction::ACTIONS + Appium::TouchAction::COMPLEX_ACTIONS
277+
actions = Appium::TouchAction::COMPLEX_ACTIONS
278278
actions.each do |method|
279279
delegate_from_appium_driver(method, Appium::TouchAction)
280280
end

lib/appium_lib/device/touch_actions.rb

+4-11
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,12 @@ module Appium
77
#
88
# ```ruby
99
# action = TouchAction.new.press(x: 45, y: 100).wait(5).release
10+
# action.perform
1011
class TouchAction
11-
ACTIONS = [:moveTo, :longPress, :press, :release, :tap, :wait, :perform]
12+
ACTIONS = [:move_to, :press_for_duration, :press, :release, :tap, :wait, :perform]
1213
COMPLEX_ACTIONS = [:swipe]
1314

1415
class << self
15-
ACTIONS.each do |action|
16-
define_method(action) do |*args|
17-
ta = TouchAction.new
18-
ta.send(action, args)
19-
ta.perform
20-
end
21-
end
22-
2316
COMPLEX_ACTIONS.each do |action|
2417
define_method(action) do |opts|
2518
auto_perform = opts.delete(:auto_perform) {|k| true}
@@ -41,7 +34,7 @@ def initialize
4134
# @option opts (integer) :x x co-ordinate to move to.
4235
# @option opts (integer) :y y co-ordinate to move to.
4336
# @option opts (WebDriver::Element) Element to scope this move within.
44-
def moveTo(opts)
37+
def move_to(opts)
4538
opts = args_with_ele_ref(opts)
4639
chain_method(:moveTo, opts)
4740
end
@@ -112,7 +105,7 @@ def swipe(opts)
112105

113106
self.press x: start_x, y: start_y
114107
self.wait(duration) if duration
115-
self.moveTo x: end_x, y: end_y
108+
self.move_to x: end_x, y: end_y
116109
self.release
117110
self
118111
end

0 commit comments

Comments
 (0)