Module: Applitools::Selenium::Capybara::CapybaraSettings

Included in:
Applitools
Defined in:
lib/applitools/capybara/capybara_settings.rb

Instance Method Summary collapse

Instance Method Details

#register_capybara_driver(options = {}) ⇒ Object

Registers Capybara driver which will be used by eyes and sets it as default Capybara driver. The name of the driver is :eyes, and the driver is a descendant of class Capybara::Selenium::Driver. Options are eventually passed to drivers constructor

Examples:

Applitools.register_capybara_driver :browser => :chrome
Applitools.register_capybara_driver :browser => :remote, :url => 'remote_url', :desired_capabilities => {}
Applitools.register_capybara_driver :browser => :remote, :url => 'remote_url', :capabilities => {}
Applitools.register_capybara_driver :browser => :remote, :url => 'remote_url', :options => {}

Parameters:

  • options (Hash) (defaults to: {})


19
20
21
22
23
24
25
# File 'lib/applitools/capybara/capybara_settings.rb', line 19

def register_capybara_driver(options = {})
  ::Capybara.register_driver :eyes do |app|
    Applitools::Selenium::Capybara::Driver.new app, **options
  end
  ::Capybara.default_driver = :eyes
  ::Capybara.javascript_driver = :eyes
end