Skip to content

Commit f58dace

Browse files
authored
add some comments in examples for drivers (#767)
1 parent 0852bc7 commit f58dace

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

lib/appium_lib/common/multi_touch.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module Appium
1717
# multi_touch_action.perform
1818
#
1919
# # with an arbitrary driver
20-
# driver = Appium::Driver.new(opts, false).start_driver
20+
# driver = Appium::Driver.new(opts, false).start_driver # return an Appium::Core::Base::Driver instance
2121
# multi_touch_action = MultiTouch.new(driver)
2222
# multi_touch_action.add action_1
2323
# multi_touch_action.add action_2

lib/appium_lib/common/touch_actions.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module Appium
2323
#
2424
# @example
2525
#
26-
# driver = Appium::Driver.new(opts, false).start_driver
26+
# driver = Appium::Driver.new(opts, false).start_driver # return an Appium::Core::Base::Driver instance
2727
# action = TouchAction.new(driver).press(x: 45, y: 100).wait(5).release
2828
# action.perform
2929
# action = TouchAction.new(driver).swipe(....)

lib/appium_lib/driver.rb

+13-5
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ class Driver
9191
# wait_timeout: 30
9292
# }
9393
# }
94-
# Appium::Driver.new(opts, true).start_driver
94+
# appium_driver = Appium::Driver.new(opts, true)
95+
# appium_driver.start_driver
9596
#
9697
# # Start Android driver with global scope
9798
# opts = {
@@ -104,7 +105,8 @@ class Driver
104105
# wait_interval: 1
105106
# }
106107
# }
107-
# Appium::Driver.new(opts, true).start_driver
108+
# appium_driver = Appium::Driver.new(opts, true)
109+
# appium_driver.start_driver
108110
#
109111
# # Start iOS driver without global scope
110112
# opts = {
@@ -116,7 +118,8 @@ class Driver
116118
# wait_timeout: 30
117119
# }
118120
# }
119-
# Appium::Driver.new(opts, false).start_driver
121+
# appium_driver = Appium::Driver.new(opts, false)
122+
# appium_driver.start_driver
120123
#
121124
# # Start iOS driver without global scope
122125
# opts = {
@@ -129,7 +132,8 @@ class Driver
129132
# },
130133
# global_driver: false
131134
# }
132-
# Appium::Driver.new(opts).start_driver
135+
# appium_driver = Appium::Driver.new(opts)
136+
# appium_driver.start_driver
133137
#
134138
# @param opts [Object] A hash containing various options.
135139
# @param global_driver [Bool] A bool require global driver before initialize.
@@ -489,7 +493,8 @@ def window_size
489493
# wait_timeout: 30
490494
# }
491495
# }
492-
# Appium::Driver.new(opts).start_driver
496+
# appium_driver = Appium::Driver.new(opts) #=> return an Appium::Driver instance
497+
# appium_driver.start_driver #=> return an Appium::Core::Base::Driver
493498
#
494499
# @option http_client_ops [Hash] :http_client Custom HTTP Client
495500
# @option http_client_ops [Hash] :open_timeout Custom open timeout for http client.
@@ -591,13 +596,15 @@ def execute_script(script, *args)
591596
# @example
592597
#
593598
# @driver = Appium::Driver.new(opts, false)
599+
# @driver.start_driver
594600
# @driver.find_elements :predicate, yyy
595601
#
596602
# If you call `Appium.promote_appium_methods`, you can call `find_elements` directly.
597603
#
598604
# @example
599605
#
600606
# @driver = Appium::Driver.new(opts, false)
607+
# @driver.start_driver
601608
# @driver.find_elements :predicate, yyy
602609
#
603610
# If you call `Appium.promote_appium_methods`, you can call `find_elements` directly.
@@ -613,6 +620,7 @@ def find_elements(*args)
613620
# @example
614621
#
615622
# @driver = Appium::Driver.new(opts, false)
623+
# @driver.start_driver
616624
# @driver.find_element :accessibility_id, zzz
617625
#
618626
# If you call `Appium.promote_appium_methods`, you can call `find_element` directly.

0 commit comments

Comments
 (0)