Created
January 15, 2014 23:18
-
-
Save bbbco/8446710 to your computer and use it in GitHub Desktop.
Sample of SWD config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $> URL=theinternet BROWSER=firefox rspec spec/ | |
URL_CONFIG = { | |
"theinternet" => { | |
:url => "http://the-internet.herokuapp.com", | |
:type => "staging" | |
}, | |
"elemental-selenium" => { | |
:url => "http://elemental-selenium.com", | |
:type => "production" | |
} | |
"theinternetlocal" => { | |
:url => "http://the-internet-local:4567", | |
:type => "local" | |
} | |
} | |
BROWSER_CONFIG = { | |
"firefox" => { | |
:browser => :firefox, | |
:profile => { ... | |
}, | |
:capabilities => { ... | |
} | |
}, | |
"chrome" => { | |
:browser => :chrome, | |
:profile => { ... | |
}, | |
:capabilities => { ... | |
} | |
} | |
} | |
PROXY = ENV['PROXY'] || "local" | |
url = ENV['URL'] || "theinternet" | |
$base_url = URL_CONFIG[url][:url] | |
$url_type = URL_CONFIG[url][:type] | |
browser_choice = ENV['BROWSER'] || "firefox" | |
if PROXY == "local" | |
# ... code to generate profile via BROWSER_CONFIG | |
$driver = Selenium::WebDriver.for BROWSER_CONFIG[browser_choice][:browser], :profile => profile | |
elsif PROXY == "sauce" | |
# ... code to generate caps via BROWSER_CONFIG | |
$driver = Selenium::WebDriver.for BROWSER_CONFIG[browser_choice][:browser], :desired_capabilities => caps | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment