Class: AutomationHelpers::Drivers::V4::Remote
- Inherits:
-
Object
- Object
- AutomationHelpers::Drivers::V4::Remote
- 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 Attribute Summary collapse
-
#browser ⇒ Object
readonly
Returns the value of attribute browser.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(browser, options = Options.for(browser)) ⇒ Remote
constructor
#### Initial setup options.
-
#register ⇒ Nil
Register a new driver with the default selenium name for use in a (localised), remote grid setup.
Constructor Details
#initialize(browser, options = Options.for(browser)) ⇒ Remote
#### Initial setup options
-
browser (required) - When instantiating, the first argument must be the symbol that represents what browser to use
-
options (optional) -> You can instantiate an Options payload that can be used when registering your driver
-
**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)
23 24 25 26 |
# File 'lib/automation_helpers/drivers/v4/remote.rb', line 23 def initialize(browser, = Options.for(browser)) @browser = browser @options = end |
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
14 15 16 |
# File 'lib/automation_helpers/drivers/v4/remote.rb', line 14 def browser @browser end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/automation_helpers/drivers/v4/remote.rb', line 14 def @options end |
Instance Method Details
#register ⇒ Nil
Register a new driver with the default selenium name for use in a (localised), remote grid setup
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/automation_helpers/drivers/v4/remote.rb', line 31 def register Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new( app, browser: :remote, capabilities: [browser_capabilities, ], url: hub_url ) end end |