Module: QAT::Web::Browser::Loader
- Extended by:
- Loader
- Includes:
- Helper, Profile, Drivers::Default
- Included in:
- Loader
- Defined in:
- lib/qat/web/browser/loader.rb,
lib/qat/web/browser/firefox/loader/helper.rb
Overview
Module to load browsers and drivers from configuration files.
Defined Under Namespace
Modules: Helper Classes: InvalidConfigurationError
Constant Summary
Constants included from Profile
Instance Method Summary collapse
-
#load(file_path) ⇒ Object
Registers browser drivers in Capybara from a YAML file.
-
#load_config(config) ⇒ Object
Registers browser drivers in Capybara from a configuration hash.
Methods included from Helper
Methods included from Profile
Methods included from Drivers::Default
Instance Method Details
#load(file_path) ⇒ Object
Registers browser drivers in Capybara from a YAML file
25 26 27 28 |
# File 'lib/qat/web/browser/loader.rb', line 25 def load(file_path) controllers = HashWithIndifferentAccess.new(YAML::load(ERB.new(File.read(file_path)).result)) || {} load_config(controllers) end |
#load_config(config) ⇒ Object
Registers browser drivers in Capybara from a configuration hash
33 34 35 36 37 38 |
# File 'lib/qat/web/browser/loader.rb', line 33 def load_config(config) config.each do |controller, | raise InvalidConfigurationError.new "No browser defined for controller #{controller}" unless ['browser'] register_controller(controller.to_sym, ) end end |