eyes_selenium 4.0.0 → 4.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/applitools/selenium/configuration.rb +9 -0
- data/lib/applitools/selenium/full_page_capture_algorithm.rb +1 -1
- data/lib/applitools/selenium/target.rb +12 -0
- data/lib/applitools/selenium/visual_grid/android_device_info.rb +65 -0
- data/lib/applitools/selenium/visual_grid/android_device_name.rb +45 -0
- data/lib/applitools/selenium/visual_grid/ios_device_name.rb +5 -1
- data/lib/applitools/version.rb +2 -2
- data/lib/eyes_selenium.rb +13 -5
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44abd69cb1183c038f902f467f88c44b00603b3e
|
4
|
+
data.tar.gz: f56b5f3357a34dc07f901df912b16845116bf2dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d228cfd7ff4428176f9760bba208bfdf59d1f3f63dfacfe18fd3581aa4ba5b700b71fa0673cd410f4ba4f1494602432492b44da474938844bde1f4ade0e09d16
|
7
|
+
data.tar.gz: 4a695c88464e9e3b9d0f805da0eddd0c7534a3d80dbde128e6e1e657182e7b5fc4c9772bc57297e27b06ca3ebaecb88c68a8b1d6493134b608d905c442de0eb0
|
@@ -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
|
data/lib/applitools/version.rb
CHANGED
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
|
-
|
39
|
-
|
40
|
-
|
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.
|
4
|
+
version: 4.0.4
|
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-
|
11
|
+
date: 2022-05-13 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.
|
19
|
+
version: 4.0.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: 4.0.
|
26
|
+
version: 4.0.4
|
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
|