Class: Saucer::Config::Selenium
- Defined in:
- lib/saucer/config/selenium.rb
Constant Summary collapse
- CONFIG_PARAMS =
%i(browser_name version platform selenium_version chromedriver_version iedriver_version).freeze
Instance Attribute Summary collapse
-
#sauce ⇒ Object
readonly
Returns the value of attribute sauce.
Attributes inherited from Common
#access_key, #config_params, #username
Instance Method Summary collapse
- #capabilities ⇒ Object
-
#initialize(opt = {}) ⇒ Selenium
constructor
A new instance of Selenium.
- #url ⇒ Object
Constructor Details
#initialize(opt = {}) ⇒ Selenium
Returns a new instance of Selenium.
10 11 12 13 |
# File 'lib/saucer/config/selenium.rb', line 10 def initialize(opt = {}) super @config_params += CONFIG_PARAMS end |
Instance Attribute Details
#sauce ⇒ Object (readonly)
Returns the value of attribute sauce.
5 6 7 |
# File 'lib/saucer/config/selenium.rb', line 5 def sauce @sauce end |
Instance Method Details
#capabilities ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/saucer/config/selenium.rb', line 19 def capabilities caps = @opts[:desired_capabilities] caps ||= begin caps = @config_params.each_with_object({}) do |param, hash| hash[param] = @opts[param] if @opts.key?(param) hash[param] ||= ENV[param.to_s] if ENV[param.to_s] end browser_name = @opts[:browser_name] || :chrome ::Selenium::WebDriver::Remote::Capabilities.send(browser_name, caps) end @sauce = Sauce.new.to_hash caps[:"sauce:data"] = @sauce.to_hash caps[:name] = @sauce[:name] caps[:build] = @sauce[:build] caps end |
#url ⇒ Object
15 16 17 |
# File 'lib/saucer/config/selenium.rb', line 15 def url "https://#{@username}:#{@access_key}@ondemand.saucelabs.com:443/wd/hub" end |