eyes_selenium 3.16.15 → 3.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c004659a8d902282438c1dcdc55291471dde4d6fb2530297a68562345eadddd7
4
- data.tar.gz: c0384765b06476413b5e5da60109a0455315fdffb24ff0576a3a53073956ec18
3
+ metadata.gz: a287486a3c2db8fe596472fc9913fe78e986f808e85d7aff75a864af7d2eb882
4
+ data.tar.gz: 9dc948821e7024ecd298fbd79e139a3b18ec49cf0abd18b508379f78010257cb
5
5
  SHA512:
6
- metadata.gz: 1846ad7b21531f165af57902fa5efd6bfd6808ae42e2aa424a03c74f66153f65a9a4ca409c18c6fb3832422be84bc2d81c68ab835ff536b4dd8aa620a35e7eed
7
- data.tar.gz: b33e3bf45775188f848256ff2d5a5136b58ffd077cd373f04dd7dbfb8c83e7c6642b0e65ca44ddc0c2fc136316d9b5c1aaadd551d05af8ee26603a8be73da523
6
+ metadata.gz: e6985305123510272024b48190c15254d026835251fd7d5fcead42988a32e6f09b3c4155870729a8ded879aef9aa2523fbc40951d4e6364bbfc12c7e960e0a04
7
+ data.tar.gz: e1c697f8a30a19d97ad28d2cc488b4d22da34fdc78b62cbe46f44028be0e93f4a9bfed34706116dd2c516afc6349bfff4dd4a5da5bfe4c3c066fc81ed211ffd7
@@ -1,5 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
  module BrowserTypes
3
+ extend self
4
+ def const_missing(name)
5
+ puts 'Please, prefer using BrowserType instead of BrowserTypes(plural).'
6
+ BrowserType.const_get(name)
7
+ end
8
+
9
+ def enum_values
10
+ BrowserType.enum_values
11
+ end
12
+ end
13
+ module BrowserType
3
14
  extend self
4
15
  CHROME = :'chrome-0'
5
16
  CHROME_ONE_VERSION_BACK = :'chrome-1'
@@ -12,6 +23,7 @@ module BrowserTypes
12
23
  SAFARI = :'safari-0'
13
24
  SAFARI_ONE_VERSION_BACK = :'safari-1'
14
25
  SAFARI_TWO_VERSIONS_BACK = :'safari-2'
26
+ IOS_SAFARI = :safari
15
27
 
16
28
  EDGE_CHROMIUM = :'edgechromium'
17
29
  EDGE_CHROMIUM_ONE_VERSION_BACK = :'edgechromium-1'
@@ -52,7 +64,8 @@ module BrowserTypes
52
64
  EDGE_LEGACY,
53
65
  IE_10,
54
66
  EDGE_CHROMIUM,
55
- EDGE_CHROMIUM_ONE_VERSION_BACK
67
+ EDGE_CHROMIUM_ONE_VERSION_BACK,
68
+ IOS_SAFARI
56
69
  ]
57
70
  end
58
71
  end
@@ -4,7 +4,7 @@ module Applitools
4
4
  module Selenium
5
5
  class BrowsersInfo < Set
6
6
  def add(obj)
7
- return super if obj.is_a? Applitools::Selenium::RenderBrowserInfo
7
+ return super if obj.is_a? Applitools::Selenium::IRenderBrowserInfo
8
8
  raise(
9
9
  Applitools::EyesIllegalArgument,
10
10
  'It is expected the value to be an Applitools::Selenium::RenderBrowserInfo instance,' \
@@ -15,7 +15,7 @@ module Applitools
15
15
  def each(viewport_size = nil)
16
16
  return super() unless empty?
17
17
  return unless viewport_size
18
- default = Applitools::Selenium::RenderBrowserInfo.new.tap do |bi|
18
+ default = Applitools::Selenium::DesktopBrowserInfo.new.tap do |bi|
19
19
  bi.viewport_size = viewport_size
20
20
  bi.browser_type = BrowserTypes::CHROME
21
21
  end
@@ -14,7 +14,6 @@ module Applitools
14
14
  hide_scrollbars: true,
15
15
  hide_caret: false,
16
16
  browsers_info: Applitools::Selenium::BrowsersInfo.new,
17
- accessibility_validation: Applitools::AccessibilityLevel::NONE,
18
17
  rendering_grid_force_put: (ENV['APPLITOOLS_RENDERING_GRID_FORCE_PUT'] || 'false').casecmp('true') == 0
19
18
  }
20
19
  end
@@ -33,21 +32,21 @@ module Applitools
33
32
 
34
33
  object_field :browsers_info, Applitools::Selenium::BrowsersInfo
35
34
  int_field :concurrent_sessions
36
- enum_field :accessibility_validation, Applitools::AccessibilityLevel.enum_values
37
35
  boolean_field :rendering_grid_force_put
38
36
 
39
- def custom_setter_for_accessibility_validation(value)
40
- # self.default_match_settings = self.parent.class.default_config[:default_match_settings] unless default_match_settings
41
- default_match_settings.accessibility_level = value
42
- end
43
-
44
37
  def add_browser(*args)
45
38
  case args.size
46
- when 0, 1
39
+ when 0
40
+ browser = Applitools::Selenium::DesktopBrowserInfo.new
41
+ when 1
47
42
  b = args[0]
48
- browser = b || Applitools::Selenium::RenderBrowserInfo.new
43
+ raise(
44
+ Applitools::EyesIllegalArgument,
45
+ 'Expected :browser to be an IRenderBrowserInfo instance!'
46
+ ) unless b.is_a? IRenderBrowserInfo
47
+ browser = b
49
48
  when 3
50
- browser = Applitools::Selenium::RenderBrowserInfo.new.tap do |bi|
49
+ browser = Applitools::Selenium::DesktopBrowserInfo.new.tap do |bi|
51
50
  bi.viewport_size = Applitools::RectangleSize.new(args[0], args[1])
52
51
  bi.browser_type = args[2]
53
52
  end
@@ -58,11 +57,18 @@ module Applitools
58
57
  self
59
58
  end
60
59
 
60
+ def add_browsers(browsers)
61
+ browsers.each do |browser|
62
+ add_browser(browser)
63
+ end
64
+ self
65
+ end
66
+
61
67
  def add_device_emulation(device_name, orientation = Orientations::PORTRAIT)
62
68
  Applitools::ArgumentGuard.not_nil device_name, 'device_name'
63
69
  raise Applitools::EyesIllegalArgument, 'Wrong device name!' unless Devices.enum_values.include? device_name
64
70
  emu = Applitools::Selenium::ChromeEmulationInfo.new(device_name, orientation)
65
- add_browser { |b| b.emulation_info(emu) }
71
+ add_browser emu
66
72
  end
67
73
 
68
74
  def viewport_size
@@ -73,6 +79,7 @@ module Applitools
73
79
  return from_browsers_info.viewport_size if from_browsers_info
74
80
  nil
75
81
  end
82
+
76
83
  end
77
84
  end
78
85
  end
@@ -210,7 +210,7 @@ module Applitools::Selenium
210
210
  when String
211
211
  frame(name_or_id: frame_name_or_id)
212
212
  when Applitools::Selenium::Element
213
- frame(frame_element: frame_name_or_id.reference)
213
+ frame(frame_element: frame_name_or_id)
214
214
  else
215
215
  Applitools::ArgumentGuard.raise_argument_error Applitools::EyesNoSuchFrame.new frame_name_or_id
216
216
  end
@@ -1,5 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
  module Orientations
3
+ extend self
4
+ def const_missing(name)
5
+ puts 'Please prefer using the Orientation instead of Orientations(plural).'
6
+ Orientation.const_get(name)
7
+ end
8
+ def enum_values
9
+ Orientation.enum_values
10
+ end
11
+ end
12
+
13
+ module Orientation
14
+ extend self
3
15
  PORTRAIT = 'portrait'
4
16
  LANDSCAPE = 'landscape'
17
+
18
+ def enum_values
19
+ [PORTRAIT, LANDSCAPE]
20
+ end
5
21
  end
@@ -674,10 +674,13 @@ module Applitools::Selenium
674
674
 
675
675
  if platform_name && !platform_name.empty?
676
676
  os = platform_name
677
- platform_version = Applitools::Utils::EyesSeleniumUtils.platform_version(underlying_driver).to_s
678
- unless platform_version.empty?
677
+ platform_version = Applitools::Utils::EyesSeleniumUtils.platform_version(underlying_driver)
678
+ case platform_version
679
+ when String
679
680
  major_version = platform_version.split(/\./).first
680
681
  os << " #{major_version}"
682
+ when Array
683
+ os << " #{platform_version.first}"
681
684
  end
682
685
  logger.info "Setting OS: #{os}"
683
686
  app_env.os = os
@@ -312,7 +312,7 @@ module Applitools
312
312
  options = Applitools::Utils.extract_options! args
313
313
  unless options[:type]
314
314
  raise Applitools::EyesError,
315
- 'You should call Target.accessibility(region, region_type: type). The region_type option is required'
315
+ 'You should call Target.accessibility(region, type: type). The :type option is required'
316
316
  end
317
317
  unless Applitools::AccessibilityRegionType.enum_values.include?(options[:type])
318
318
  raise Applitools::EyesIllegalArgument,
@@ -1,20 +1,55 @@
1
1
  # frozen_string_literal: true
2
- require 'applitools/selenium/visual_grid/emulation_base_info'
2
+ require_relative 'emulation_base_info'
3
+ require_relative 'i_render_browser_info'
3
4
  module Applitools
4
5
  module Selenium
5
- class ChromeEmulationInfo < EmulationBaseInfo
6
- attr_accessor :device_name
6
+ class ChromeEmulationInfo < IRenderBrowserInfo
7
+ DEFAULT_CONFIG = proc do
8
+ {
9
+ platform: 'linux',
10
+ browser_type: BrowserTypes::CHROME,
11
+ # size_mode: 'full-page',
12
+ viewport_size: Applitools::RectangleSize.from_any_argument(width: 0, height: 0)
13
+ }
14
+ end
15
+ class << self
16
+ def default_config
17
+ DEFAULT_CONFIG.call
18
+ end
19
+ end
7
20
 
8
- def initialize(device_name, screen_orientation)
9
- super(screen_orientation)
10
- self.device_name = device_name
21
+ # def device_name
22
+ # emulation_info.device_name
23
+ # end
24
+ #
25
+ def initialize(*args)
26
+ super()
27
+ case args[0]
28
+ when String
29
+ self.emulation_info = EmulationInfo.new.tap do |ei|
30
+ ei.device_name = args[0]
31
+ ei.screen_orientation = args[1] || Orientations::PORTRAIT
32
+ end
33
+ when Hash
34
+ self.emulation_info = EmulationInfo.new.tap do |ei|
35
+ ei.device_name = args[0][:device_name]
36
+ ei.screen_orientation = args[0][:screen_orientation] || Orientations::PORTRAIT
37
+ end
38
+ end
11
39
  end
12
40
 
13
- def json_data
14
- {
15
- deviceName: device_name,
16
- screenOrientation: screen_orientation
17
- }
41
+ private
42
+
43
+ class EmulationInfo < Applitools::Selenium::EmulationBaseInfo
44
+ enum_field :device_name, Devices.enum_values
45
+ enum_field :screen_orientation, Orientations.enum_values
46
+
47
+ def json_data
48
+ {
49
+ :'deviceName' => device_name,
50
+ :'screenOrientation' => screen_orientation
51
+ }
52
+ end
18
53
  end
19
54
  end
20
55
  end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+ require 'applitools/selenium/browser_types'
3
+
4
+ module Applitools
5
+ module Selenium
6
+ class DesktopBrowserInfo < IRenderBrowserInfo
7
+ DEFAULT_CONFIG = proc do
8
+ {
9
+ platform: 'linux',
10
+ browser_type: BrowserTypes::CHROME,
11
+ # size_mode: 'full-page',
12
+ viewport_size: Applitools::RectangleSize.from_any_argument(width: 0, height: 0)
13
+ }
14
+ end
15
+
16
+ class << self
17
+ def default_config
18
+ DEFAULT_CONFIG.call
19
+ end
20
+ end
21
+
22
+ def initialize(options = {})
23
+ super()
24
+ if options[:width] && options[:height]
25
+ self.viewport_size = Applitools::RectangleSize.from_any_argument(width: options[:width], height: options[:height])
26
+ end
27
+ self.browser_type = options[:browser_type] if options[:browser_type]
28
+ end
29
+
30
+ def platform
31
+ case browser_type
32
+ when BrowserTypes::EDGE_LEGACY, BrowserTypes::EDGE_CHROMIUM, BrowserTypes::EDGE_CHROMIUM_ONE_VERSION_BACK
33
+ 'windows'
34
+ else
35
+ 'linux'
36
+ end
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+
43
+ Applitools::Selenium::RenderBrowserInfo = Applitools::Selenium::DesktopBrowserInfo
@@ -1,14 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  module Applitools
3
3
  module Selenium
4
- class EmulationBaseInfo
5
- extend Applitools::Helpers
6
- attr_accessor :screen_orientation
7
- abstract_attr_accessor :device_name
8
-
9
- def initialize(screen_orientation)
10
- self.screen_orientation = screen_orientation
11
- end
4
+ class EmulationBaseInfo < Applitools::AbstractConfiguration
12
5
  end
13
6
  end
14
7
  end
@@ -30,7 +30,7 @@ module Applitools
30
30
  def open(driver, browser_info)
31
31
  self.driver = driver
32
32
  self.browser_info = browser_info
33
- self.device_name = browser_info && browser_info.emulation_info && browser_info.emulation_info.device_name
33
+ self.device_name = browser_info.device_name
34
34
  logger.info "opening EyesConnector for #{config.short_description} with viewport size: #{browser_info}"
35
35
  config.viewport_size = browser_info.viewport_size
36
36
  title
@@ -0,0 +1,25 @@
1
+ module Applitools
2
+ module Selenium
3
+ class IRenderBrowserInfo < ::Applitools::AbstractConfiguration
4
+
5
+ object_field :viewport_size, Applitools::RectangleSize
6
+ enum_field :browser_type, BrowserTypes.enum_values
7
+ string_field :platform
8
+ string_field :size_mode
9
+ string_field :baseline_env_name
10
+ object_field :emulation_info, Applitools::Selenium::EmulationBaseInfo
11
+ object_field :ios_device_info, Applitools::Selenium::EmulationBaseInfo
12
+
13
+ def device_name
14
+ return 'desktop' unless emulation_info || ios_device_info
15
+ return ios_device_info.device_name if ios_device_info
16
+ return emulation_info.device_name + ' (chrome emulation)' if emulation_info
17
+ end
18
+
19
+ def to_s
20
+ return "#{viewport_size} (#{browser_type})" unless emulation_info
21
+ "#{emulation_info.device_name} - #{emulation_info.screen_orientation}"
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,44 @@
1
+ require_relative 'ios_device_name'
2
+ require_relative 'ios_screen_orientation'
3
+ module Applitools
4
+ module Selenium
5
+ class IosDeviceInfo < IRenderBrowserInfo
6
+ DEFAULT_CONFIG = proc do
7
+ {
8
+ platform: 'ios',
9
+ browser_type: BrowserTypes::IOS_SAFARI,
10
+ # size_mode: 'full-page',
11
+ viewport_size: Applitools::RectangleSize.from_any_argument(width: 0, height: 0)
12
+ }
13
+ end
14
+ class << self
15
+ def default_config
16
+ DEFAULT_CONFIG.call
17
+ end
18
+ end
19
+
20
+ def initialize(options = {})
21
+ super()
22
+ self.ios_device_info = EmulationInfo.new.tap do |ei|
23
+ ei.device_name = options[:device_name]
24
+ ei.screen_orientation = options[:screen_orientation] || options[:orientation] || IosScreenshotOrientation::PORTRAIT
25
+ end
26
+ end
27
+
28
+ private
29
+
30
+ class EmulationInfo < EmulationBaseInfo
31
+ enum_field :device_name, IosDeviceName.enum_values
32
+ enum_field :screen_orientation, IosScreenshotOrientation.enum_values
33
+
34
+ def json_data
35
+ {
36
+ name: device_name,
37
+ screenOrientation: screen_orientation,
38
+ version: 'latest'
39
+ }
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,30 @@
1
+ module IosDeviceName
2
+ extend self
3
+ IPhone_11_Pro = 'iPhone 11 Pro'
4
+ IPhone_11_Pro_Max = 'iPhone 11 Pro Max'
5
+ IPhone_11 = 'iPhone 11'
6
+ IPhone_XR = 'iPhone XR'
7
+ IPhone_XS = 'iPhone Xs'
8
+ IPhone_X = 'iPhone X'
9
+ IPhone_8 = 'iPhone 8'
10
+ IPhone_7 = 'iPhone 7'
11
+ IPad_Pro_3 = 'iPad Pro (12.9-inch) (3rd generation)'
12
+ IPad_7 = 'iPad (7th generation)'
13
+ IPad_Air_2 = 'iPad Air (2nd generation)'
14
+
15
+ def enum_values
16
+ [
17
+ IPhone_11_Pro,
18
+ IPhone_11_Pro_Max,
19
+ IPhone_11,
20
+ IPhone_XR,
21
+ IPhone_XS,
22
+ IPhone_X,
23
+ IPhone_8,
24
+ IPhone_7,
25
+ IPad_Pro_3,
26
+ IPad_7,
27
+ IPad_Air_2
28
+ ]
29
+ end
30
+ end
@@ -0,0 +1,14 @@
1
+ module IosScreenshotOrientation
2
+ extend self
3
+ PORTRAIT ='portrait'
4
+ LANDSCAPE_LEFT = 'landscapeLeft'
5
+ LANDSCAPE_RIGHT = 'landscapeRight'
6
+
7
+ def enum_values
8
+ [
9
+ PORTRAIT,
10
+ LANDSCAPE_LEFT,
11
+ LANDSCAPE_RIGHT
12
+ ]
13
+ end
14
+ end
@@ -3,7 +3,7 @@ module Applitools
3
3
  module Selenium
4
4
  class RenderInfo
5
5
  include Applitools::Jsonable
6
- json_fields :width, :height, :sizeMode, :emulationInfo, :region, :selector
6
+ json_fields :width, :height, :sizeMode, :emulationInfo, :region, :selector, :IosDeviceInfo
7
7
  # , :region, :emulationInfo
8
8
 
9
9
  def json_data
@@ -13,6 +13,7 @@ module Applitools
13
13
  sizeMode: size_mode
14
14
  }
15
15
  result['emulationInfo'] = json_value(emulation_info) if emulation_info
16
+ result['iosDeviceInfo'] = json_value(ios_device_info) if ios_device_info
16
17
  result['region'] = json_value(region) if size_mode == 'region'
17
18
  result['selector'] = json_value(region) if size_mode == 'selector'
18
19
  result
@@ -8,7 +8,7 @@ module Applitools
8
8
  json_fields :renderId, :webhook, :url, :dom, :resources, :scriptHooks,
9
9
  :selectorsToFindRegionsFor, :sendDom, :agentId
10
10
 
11
- json_fields :renderInfo, :browser
11
+ json_fields :renderInfo, :browser, :platform
12
12
 
13
13
  def initialize(*args)
14
14
  options = Applitools::Utils.extract_options! args
@@ -249,6 +249,7 @@ module Applitools
249
249
  r.size_mode = size_mode
250
250
  r.region = region_to_check
251
251
  r.emulation_info = running_test.browser_info.emulation_info if running_test.browser_info.emulation_info
252
+ r.ios_device_info = running_test.browser_info.ios_device_info if running_test.browser_info.ios_device_info
252
253
  end
253
254
 
254
255
  requests << Applitools::Selenium::RenderRequest.new(
@@ -257,7 +258,8 @@ module Applitools
257
258
  dom: dom,
258
259
  resources: request_resources,
259
260
  render_info: r_info,
260
- browser: { name: running_test.browser_info.browser_type, platform: running_test.browser_info.platform },
261
+ browser: { name: running_test.browser_info.browser_type },
262
+ platform: { name: running_test.browser_info.platform },
261
263
  script_hooks: script_hooks,
262
264
  selectors_to_find_regions_for: region_selectors,
263
265
  send_dom: if running_test.eyes.configuration.send_dom.nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Applitools
4
- VERSION = '3.16.15'.freeze
4
+ VERSION = '3.17.3'.freeze
5
5
  end
@@ -20,8 +20,8 @@ end
20
20
 
21
21
  Applitools::Selenium.require_dir 'selenium/concerns'
22
22
  Applitools::Selenium.require_dir 'selenium/scripts'
23
- Applitools::Selenium.require_dir 'selenium/visual_grid'
24
23
  Applitools::Selenium.require_dir 'selenium'
24
+ Applitools::Selenium.require_dir 'selenium/visual_grid'
25
25
  Applitools::Selenium.require_dir 'selenium/dom_capture'
26
26
  Applitools::Selenium.require_dir 'selenium/css_parser'
27
27
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eyes_selenium
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.16.15
4
+ version: 3.17.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Applitools Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-24 00:00:00.000000000 Z
11
+ date: 2020-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eyes_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.16.15
19
+ version: 3.17.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.16.15
26
+ version: 3.17.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: selenium-webdriver
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -150,9 +150,13 @@ files:
150
150
  - lib/applitools/selenium/viewport_screenshot.rb
151
151
  - lib/applitools/selenium/viewport_size.rb
152
152
  - lib/applitools/selenium/visual_grid/chrome_emulation_info.rb
153
+ - lib/applitools/selenium/visual_grid/desktop_browser_info.rb
153
154
  - lib/applitools/selenium/visual_grid/emulation_base_info.rb
154
155
  - lib/applitools/selenium/visual_grid/eyes_connector.rb
155
- - lib/applitools/selenium/visual_grid/render_browser_info.rb
156
+ - lib/applitools/selenium/visual_grid/i_render_browser_info.rb
157
+ - lib/applitools/selenium/visual_grid/ios_device_info.rb
158
+ - lib/applitools/selenium/visual_grid/ios_device_name.rb
159
+ - lib/applitools/selenium/visual_grid/ios_screen_orientation.rb
156
160
  - lib/applitools/selenium/visual_grid/render_info.rb
157
161
  - lib/applitools/selenium/visual_grid/render_request.rb
158
162
  - lib/applitools/selenium/visual_grid/render_requests.rb
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
- require 'applitools/selenium/browser_types'
3
-
4
- module Applitools
5
- module Selenium
6
- class RenderBrowserInfo < ::Applitools::AbstractConfiguration
7
- DEFAULT_CONFIG = proc do
8
- {
9
- platform: 'linux',
10
- browser_type: BrowserTypes::CHROME,
11
- # size_mode: 'full-page',
12
- viewport_size: Applitools::RectangleSize.from_any_argument(width: 0, height: 0)
13
- }
14
- end
15
- class << self
16
- def default_config
17
- DEFAULT_CONFIG.call
18
- end
19
- end
20
-
21
- object_field :viewport_size, Applitools::RectangleSize
22
- enum_field :browser_type, BrowserTypes.enum_values
23
- string_field :platform
24
- string_field :size_mode
25
- string_field :baseline_env_name
26
- object_field :emulation_info, Applitools::Selenium::EmulationBaseInfo
27
-
28
- def platform
29
- case browser_type
30
- when BrowserTypes::EDGE_LEGACY, BrowserTypes::EDGE_CHROMIUM, BrowserTypes::EDGE_CHROMIUM_ONE_VERSION_BACK
31
- 'windows'
32
- else
33
- 'linux'
34
- end
35
- end
36
-
37
- def to_s
38
- return "#{viewport_size} (#{browser_type})" unless emulation_info
39
- "#{emulation_info.device_name} - #{emulation_info.screen_orientation}"
40
- end
41
- end
42
- end
43
- end