# Test Generated by Dashi
# 
# To use:
#  1. In the test directory create a Gemfile:
#      source "https://www.rubygems.org"
#      gem "selenium-webdriver"
#      gem "net-http-persistent"
#
#  2.  run `bundle update` in that directory
#  3.  set the 'SAUCE_USERNAME' & 'SAUCE_ACCESS_KEY' environment variables
#  4.  run `bundle exec ruby repro.rb`

require "selenium/webdriver"
require 'selenium/webdriver/remote/http/persistent'


def un
  ENV["SAUCE_USERNAME"]
end

def ak
  ENV["SAUCE_ACCESS_KEY"]
end

def auth
  "#{un}:#{ak}"
end

def server 
  "ondemand.saucelabs.com"
end

def port
  80
end

def endpoint
  "#{server}:#{port}/wd/hub"
end

def auth_endpoint 
  "http://#{auth}@#{endpoint}"
end

def caps
 caps = <%= desired_capabilities.to_h %>

 return caps
end

http_client = ::Selenium::WebDriver::Remote::Http::Persistent.new
http_client.timeout = 300 # Browser launch can take a while   

driver = Selenium::WebDriver.for :remote, :url => auth_endpoint, :desired_capabilities => caps, :http_client => http_client

<%= commands_for_execution %>

# Test Generated by Dashi
# 
# To use:
#  1. In the test directory create a Gemfile:
#      source "https://www.rubygems.org"
#      gem "selenium-webdriver"
#      gem "net-http-persistent"
#
#  2.  run `bundle update` in that directory
#  3.  set the 'SAUCE_USERNAME' & 'SAUCE_ACCESS_KEY' environment variables
#  4.  run `bundle exec ruby repro.rb`

require "selenium/webdriver"
require 'selenium/webdriver/remote/http/persistent'


def un
  ENV["SAUCE_USERNAME"]
end

def ak
  ENV["SAUCE_ACCESS_KEY"]
end

def auth
  "#{un}:#{ak}"
end

def server 
  "ondemand.saucelabs.com"
end

def port
  80
end

def endpoint
  "#{server}:#{port}/wd/hub"
end

def auth_endpoint 
  "http://#{auth}@#{endpoint}"
end

def caps
 caps = <%= desired_capabilities.to_h %>

 caps['name'] = "A Test Made with Dashi"
 return caps
end

http_client = ::Selenium::WebDriver::Remote::Http::Persistent.new
http_client.timeout = 300 # Browser launch can take a while   

driver = Selenium::WebDriver.for :remote, :url => auth_endpoint, :desired_capabilities => caps, :http_client => http_client

<%= commands_for_execution %>

Set the test name to indicate it's generated
Set the test name to indicate it's generated
