Class: Applitools::Selenium::RenderBrowserInfo
- Inherits:
-
IRenderBrowserInfo
- Object
- AbstractConfiguration
- IRenderBrowserInfo
- Applitools::Selenium::RenderBrowserInfo
- Defined in:
- lib/applitools/selenium/visual_grid/render_browser_info.rb
Constant Summary collapse
- DEFAULT_CONFIG =
proc do { platform: 'linux', browser_type: BrowserTypes::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(options = {}) ⇒ RenderBrowserInfo
constructor
A new instance of RenderBrowserInfo.
- #platform ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ RenderBrowserInfo
Returns a new instance of RenderBrowserInfo.
25 26 27 28 29 30 31 |
# File 'lib/applitools/selenium/visual_grid/render_browser_info.rb', line 25 def initialize( = {}) super if [:width] && [:height] self. = Applitools::RectangleSize.from_any_argument(width: [:width], height: [:height]) end self.browser_type = [:browser_type] if [:browser_type] end |
Class Method Details
.default_config ⇒ Object
20 21 22 |
# File 'lib/applitools/selenium/visual_grid/render_browser_info.rb', line 20 def default_config DEFAULT_CONFIG.call end |
Instance Method Details
#device_name ⇒ Object
52 53 54 55 56 57 58 59 |
# File 'lib/applitools/selenium/visual_grid/render_browser_info.rb', line 52 def device_name if ios_device_info return ios_device_info.device_name elsif emulation_info return emulation_info.device_name + ' (chrome emulation)' end 'desktop' end |
#platform ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/applitools/selenium/visual_grid/render_browser_info.rb', line 33 def platform return 'ios' if ios_device_info case browser_type when BrowserType::EDGE_LEGACY, BrowserType::EDGE_CHROMIUM, BrowserType::EDGE_CHROMIUM_ONE_VERSION_BACK 'windows' else 'linux' end end |
#to_s ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/applitools/selenium/visual_grid/render_browser_info.rb', line 43 def to_s if emulation_info "#{emulation_info.device_name} - #{emulation_info.screen_orientation}" elsif ios_device_info "#{ios_device_info.device_name} - #{ios_device_info.screen_orientation}" end "#{} (#{browser_type})" end |