eyes_selenium 3.17.3 → 3.17.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a287486a3c2db8fe596472fc9913fe78e986f808e85d7aff75a864af7d2eb882
4
- data.tar.gz: 9dc948821e7024ecd298fbd79e139a3b18ec49cf0abd18b508379f78010257cb
3
+ metadata.gz: ab60fb86502ed730997a08c2de160bab0bbff7bc9651a7773fdd3e2971d49b18
4
+ data.tar.gz: 717c9ec052aac3390691551e0e83febf7af4582f643031d49cd61226f6f61e86
5
5
  SHA512:
6
- metadata.gz: e6985305123510272024b48190c15254d026835251fd7d5fcead42988a32e6f09b3c4155870729a8ded879aef9aa2523fbc40951d4e6364bbfc12c7e960e0a04
7
- data.tar.gz: e1c697f8a30a19d97ad28d2cc488b4d22da34fdc78b62cbe46f44028be0e93f4a9bfed34706116dd2c516afc6349bfff4dd4a5da5bfe4c3c066fc81ed211ffd7
6
+ metadata.gz: 49b8e28b830cd12d2cd5af053a07218ab9081d155d569fd1f42579ebcbe43e16c06612de3221b25a984a0928e4bb1e311c26d541b341b1f27d6f498fb7d430aa
7
+ data.tar.gz: fab03f7637243850574bcf4354fdcbc7f0d26d55aabb8070daafdc199196ae27e9370f0c68ae717ba204fde2b3eb4fa904b41ae238ace4926e879c28d39b0d9e
@@ -18,6 +18,8 @@ module Applitools
18
18
  end
19
19
  end
20
20
 
21
+ object_field :emulation_info, Applitools::Selenium::EmulationBaseInfo
22
+
21
23
  # def device_name
22
24
  # emulation_info.device_name
23
25
  # end
@@ -38,6 +40,15 @@ module Applitools
38
40
  end
39
41
  end
40
42
 
43
+ def to_s
44
+ "#{emulation_info.device_name} - #{emulation_info.screen_orientation}"
45
+ end
46
+
47
+ def device_name
48
+ emulation_info.device_name + ' (chrome emulation)'
49
+ end
50
+
51
+
41
52
  private
42
53
 
43
54
  class EmulationInfo < Applitools::Selenium::EmulationBaseInfo
@@ -36,8 +36,10 @@ module Applitools
36
36
  end
37
37
  end
38
38
 
39
+ def device_name
40
+ 'desktop'
41
+ end
42
+
39
43
  end
40
44
  end
41
45
  end
42
-
43
- Applitools::Selenium::RenderBrowserInfo = Applitools::Selenium::DesktopBrowserInfo
@@ -7,18 +7,9 @@ module Applitools
7
7
  string_field :platform
8
8
  string_field :size_mode
9
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
10
 
19
11
  def to_s
20
- return "#{viewport_size} (#{browser_type})" unless emulation_info
21
- "#{emulation_info.device_name} - #{emulation_info.screen_orientation}"
12
+ return "#{viewport_size} (#{browser_type})"
22
13
  end
23
14
  end
24
15
  end
@@ -11,6 +11,9 @@ module Applitools
11
11
  viewport_size: Applitools::RectangleSize.from_any_argument(width: 0, height: 0)
12
12
  }
13
13
  end
14
+
15
+ object_field :ios_device_info, Applitools::Selenium::EmulationBaseInfo
16
+
14
17
  class << self
15
18
  def default_config
16
19
  DEFAULT_CONFIG.call
@@ -25,6 +28,14 @@ module Applitools
25
28
  end
26
29
  end
27
30
 
31
+ def to_s
32
+ "#{ios_device_info.device_name} - #{ios_device_info.screen_orientation}"
33
+ end
34
+
35
+ def device_name
36
+ ios_device_info.device_name
37
+ end
38
+
28
39
  private
29
40
 
30
41
  class EmulationInfo < EmulationBaseInfo
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+ require 'applitools/selenium/browser_types'
3
+ # We should not break the API
4
+ module Applitools
5
+ module Selenium
6
+ class RenderBrowserInfo < 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
+ object_field :ios_device_info, Applitools::Selenium::EmulationBaseInfo
17
+ object_field :emulation_info, Applitools::Selenium::EmulationBaseInfo
18
+
19
+ class << self
20
+ def default_config
21
+ DEFAULT_CONFIG.call
22
+ end
23
+ end
24
+
25
+ def initialize(options = {})
26
+ super()
27
+ if options[:width] && options[:height]
28
+ self.viewport_size = Applitools::RectangleSize.from_any_argument(width: options[:width], height: options[:height])
29
+ end
30
+ self.browser_type = options[:browser_type] if options[:browser_type]
31
+ end
32
+
33
+ def platform
34
+ return 'ios' if ios_device_info
35
+ case browser_type
36
+ when BrowserTypes::EDGE_LEGACY, BrowserTypes::EDGE_CHROMIUM, BrowserTypes::EDGE_CHROMIUM_ONE_VERSION_BACK
37
+ 'windows'
38
+ else
39
+ 'linux'
40
+ end
41
+ end
42
+
43
+ def to_s
44
+ if emulation_info
45
+ "#{emulation_info.device_name} - #{emulation_info.screen_orientation}"
46
+ elsif ios_device_info
47
+ "#{ios_device_info.device_name} - #{ios_device_info.screen_orientation}"
48
+ end
49
+ "#{viewport_size} (#{browser_type})"
50
+ end
51
+
52
+ def device_name
53
+ if ios_device_info
54
+ return ios_device_info.device_name
55
+ elsif emulation_info
56
+ return emulation_info.device_name + ' (chrome emulation)'
57
+ end
58
+ 'desktop'
59
+ end
60
+ end
61
+ end
62
+ end
@@ -248,8 +248,11 @@ module Applitools
248
248
  r.height = running_test.browser_info.viewport_size.height
249
249
  r.size_mode = size_mode
250
250
  r.region = region_to_check
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
251
+ if running_test.browser_info.respond_to?(:emulation_info) && running_test.browser_info.emulation_info
252
+ r.emulation_info = running_test.browser_info.emulation_info
253
+ elsif running_test.browser_info.respond_to?(:ios_device_info) && running_test.browser_info.ios_device_info
254
+ r.ios_device_info = running_test.browser_info.ios_device_info
255
+ end
253
256
  end
254
257
 
255
258
  requests << Applitools::Selenium::RenderRequest.new(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Applitools
4
- VERSION = '3.17.3'.freeze
4
+ VERSION = '3.17.4'.freeze
5
5
  end
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.17.3
4
+ version: 3.17.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Applitools Team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-09 00:00:00.000000000 Z
11
+ date: 2020-06-11 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.17.3
19
+ version: 3.17.4
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.17.3
26
+ version: 3.17.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: selenium-webdriver
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -157,6 +157,7 @@ files:
157
157
  - lib/applitools/selenium/visual_grid/ios_device_info.rb
158
158
  - lib/applitools/selenium/visual_grid/ios_device_name.rb
159
159
  - lib/applitools/selenium/visual_grid/ios_screen_orientation.rb
160
+ - lib/applitools/selenium/visual_grid/render_browser_info.rb
160
161
  - lib/applitools/selenium/visual_grid/render_info.rb
161
162
  - lib/applitools/selenium/visual_grid/render_request.rb
162
163
  - lib/applitools/selenium/visual_grid/render_requests.rb
@@ -177,7 +178,7 @@ homepage: https://www.applitools.com
177
178
  licenses:
178
179
  - Applitools
179
180
  metadata: {}
180
- post_install_message:
181
+ post_install_message:
181
182
  rdoc_options: []
182
183
  require_paths:
183
184
  - lib
@@ -193,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
194
  version: '0'
194
195
  requirements: []
195
196
  rubygems_version: 3.0.8
196
- signing_key:
197
+ signing_key:
197
198
  specification_version: 4
198
199
  summary: Applitools Ruby Selenium SDK
199
200
  test_files: []