Module: QAT::Web::Browser::Profile

Includes:
Logger
Included in:
Loader
Defined in:
lib/qat/web/browser/profile.rb

Overview

Module to provide browsers specific profile.

Since:

  • 1.0.0

Defined Under Namespace

Classes: HandlerNotImplemented, InvalidAddonError

Constant Summary collapse

ADDONS =

Since:

  • 1.0.0

{
  firefox: {
    har_exporter: 'harexporttrigger-0.5.0-beta.10.xpi'
  }
}

Instance Method Summary collapse

Instance Method Details

#create_profile(driver, browser, properties, addons) ⇒ Object

Since:

  • 1.0.0



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/qat/web/browser/profile.rb', line 16

def create_profile (driver, browser, properties, addons)
  return nil unless properties && properties.any?
  begin
    method("#{driver}_#{browser}_profile".to_sym).call(properties, addons)
  rescue NoMethodError => exception
    if exception.message.match(/.*_.*_profile/)
      raise(HandlerNotImplemented, "A profile handler for driver '#{driver.capitalize}' and/or '#{browser.capitalize}' does not exist at this moment!")
    else
      raise
    end
  end
end