Module: QAT::Web::Browser::Loader::Helper
- Included in:
- QAT::Web::Browser::Loader
- Defined in:
- lib/qat/web/browser/firefox/loader/helper.rb
Overview
Module with helper methods to load browsers and drivers from configuration files.
Instance Method Summary collapse
-
#load_generic_driver(browser, controller, screen, driver, properties, addons, hooks) ⇒ Capybara::RackTest::Driver||Capybara::Selenium::Driver
Creates a generic Capybara driver.
Instance Method Details
#load_generic_driver(browser, controller, screen, driver, properties, addons, hooks) ⇒ Capybara::RackTest::Driver||Capybara::Selenium::Driver
Creates a generic Capybara driver
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/qat/web/browser/firefox/loader/helper.rb', line 16 def load_generic_driver(browser, controller, screen, driver, properties, addons, hooks) Capybara.register_driver controller do |app| loaded_screen = QAT::Web::Screen::Factory.for screen loaded_driver = nil Retriable.retriable on: [Net::ReadTimeout, ::Selenium::WebDriver::Error::WebDriverError], tries: 3, base_interval: 5, multiplier: 1.0, rand_factor: 0.0 do = { browser: browser } if properties customized_profile = create_profile(driver, browser, properties, addons) .merge!(customized_profile) if customized_profile end loaded_driver = Capybara.const_get(driver.capitalize)::Driver.new(app, **) loaded_driver.browser end maximize_browser_window loaded_driver, loaded_screen require_hooks(hooks) loaded_driver end end |