Skip to content

Commit 445cf6a

Browse files
committed
update comments for touch actions
1 parent 1629f3a commit 445cf6a

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

lib/appium_lib_core/device/multi_touch.rb

+4-10
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,11 @@ module Core
99
#
1010
# @example
1111
#
12-
# action_1 = TouchAction.new.press(x: 45, y: 100).wait(5).release
13-
# action_2 = TouchAction.new.tap(element: el, x: 50, y:5, count: 3)
12+
# @driver = Appium::Core.for(self, opts).start_driver
13+
# action_1 = TouchAction.new(@driver).press(x: 45, y: 100).wait(5).release
14+
# action_2 = TouchAction.new(@driver).tap(element: el, x: 50, y:5, count: 3)
1415
#
15-
# multi_touch_action = MultiTouch.new
16-
# multi_touch_action.add action_1
17-
# multi_touch_action.add action_2
18-
# multi_touch_action.perform
19-
#
20-
# # with an arbitrary driver
21-
# driver = Appium::Core.for(self, opts).start_driver
22-
# multi_touch_action = MultiTouch.new(driver)
16+
# multi_touch_action = MultiTouch.new(@driver)
2317
# multi_touch_action.add action_1
2418
# multi_touch_action.add action_2
2519
# multi_touch_action.perform

lib/appium_lib_core/device/touch_actions.rb

+8-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ module Appium
44
#
55
# Each method returns the object itself, so calls can be chained.
66
#
7-
# ```ruby
8-
# action = TouchAction(@driver).new.press(x: 45, y: 100).wait(5).release
9-
# action.perform
10-
# action = TouchAction.new.swipe(....)
11-
# action.perform
12-
# ```
7+
# @example
8+
#
9+
# @driver = Appium::Core.for(self, opts).start_driver
10+
# action = TouchAction.new(@driver).press(x: 45, y: 100).wait(5).release
11+
# action.perform
12+
# action = TouchAction.new(@driver).swipe(....)
13+
# action.perform
14+
#
1315
module Core
1416
class TouchAction
1517
ACTIONS = %i(move_to long_press double_tap two_finger_tap press release tap wait perform).freeze

0 commit comments

Comments
 (0)