Class: RainforestRubyRuntime::Drivers::BrowserStack

Inherits:
Object
  • Object
show all
Defined in:
lib/rainforest_ruby_runtime/drivers/browser_stack.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ BrowserStack

Returns a new instance of BrowserStack.



8
9
10
# File 'lib/rainforest_ruby_runtime/drivers/browser_stack.rb', line 8

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/rainforest_ruby_runtime/drivers/browser_stack.rb', line 6

def options
  @options
end

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
20
# File 'lib/rainforest_ruby_runtime/drivers/browser_stack.rb', line 12

def call
  url = "https://#{ENV['BROWSER_STACK_USERNAME']}:#{ENV['BROWSER_STACK_PASSWORD']}@hub.browserstack.com/wd/hub"
  capabilities = ::Selenium::WebDriver::Remote::Capabilities.new browsers.first
  capabilities['browserstack.debug'] = 'true'     

  ::Capybara.register_driver :browser_stack do |app|
    ::Capybara::Selenium::Driver.new(app, browser: :remote, url: url, desired_capabilities: capabilities) 
  end
end