Method: Quke::DriverConfiguration#browserstack

Defined in:
lib/quke/driver_configuration.rb

#browserstackObject

Returns an instance of Selenium::WebDriver::Remote::Capabilities to be used when registering an instance of Capybara::Selenium::Driver, configured to run using the Browserstack service.

For example when initialising the driver like this

my_capabilites = Selenium::WebDriver::Remote::Capabilities.new
my_capabilites['build'] = my_config.browserstack['build']
# ... set rest of capabilities
Capybara::Selenium::Driver.new(
  app,
  browser: :remote,
  url: 'http://jdoe:[email protected]/wd/hub',
  desired_capabilities: my_capabilites
)

You can instead call Quke::DriverConfiguration.browserstack which will manage instantiating and setting up the Selenium::WebDriver::Remote::Capabilities instance based on the properties of the Quke::Configuration instance its initialised with

Capybara::Selenium::Driver.new(
  app,
  browser: :remote,
  url: my_driver_config.browserstack_url,
  desired_capabilities: my_driver_config.browserstack
)

For further reference on browserstack capabilities www.browserstack.com/automate/capabilities www.browserstack.com/automate/ruby#configure-capabilities



237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/quke/driver_configuration.rb', line 237

def browserstack
  # Documentation and the code for this class can be found here
  # http://www.rubydoc.info/gems/selenium-webdriver/0.0.28/Selenium/WebDriver/Remote/Capabilities
  # https://github.com/SeleniumHQ/selenium/blob/master/rb/lib/selenium/webdriver/remote/capabilities.rb
  capabilities = Selenium::WebDriver::Remote::Capabilities.new

  config.browserstack.capabilities.each do |key, value|
    capabilities[key] = value
  end

  capabilities
end