Sha256: 2ed69f39545fbadc736b99edac67d5f14e0588d60a54baea7dda285030653d83

Contents?: true

Size: 804 Bytes

Versions: 4

Compression:

Stored size: 804 Bytes

Contents

require 'sauce_whisk'

module SauceHelpers
  def initialize_driver(name = nil)
    @name = name || "Unknown Test at #{Time.now.to_i}"
    capabilities = {name: @name,
                    build: ENV['BUILD_TAG'] ||= "Unknown Build at #{Time.now.to_i}"}
    capabilities[:browserName] = ENV['browserName'] || :chrome

    capabilities[:platform] = ENV['platform'] if ENV['platform']
    capabilities[:version] = ENV['version'] if ENV['version']

    url = "https://#{ENV['SAUCE_USERNAME']}:#{ENV['SAUCE_ACCESS_KEY']}@ondemand.saucelabs.com:443/wd/hub".strip
    @browser = Watir::Browser.new :remote, {url: url,
                                            desired_capabilities: capabilities}
  end

  def submit_results(session_id, result)
    SauceWhisk::Jobs.change_status(session_id, result)
  end

end

Version data entries

4 entries across 2 versions & 1 rubygems

Version Path
watir_install-0.3.1 lib/watir_install/generators/new/spec/sauce_helpers.rb.tt
watir_install-0.3.1 lib/watir_install/generators/new/spec/support/sauce_helpers.rb.tt
watir_install-0.3.0 lib/watir_install/generators/new/spec/sauce_helpers.rb.tt
watir_install-0.3.0 lib/watir_install/generators/new/spec/support/sauce_helpers.rb.tt