Skip to content

Commit 6a6d07e

Browse files
authored
fix: take care capybara case (#716)
fix: take care capybara case
1 parent 8522f49 commit 6a6d07e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/appium_lib/driver.rb

+16
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,27 @@ class Driver
105105
# }
106106
# Appium::Driver.new(opts, false).start_driver
107107
#
108+
# # Start iOS driver without global scope
109+
# opts = {
110+
# caps: {
111+
# platformName: :ios,
112+
# app: '/path/to/MyiOS.app'
113+
# },
114+
# appium_lib: {
115+
# wait_timeout: 30
116+
# },
117+
# global_driver: false
118+
# }
119+
# Appium::Driver.new(opts).start_driver
120+
#
108121
# @param opts [Object] A hash containing various options.
109122
# @param global_driver [Bool] A bool require global driver before initialize.
110123
# @return [Driver]
111124
def initialize(opts = {}, global_driver = nil)
112125
# TODO: set `global_driver = false` by default in the future.
126+
# Capybara can't put `global_driver` as the 2nd argument.
127+
global_driver = opts.delete :global_driver if global_driver.nil?
128+
113129
if global_driver.nil?
114130
warn '[DEPRECATION] Appium::Driver.new(opts) will not generate global driver by default.' \
115131
'If you would like to generate the global driver dy default, ' \

0 commit comments

Comments
 (0)