eyes_selenium 4.0.2 → 4.0.3

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
  SHA1:
3
- metadata.gz: 6f69513a5b231f5f97262b25d01781df9f7b3741
4
- data.tar.gz: 7826106e9c101ef46d60716d9c0f059fe76a27a6
3
+ metadata.gz: 6b2a7dcddcd09ae5b7b893102cf1e70cca424498
4
+ data.tar.gz: ce17bba2d34abe0a51201aa363f0ff1bb1578bf2
5
5
  SHA512:
6
- metadata.gz: 47c965e4d3dcec3a39bfca4147f3b2c1f552f86250ad44cd29d9187e0c4ce8fbabf02725aeb5a1a1473cff3d90604179cc4d4904bbc9fd28b32c8d981eb57437
7
- data.tar.gz: 263307a7e11d0d28d6579411b904bd8b0dbf2fe372207071a285fb06a0db46a4b3d56160b9f2eaf51a7a39c1b031d62382b4c03e8958ac700a52a338bee77c35
6
+ metadata.gz: ef39c99c0941c300005265d12b709b55c6494e40de4c0481e7d2944100265ece15acaee2c3eb97697b8890ab4e1cf9b74cb5b5c65510a5c5255279e259bf8779
7
+ data.tar.gz: 55c1689cfba6eb0f3cbe855c64c01691bf323eec3f62216021f8f7aeffbc3f92e73633977ab85e2cca11e97a04a750bb3a0f382df199a07bb8d0b83285077ccb
@@ -26,6 +26,7 @@ module Applitools
26
26
 
27
27
  boolean_field :force_full_page_screenshot
28
28
  int_field :wait_before_screenshots
29
+ int_field :wait_before_capture
29
30
  enum_field :stitch_mode, Applitools::Selenium::StitchModes.enum_values
30
31
  boolean_field :hide_scrollbars
31
32
  boolean_field :hide_caret
@@ -84,6 +85,14 @@ module Applitools
84
85
  add_browser emu
85
86
  end
86
87
 
88
+ def add_mobile_device(mobile_device_info)
89
+ add_mobile_devices(mobile_device_info)
90
+ end
91
+
92
+ def add_mobile_devices(mobile_device_infos)
93
+ add_browsers(mobile_device_infos)
94
+ end
95
+
87
96
  def viewport_size
88
97
  user_defined_vp = super
89
98
  user_defined_vp = nil if user_defined_vp.respond_to?(:square) && user_defined_vp.square == 0
@@ -112,7 +112,7 @@ module Applitools::Selenium
112
112
 
113
113
  logger.info "Creating stitchedImage container. Size: #{entire_size}"
114
114
 
115
- stitched_image = ::ChunkyPNG::Image.new(entire_size.width, entire_size.height)
115
+ # stitched_image = ::ChunkyPNG::Image.new(entire_size.width, entire_size.height)
116
116
  logger.info 'Done! Adding initial screenshot..'
117
117
  logger.info "Initial part:(0,0) [#{image.width} x #{image.height}]"
118
118
 
@@ -332,6 +332,18 @@ module Applitools
332
332
  self
333
333
  end
334
334
 
335
+ def wait_before_capture(value)
336
+ Applitools::ArgumentGuard.not_nil(value, 'wait_before_capture')
337
+ options[:wait_before_capture] = value
338
+ self
339
+ end
340
+
341
+ def page_id(value)
342
+ Applitools::ArgumentGuard.not_nil(value, 'page_id')
343
+ options[:page_id] = value
344
+ self
345
+ end
346
+
335
347
  private
336
348
 
337
349
  def reset_for_fullscreen
@@ -0,0 +1,65 @@
1
+ require_relative 'i_render_browser_info'
2
+ require_relative 'emulation_base_info'
3
+
4
+ module Applitools
5
+ module Selenium
6
+ class AndroidDeviceInfo < IRenderBrowserInfo
7
+ DEFAULT_CONFIG = proc do
8
+ {
9
+ viewport_size: Applitools::RectangleSize.from_any_argument(width: 0, height: 0)
10
+ }
11
+ end
12
+
13
+ object_field :android_device_info, Applitools::Selenium::EmulationBaseInfo
14
+
15
+ class << self
16
+ def default_config
17
+ DEFAULT_CONFIG.call
18
+ end
19
+ end
20
+
21
+ def initialize(options = {})
22
+ super
23
+ self.android_device_info = EmulationInfo.new.tap do |ei|
24
+ ei.device_name = options[:device_name]
25
+ ei.screen_orientation = options[:screen_orientation] || options[:orientation] || Orientation::PORTRAIT
26
+ end
27
+ end
28
+
29
+ def to_s
30
+ "#{android_device_info.device_name} - #{android_device_info.screen_orientation}"
31
+ end
32
+
33
+ def device_name
34
+ android_device_info.device_name
35
+ end
36
+
37
+ def to_hash
38
+ {androidDeviceInfo: android_device_info.to_hash}
39
+ end
40
+
41
+ private
42
+
43
+ class EmulationInfo < EmulationBaseInfo
44
+ enum_field :device_name, Devices.enum_values
45
+ enum_field :screen_orientation, Orientation.enum_values
46
+
47
+ def json_data
48
+ {
49
+ name: device_name,
50
+ screenOrientation: screen_orientation,
51
+ version: 'latest'
52
+ }
53
+ end
54
+
55
+ def to_hash
56
+ {
57
+ deviceName: device_name,
58
+ screenOrientation: screen_orientation,
59
+ iosVersion: 'latest'
60
+ }
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: false
2
+ module AndroidDeviceName
3
+ extend self
4
+ Pixel3XL = 'Pixel 3 XL'.freeze
5
+ Pixel4 = 'Pixel 4'.freeze
6
+ Pixel4XL = 'Pixel 4 XL'.freeze
7
+ GalaxyNote8 = 'Galaxy Note 8'.freeze
8
+ GalaxyNote9 = 'Galaxy Note 9'.freeze
9
+ GalaxyS8 = 'Galaxy S8'.freeze
10
+ GalaxyS8Plus = 'Galaxy S8 Plus'.freeze
11
+ GalaxyS9 = 'Galaxy S9'.freeze
12
+ GalaxyS9Plus = 'Galaxy S9 Plus'.freeze
13
+ GalaxyS10 = 'Galaxy S10'.freeze
14
+ GalaxyS10Plus = 'Galaxy S10 Plus'.freeze
15
+ GalaxyNote10 = 'Galaxy Note 10'.freeze
16
+ GalaxyNote10Plus = 'Galaxy Note 10 Plus'.freeze
17
+ GalaxyS20 = 'Galaxy S20'.freeze
18
+ GalaxyS20Plus = 'Galaxy S20 Plus'.freeze
19
+ GalaxyS21 = 'Galaxy S21'.freeze
20
+ GalaxyS21Plus = 'Galaxy S21 Plus'.freeze
21
+ GalaxyS21Ultra = 'Galaxy S21 Ultra'.freeze
22
+
23
+ def enum_values
24
+ [
25
+ Pixel3XL,
26
+ Pixel4,
27
+ Pixel4XL,
28
+ GalaxyNote8,
29
+ GalaxyNote9,
30
+ GalaxyS8,
31
+ GalaxyS8Plus,
32
+ GalaxyS9,
33
+ GalaxyS9Plus,
34
+ GalaxyS10,
35
+ GalaxyS10Plus,
36
+ GalaxyNote10,
37
+ GalaxyNote10Plus,
38
+ GalaxyS20,
39
+ GalaxyS20Plus,
40
+ GalaxyS21,
41
+ GalaxyS21Plus,
42
+ GalaxyS21Ultra,
43
+ ]
44
+ end
45
+ end
@@ -19,6 +19,8 @@ module IosDeviceName
19
19
  IPad_7 = 'iPad (7th generation)'
20
20
  IPad_9 = 'iPad (9th generation)'
21
21
  IPad_Air_2 = 'iPad Air (2nd generation)'
22
+ IPhone_8_Plus = 'iPhone 8 Plus'
23
+ IPhone_SE = 'iPhone SE (1st generation)'
22
24
 
23
25
  def enum_values
24
26
  [
@@ -40,7 +42,9 @@ module IosDeviceName
40
42
  IPad_Pro_3,
41
43
  IPad_7,
42
44
  IPad_9,
43
- IPad_Air_2
45
+ IPad_Air_2,
46
+ IPhone_8_Plus,
47
+ IPhone_SE
44
48
  ]
45
49
  end
46
50
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Applitools
4
- VERSION = '4.0.2'.freeze
5
- UNIVERSAL_VERSION = '1.0.9'.freeze
4
+ VERSION = '4.0.3'.freeze
5
+ UNIVERSAL_VERSION = '2.5.7'.freeze
6
6
  end
data/lib/eyes_selenium.rb CHANGED
@@ -34,11 +34,19 @@ if defined? Selenium::WebDriver::Driver
34
34
 
35
35
  def universal_driver_config
36
36
  hidden_server_url = bridge.http.send(:server_url).to_s
37
- {
38
- serverUrl: hidden_server_url,
39
- sessionId: session_id,
40
- capabilities: capabilities.as_json
41
- }
37
+ if respond_to?(:session_id)
38
+ {
39
+ serverUrl: hidden_server_url,
40
+ sessionId: session_id,
41
+ capabilities: capabilities.as_json
42
+ }
43
+ else
44
+ {
45
+ serverUrl: hidden_server_url,
46
+ sessionId: bridge.session_id,
47
+ capabilities: capabilities.as_json
48
+ }
49
+ end
42
50
  end
43
51
  end
44
52
  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: 4.0.2
4
+ version: 4.0.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: 2022-02-17 00:00:00.000000000 Z
11
+ date: 2022-05-12 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: 4.0.2
19
+ version: 4.0.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: 4.0.2
26
+ version: 4.0.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: selenium-webdriver
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -151,6 +151,8 @@ files:
151
151
  - lib/applitools/selenium/test_list.rb
152
152
  - lib/applitools/selenium/viewport_screenshot.rb
153
153
  - lib/applitools/selenium/viewport_size.rb
154
+ - lib/applitools/selenium/visual_grid/android_device_info.rb
155
+ - lib/applitools/selenium/visual_grid/android_device_name.rb
154
156
  - lib/applitools/selenium/visual_grid/chrome_emulation_info.rb
155
157
  - lib/applitools/selenium/visual_grid/desktop_browser_info.rb
156
158
  - lib/applitools/selenium/visual_grid/dom_snapshot_script.rb