Class: Capybara::Selenium::Driver::Ios::Profile::Chrome

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara-ios-emulation-driver/profile/chrome.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
# File 'lib/capybara-ios-emulation-driver/profile/chrome.rb', line 4

def self.driver_options(params = {})
  options = {
    :ios_version => ::Capybara::IosEmulationDriver::LATEST_IOS_VERSION,
    :ios_device  => :iphone,
  }.update(params)

  profile = ::Selenium::WebDriver::Chrome::Profile.new
  ua = ::Capybara::IosEmulationDriver::UserAgent.of(:ios => options[:ios_version], :device => options[:ios_device])
  {
    :switches => [ '--allow-running-insecure-content',
                   "--user-agent='#{ua}'" ],
    :prefs => profile
  }
end