Class: Applitools::Selenium::ChromeEmulationInfo
- Inherits:
-
IRenderBrowserInfo
- Object
- AbstractConfiguration
- IRenderBrowserInfo
- Applitools::Selenium::ChromeEmulationInfo
- Defined in:
- lib/applitools/selenium/visual_grid/chrome_emulation_info.rb
Defined Under Namespace
Classes: EmulationInfo
Constant Summary collapse
- DEFAULT_CONFIG =
proc do { platform: 'linux', browser_type: BrowserType::CHROME, # size_mode: 'full-page', viewport_size: Applitools::RectangleSize.from_any_argument(width: 0, height: 0) } end
Class Method Summary collapse
Instance Method Summary collapse
- #device_name ⇒ Object
-
#initialize(*args) ⇒ ChromeEmulationInfo
constructor
def device_name emulation_info.device_name end.
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(*args) ⇒ ChromeEmulationInfo
def device_name
emulation_info.device_name
end
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/applitools/selenium/visual_grid/chrome_emulation_info.rb', line 27 def initialize(*args) = Applitools::Utils.(args.dup) super() case args[0] when String self.emulation_info = EmulationInfo.new.tap do |ei| ei.device_name = args[0] ei.screen_orientation = args[1] || Orientation::PORTRAIT end when Hash self.emulation_info = EmulationInfo.new.tap do |ei| ei.device_name = args[0][:device_name] ei.screen_orientation = args[0][:screen_orientation] || Orientation::PORTRAIT end else raise Applitools::EyesIllegalArgument, 'You should pass :device_name and :screen_orientation' end end |
Class Method Details
.default_config ⇒ Object
16 17 18 |
# File 'lib/applitools/selenium/visual_grid/chrome_emulation_info.rb', line 16 def default_config DEFAULT_CONFIG.call end |
Instance Method Details
#device_name ⇒ Object
50 51 52 |
# File 'lib/applitools/selenium/visual_grid/chrome_emulation_info.rb', line 50 def device_name emulation_info.device_name + ' (chrome emulation)' end |
#to_hash ⇒ Object
54 55 56 |
# File 'lib/applitools/selenium/visual_grid/chrome_emulation_info.rb', line 54 def to_hash {chromeEmulationInfo: emulation_info.json_data} end |
#to_s ⇒ Object
46 47 48 |
# File 'lib/applitools/selenium/visual_grid/chrome_emulation_info.rb', line 46 def to_s "#{emulation_info.device_name} - #{emulation_info.screen_orientation}" end |