@@ -304,23 +304,52 @@ class Driver
304
304
# Return http client called in start_driver()
305
305
# @return [Selenium::WebDriver::Remote::Http::Default] the http client
306
306
attr_reader :http_client
307
+ # Return a time wait timeout
308
+ # Wait time for ::Appium::Common.wait or ::Appium::Common.wait_true.
309
+ # Provide Appium::Drive like { appium_lib: { wait_timeout: 20 } }
310
+ # @return [Integer]
311
+ attr_reader :appium_wait_timeout
312
+ # Return a time wait timeout
313
+ # Wait interval time for ::Appium::Common.wait or ::Appium::Common.wait_true.
314
+ # Provide Appium::Drive like { appium_lib: { wait_interval: 20 } }
315
+ # @return [Integer]
316
+ attr_reader :appium_wait_interval
307
317
308
318
# Creates a new driver
309
319
#
310
- # ```ruby
311
- # require 'rubygems'
312
- # require 'appium_lib'
320
+ # @example
313
321
#
314
- # # platformName takes a string or a symbol.
322
+ # ```ruby
323
+ # require 'rubygems'
324
+ # require 'appium_lib'
315
325
#
316
- # # Start iOS driver
317
- # opts = { caps: { platformName: :ios, app: '/path/to/MyiOS.app' } }
318
- # Appium::Driver.new(opts).start_driver
326
+ # # platformName takes a string or a symbol.
319
327
#
320
- # # Start Android driver
321
- # opts = { caps: { platformName: :android, app: '/path/to/my.apk' } }
322
- # Appium::Driver.new(opts).start_driver
323
- # ```
328
+ # # Start iOS driver
329
+ # opts = {
330
+ # caps: {
331
+ # platformName: :ios,
332
+ # app: '/path/to/MyiOS.app'
333
+ # },
334
+ # appium_lib: {
335
+ # wait_timeout: 30
336
+ # }
337
+ # }
338
+ # Appium::Driver.new(opts).start_driver
339
+ #
340
+ # # Start Android driver
341
+ # opts = {
342
+ # caps: {
343
+ # platformName: :android,
344
+ # app: '/path/to/my.apk'
345
+ # },
346
+ # appium_lib: {
347
+ # wait_timeout: 30,
348
+ # wait_interval: 1
349
+ # }
350
+ # }
351
+ # Appium::Driver.new(opts).start_driver
352
+ # ```
324
353
#
325
354
# @param opts [Object] A hash containing various options.
326
355
# @return [Driver]
@@ -344,6 +373,9 @@ def initialize(opts = {})
344
373
@sauce_access_key = appium_lib_opts . fetch :sauce_access_key , ENV [ 'SAUCE_ACCESS_KEY' ]
345
374
@sauce_access_key = nil if !@sauce_access_key || ( @sauce_access_key . is_a? ( String ) && @sauce_access_key . empty? )
346
375
@appium_port = appium_lib_opts . fetch :port , 4723
376
+ # timeout and interval used in ::Appium::Comm.wait/wait_true
377
+ @appium_wait_timeout = appium_lib_opts . fetch :wait_timeout , 30
378
+ @appium_wait_interval = appium_lib_opts . fetch :wait_interval , 0.5
347
379
348
380
# to pass it in Selenium.new.
349
381
# `listener = opts.delete(:listener)` is called in Selenium::Driver.new
@@ -408,7 +440,9 @@ def driver_attributes
408
440
port : @appium_port ,
409
441
device : @appium_device ,
410
442
debug : @appium_debug ,
411
- listener : @listener
443
+ listener : @listener ,
444
+ wait_timeout : @appium_wait_timeout ,
445
+ wait_interval : @appium_wait_interval
412
446
}
413
447
414
448
# Return duplicates so attributes are immutable
0 commit comments