lib/appium_lib/driver.rb in appium_lib-12.2.0 vs lib/appium_lib/driver.rb in appium_lib-12.2.1
- old
+ new
@@ -168,11 +168,11 @@
@caps = @core.caps
@custom_url = @core.custom_url
@export_session = @core.export_session
@export_session_path = @core.export_session_path
- @default_wait = @core.default_wait
+ @default_wait = @core.default_wait || 0
@appium_port = @core.port
@appium_wait_timeout = @core.wait_timeout
@appium_wait_interval = @core.wait_interval
@listener = @core.listener
@appium_device = @core.device
@@ -279,11 +279,11 @@
caps: @core.caps,
automation_name: @core.automation_name,
custom_url: @core.custom_url,
export_session: @core.export_session,
export_session_path: @core.export_session_path,
- default_wait: @core.default_wait,
+ default_wait: @default_wait,
sauce_username: @sauce.username,
sauce_access_key: @sauce.access_key,
sauce_endpoint: @sauce.endpoint,
port: @core.port,
device: @core.device,
@@ -519,11 +519,11 @@
# @option http_client_ops [Hash] :open_timeout Custom open timeout for http client.
# @option http_client_ops [Hash] :read_timeout Custom read timeout for http client.
# @return [Selenium::WebDriver] the new global driver
def start_driver(http_client_ops =
{ http_client: ::Appium::Http::Default.new, open_timeout: 999_999, read_timeout: 999_999 })
- @core.quit_driver
+ @core.driver&.quit
# If automationName is set only in server side, then the following automation_name should be nil before
# starting driver.
automation_name = @core.automation_name
@@ -553,22 +553,22 @@
# Set implicit wait to zero.
def no_wait
@driver.manage.timeouts.implicit_wait = 0
end
- # Set implicit wait. Default to @core.default_wait.
+ # Set implicit wait. Default to @default_wait.
#
# @example
#
# set_wait 2
- # set_wait # @core.default_wait
+ # set_wait # @default_wait
#
#
# @param timeout [Integer] the timeout in seconds
# @return [void]
def set_wait(timeout = nil)
- timeout = @core.default_wait if timeout.nil?
+ timeout = @default_wait if timeout.nil?
@driver.manage.timeouts.implicit_wait = timeout
end
# Returns existence of element.
#
@@ -580,10 +580,10 @@
# wait to before checking existence
# @param [Integer] post_check The amount in seconds to set the
# wait to after checking existence
# @yield The block to call
# @return [Boolean]
- def exists(pre_check = 0, post_check = @core.default_wait)
+ def exists(pre_check = 0, post_check = @default_wait)
# do not uset set_wait here.
# it will cause problems with other methods reading the default_wait of 0
# which then gets converted to a 1 second wait.
@driver.manage.timeouts.implicit_wait = pre_check
# the element exists unless an error is raised.