Class: AutomationHelpers::Drivers::V4::Remote

Inherits:
Object
  • Object
show all
Defined in:
lib/automation_helpers/drivers/v4/remote.rb

Overview

The Remote Driver that will connect to a dockerized self-hosted grid This expects the grid to be live and accepting node requests

Instance Method Summary collapse

Constructor Details

#initialize(browser) ⇒ Remote

#### Initial setup options

  • browser (required) - When instantiating, the first argument must be the symbol that represents what browser to use

  • **ENV** (required) - The environment variable HUB_URL must be set to the actively running dockerized grid (By default this should be http://hub:4444/wd/hub)



22
23
24
# File 'lib/automation_helpers/drivers/v4/remote.rb', line 22

def initialize(browser)
  @browser = browser
end

Instance Method Details

#registerNil

Register a new driver with the default selenium name for use in a (localised), remote grid setup

Returns:

  • (Nil)


29
30
31
32
33
34
35
36
37
38
# File 'lib/automation_helpers/drivers/v4/remote.rb', line 29

def register
  Capybara.register_driver :selenium do |app|
    Capybara::Selenium::Driver.new(
      app,
      browser: :remote,
      capabilities: [browser_capabilities, options],
      url: hub_url
    )
  end
end