Class: Capybara::Selenium::Driver::Ios::Profile::Firefox

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara-ios-emulation-driver/profile/firefox.rb

Class Method Summary collapse

Class Method Details

.driver_options(params = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/capybara-ios-emulation-driver/profile/firefox.rb', line 4

def self.driver_options(params = {})
  options = {
    :ios_version => ::Capybara::IosEmulationDriver::LATEST_IOS_VERSION,
    :ios_device  => :iphone,
    'app.update.auto' => false,
    'app.update.enabled' => false,
  }.update(params)
  options['general.useragent.override'] = ::Capybara::IosEmulationDriver::UserAgent.of(:ios => options[:ios_version], :device => options[:ios_device])

  profile = ::Selenium::WebDriver::Firefox::Profile.new
  profile_params = options.reject {|k,v| v.nil? or [:ios_version, :ios_device].include?(k) }
  profile_params.each do |key, val|
    profile[key] = val
  end

  { :profile => profile }
end