class Appium::SauceLabs

def initialize(appium_lib_opts)

Returns:
  • (Appium::SauceLabs) -

Parameters:
  • appium_lib_opts (Hash) -- Appium library parameter
def initialize(appium_lib_opts)
  @username   = appium_lib_opts.fetch :sauce_username, ENV.fetch('SAUCE_USERNAME', nil)
  @username   = nil if !@username || (@username.is_a?(String) && @username.empty?)
  @access_key = appium_lib_opts.fetch :sauce_access_key, ENV.fetch('SAUCE_ACCESS_KEY', nil)
  @access_key = nil if !@access_key || (@access_key.is_a?(String) && @access_key.empty?)
  @endpoint   = appium_lib_opts.fetch :sauce_endpoint, ENV.fetch('SAUCE_ENDPOINT', nil)
  @endpoint   = 'ondemand.saucelabs.com:443/wd/hub' if !@endpoint || (@endpoint.is_a?(String) && @endpoint.empty?)
end

def sauce_server_url?

Returns:
  • (Boolean) -
def sauce_server_url?
  !username.nil? && !access_key.nil?
end

def server_url

Returns:
  • (String) -
def server_url
  sauce_server_url? ? "https://#{username}:#{access_key}@#{endpoint}" : 'http://127.0.0.1:4723/wd/hub'
end