Class: Applitools::Selenium::IosDeviceInfo

Inherits:
IRenderBrowserInfo show all
Defined in:
lib/applitools/selenium/visual_grid/ios_device_info.rb

Defined Under Namespace

Classes: EmulationInfo

Constant Summary collapse

DEFAULT_CONFIG =
proc do
  {
      platform: 'ios',
      browser_type: BrowserType::IOS_SAFARI,
      # size_mode: 'full-page',
      viewport_size: Applitools::RectangleSize.from_any_argument(width: 0, height: 0)
  }
end

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ IosDeviceInfo

Returns a new instance of IosDeviceInfo.



23
24
25
26
27
28
29
# File 'lib/applitools/selenium/visual_grid/ios_device_info.rb', line 23

def initialize(options = {})
  super
  self.ios_device_info = EmulationInfo.new.tap do |ei|
    ei.device_name = options[:device_name]
    ei.screen_orientation = options[:screen_orientation] || options[:orientation] || Orientation::PORTRAIT
  end
end

Class Method Details

.default_configObject



18
19
20
# File 'lib/applitools/selenium/visual_grid/ios_device_info.rb', line 18

def default_config
  DEFAULT_CONFIG.call
end

Instance Method Details

#device_nameObject



35
36
37
# File 'lib/applitools/selenium/visual_grid/ios_device_info.rb', line 35

def device_name
  ios_device_info.device_name
end

#to_sObject



31
32
33
# File 'lib/applitools/selenium/visual_grid/ios_device_info.rb', line 31

def to_s
  "#{ios_device_info.device_name} - #{ios_device_info.screen_orientation}"
end