lib/appium_lib/driver.rb in appium_lib-9.1.1 vs lib/appium_lib/driver.rb in appium_lib-9.1.2
- old
+ new
@@ -451,10 +451,23 @@
# @return [Hash]
def appium_server_version
driver.remote_status
end
+ # Returns the client's version info
+ #
+ # ```ruby
+ # {
+ # "version" => "9.1.1"
+ # }
+ # ```
+ #
+ # @return [Hash]
+ def appium_client_version
+ { version: ::Appium::VERSION }
+ end
+
# Converts app_path to an absolute path.
#
# opts is the full options hash (caps and appium_lib). If server_url is set
# then the app path is used as is.
#
@@ -614,19 +627,19 @@
# wait to before checking existance
# @param post_check [Integer] the amount in seconds to set the
# wait to after checking existance
# @param search_block [Block] the block to call
# @return [Boolean]
- def exists(pre_check = 0, post_check = @default_wait, &search_block)
+ 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.
exists = true
begin
- search_block.call # search for element
+ yield # search for element
rescue
exists = false # error means it's not there
end
# restore wait