lib/appium_lib/driver.rb in appium_lib-9.3.0 vs lib/appium_lib/driver.rb in appium_lib-9.3.1

- old
+ new

@@ -53,11 +53,12 @@ end module Appium REQUIRED_VERSION_XCUITEST = '1.6.0'.freeze - # Load arbitrary text (toml format) + # Load arbitrary text ([toml format](https://github.com/toml-lang/toml)) + # The toml is parsed by https://github.com/fbernier/tomlrb . # # ``` # [caps] # app = "path/to/app" # @@ -74,11 +75,11 @@ def self.load_settings(opts = {}) raise 'opts must be a hash' unless opts.is_a? Hash raise 'opts must not be empty' if opts.empty? toml = opts[:file] - raise 'Must pass file' unless toml + raise 'Must pass a capability file which has [caps] and [appium_lib]' unless toml verbose = opts.fetch :verbose, false Appium::Logger.info "appium settings path: #{toml}" if verbose toml_exists = File.exist? toml @@ -119,11 +120,11 @@ file = File.exist?(f) ? f : File.join(base_dir, f) file = File.expand_path file File.exist?(file) ? file : nil end - r.compact! # remove nils + file_paths.compact! # remove nils files = [] # now expand dirs file_paths.each do |item| @@ -249,10 +250,13 @@ class Driver module Capabilities # except for browser_name, default capability is equal to ::Selenium::WebDriver::Remote::Capabilities.firefox # Because Selenium::WebDriver::Remote::Bridge uses Capabilities.firefox by default # https://github.com/SeleniumHQ/selenium/blob/selenium-3.0.1/rb/lib/selenium/webdriver/remote/bridge.rb#L67 + # @param [Hash] opts_caps Capabilities for Appium server. All capability keys are converted to lowerCamelCase when + # this client sends capabilities to Appium server as JSON format. + # @return [Selenium::WebDriver::Remote::Capabilities] Return instance of Selenium::WebDriver::Remote::Capabilities def self.init_caps_for_appium(opts_caps = {}) default_caps_opts_firefox = { javascript_enabled: true, takes_screenshot: true, css_selectors_enabled: true @@ -279,12 +283,12 @@ # Default wait time for elements to appear # Returns the default client side wait. # This value is independent of what the server is using # @return [Integer] attr_reader :default_wait - # Username for use on Sauce Labs + # Username for use on Sauce Labs. Set `false` to disable Sauce, even when SAUCE_USERNAME is in ENV. attr_accessor :sauce_username - # Access Key for use on Sauce Labs + # Access Key for use on Sauce Labs. Set `false` to disable Sauce, even when SAUCE_ACCESS_KEY is in ENV. attr_accessor :sauce_access_key # Appium's server port attr_accessor :appium_port # Device type to request from the appium server attr_accessor :appium_device