eyes_core 3.18.4 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/applitools/appium/eyes.rb +3 -2
- data/lib/applitools/appium/target.rb +218 -193
- data/lib/applitools/calabash/calabash_screenshot_provider.rb +23 -23
- data/lib/applitools/calabash/full_page_capture_algorithm/base.rb +1 -1
- data/lib/applitools/connectivity/proxy.rb +11 -3
- data/lib/applitools/connectivity/server_connector.rb +2 -1
- data/lib/applitools/core/accessibility_level.rb +11 -0
- data/lib/applitools/core/batch_info.rb +24 -2
- data/lib/applitools/core/classic_runner.rb +9 -1
- data/lib/applitools/core/debug_screenshot_provider.rb +3 -3
- data/lib/applitools/core/eyes_base.rb +81 -28
- data/lib/applitools/core/eyes_base_configuration.rb +22 -1
- data/lib/applitools/core/eyes_runner.rb +12 -0
- data/lib/applitools/core/floating_region.rb +17 -8
- data/lib/applitools/core/image_match_settings.rb +54 -0
- data/lib/applitools/core/match_level.rb +3 -1
- data/lib/applitools/core/screenshot.rb +7 -7
- data/lib/applitools/core/test_result_summary.rb +17 -4
- data/lib/applitools/core/test_results.rb +2 -2
- data/lib/applitools/core/universal_eyes_checks.rb +66 -0
- data/lib/applitools/core/universal_eyes_open.rb +100 -0
- data/lib/applitools/core/universal_new_api.rb +43 -0
- data/lib/applitools/universal_sdk/universal_check_settings.rb +190 -0
- data/lib/applitools/universal_sdk/universal_client.rb +142 -0
- data/lib/applitools/universal_sdk/universal_client_socket.rb +110 -0
- data/lib/applitools/universal_sdk/universal_eyes.rb +45 -0
- data/lib/applitools/universal_sdk/universal_eyes_config.rb +205 -0
- data/lib/applitools/universal_sdk/universal_eyes_manager.rb +40 -0
- data/lib/applitools/universal_sdk/universal_eyes_manager_config.rb +62 -0
- data/lib/applitools/universal_sdk/universal_server.rb +81 -0
- data/lib/applitools/utils/image_utils.rb +7 -7
- data/lib/applitools/utils/utils.rb +13 -0
- data/lib/applitools/version.rb +2 -1
- data/lib/eyes_core.rb +4 -1
- metadata +55 -18
- data/lib/applitools/chunky_png/resampling.rb +0 -51
- data/lib/applitools/chunky_png_patch.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1794c043c986eae53c0ec2f544c3927d23e8e35
|
4
|
+
data.tar.gz: cdabd0d4c839a670abfe72a506d10ac0328e0fa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abb2ce4f8d46e97979e7e68d075ab5d910512d208c46f6202096e40d8bbe4c4411ded61ceff4e55496b6941d1579ef463917b69803fcdfc196d5fe14c95fee87
|
7
|
+
data.tar.gz: 96637eb89ef8c1604aa330eecb3b4155f0aae98d98221008c2bd0e73508881c9b9cd5230c7a6e05c3886fbdc3e1aefb7e767362140bdd8d048d95eb739b15c2a
|
@@ -36,6 +36,7 @@ class Applitools::Appium::Eyes < Applitools::Selenium::SeleniumEyes
|
|
36
36
|
self.tag_for_debug = name
|
37
37
|
Applitools::ArgumentGuard.one_of? target, 'target', [Applitools::Selenium::Target, Applitools::Appium::Target]
|
38
38
|
|
39
|
+
return universal_check(name, target)
|
39
40
|
return check_native(name, target) if native_app?
|
40
41
|
super
|
41
42
|
end
|
@@ -83,8 +84,8 @@ class Applitools::Appium::Eyes < Applitools::Selenium::SeleniumEyes
|
|
83
84
|
self.screenshot = screenshot_class.new(
|
84
85
|
Applitools::Screenshot.from_image(
|
85
86
|
case scaled_image
|
86
|
-
when ChunkyPNG::Image
|
87
|
-
|
87
|
+
# when ChunkyPNG::Image
|
88
|
+
# scaled_image
|
88
89
|
when Applitools::Screenshot::Datastream
|
89
90
|
scaled_image.image
|
90
91
|
else
|
@@ -2,207 +2,232 @@
|
|
2
2
|
|
3
3
|
module Applitools
|
4
4
|
module Appium
|
5
|
-
class Target
|
6
|
-
include Applitools::FluentInterface
|
7
|
-
attr_accessor :region_to_check, :options, :ignored_regions, :floating_regions, :layout_regions, :content_regions, :strict_regions, :accessibility_regions
|
8
|
-
|
9
|
-
class << self
|
10
|
-
def window
|
11
|
-
new
|
12
|
-
end
|
13
|
-
|
14
|
-
def region(*args)
|
15
|
-
new.region(*args)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def initialize
|
20
|
-
self.region_to_check = proc { Applitools::Region::EMPTY }
|
21
|
-
self.ignored_regions = []
|
22
|
-
self.floating_regions = []
|
23
|
-
self.layout_regions = []
|
24
|
-
self.content_regions = []
|
25
|
-
self.strict_regions = []
|
26
|
-
self.accessibility_regions = []
|
27
|
-
self.options = {}
|
28
|
-
end
|
29
|
-
|
30
|
-
def region(*args)
|
31
|
-
self.region_to_check = case args.first
|
32
|
-
when ::Selenium::WebDriver::Element
|
33
|
-
proc { args.first }
|
34
|
-
else
|
35
|
-
proc do |driver|
|
36
|
-
driver.find_element(*args)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
self
|
40
|
-
end
|
5
|
+
class Target < Applitools::Selenium::Target
|
41
6
|
|
42
7
|
def ignore(*args)
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
proc do
|
51
|
-
Applitools::Region
|
52
|
-
.from_location_size(first_argument.location, first_argument.size)
|
53
|
-
.padding(requested_padding)
|
54
|
-
end
|
55
|
-
when Applitools::Region
|
56
|
-
result = first_argument.padding(requested_padding)
|
57
|
-
if Applitools::Appium::Utils.ios?(Applitools::Appium::Driver::AppiumLib)
|
58
|
-
def result.converted?
|
59
|
-
true
|
60
|
-
end
|
61
|
-
end
|
62
|
-
result
|
63
|
-
else
|
64
|
-
proc do |driver|
|
65
|
-
element = driver.find_element(*args)
|
66
|
-
Applitools::Region
|
67
|
-
.from_location_size(element.location, element.size)
|
68
|
-
.padding(requested_padding)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
self
|
72
|
-
end
|
73
|
-
|
74
|
-
def floating(*args)
|
75
|
-
value = case args.first
|
76
|
-
when Applitools::FloatingRegion
|
77
|
-
args.first
|
78
|
-
when Applitools::Region
|
79
|
-
result = Applitools::FloatingRegion.any(*args)
|
80
|
-
if Applitools::Appium::Utils.ios?(Applitools::Appium::Driver::AppiumLib)
|
81
|
-
def result.converted?
|
82
|
-
true
|
83
|
-
end
|
84
|
-
end
|
85
|
-
result
|
86
|
-
when ::Selenium::WebDriver::Element
|
87
|
-
args_dup = args.dup
|
88
|
-
Applitools::FloatingRegion.any(*args_dup)
|
89
|
-
else
|
90
|
-
proc do |driver|
|
91
|
-
args_dup = args.dup
|
92
|
-
region = driver.find_element(args_dup.shift, args_dup.shift)
|
93
|
-
Applitools::FloatingRegion.any(
|
94
|
-
region, *args_dup
|
95
|
-
)
|
96
|
-
end
|
97
|
-
end
|
98
|
-
floating_regions << value
|
99
|
-
self
|
100
|
-
end
|
101
|
-
|
102
|
-
def layout
|
103
|
-
return match_level(Applitools::MatchLevel::LAYOUT) if args.empty?
|
104
|
-
region = process_region(*args)
|
105
|
-
layout_regions << region
|
106
|
-
self
|
107
|
-
|
108
|
-
end
|
109
|
-
|
110
|
-
def content(*args)
|
111
|
-
return match_level(Applitools::MatchLevel::CONTENT) if args.empty?
|
112
|
-
region = process_region(*args)
|
113
|
-
content_regions << region
|
114
|
-
self
|
115
|
-
end
|
116
|
-
|
117
|
-
def strict(*args)
|
118
|
-
return match_level(Applitools::MatchLevel::STRICT) if args.empty?
|
119
|
-
region = process_region(*args)
|
120
|
-
strict_regions << region
|
121
|
-
self
|
122
|
-
end
|
123
|
-
|
124
|
-
def exact(*args)
|
125
|
-
match_level(Applitools::MatchLevel::EXACT, *args)
|
126
|
-
end
|
127
|
-
|
128
|
-
def accessibility(*args)
|
129
|
-
options = Applitools::Utils.extract_options! args
|
130
|
-
unless options[:type]
|
131
|
-
raise Applitools::EyesError,
|
132
|
-
'You should call Target.accessibility(region, type: type). The region_type option is required'
|
133
|
-
end
|
134
|
-
unless Applitools::AccessibilityRegionType.enum_values.include?(options[:type])
|
135
|
-
raise Applitools::EyesIllegalArgument,
|
136
|
-
"The region type should be one of [#{Applitools::AccessibilityRegionType.enum_values.join(', ')}]"
|
8
|
+
if args.empty?
|
9
|
+
reset_ignore
|
10
|
+
else
|
11
|
+
value = convert_to_universal(args)
|
12
|
+
value = { type: args[0], selector: args[1] } if value.nil?
|
13
|
+
# value = value[:selector] if value.is_a?(Hash) && (value[:type].to_s === 'id') && !is_a?(Applitools::Appium::Target)
|
14
|
+
ignored_regions << value
|
137
15
|
end
|
138
|
-
|
139
|
-
accessibility_regions << case args.first
|
140
|
-
when ::Selenium::WebDriver::Element
|
141
|
-
element = args.first
|
142
|
-
Applitools::AccessibilityRegion.new(
|
143
|
-
element,
|
144
|
-
options[:type]
|
145
|
-
)
|
146
|
-
when Applitools::Region
|
147
|
-
result = Applitools::AccessibilityRegion.new(
|
148
|
-
args.first, options[:type]
|
149
|
-
)
|
150
|
-
if Applitools::Appium::Utils.ios?(Applitools::Appium::Driver::AppiumLib)
|
151
|
-
def result.converted?
|
152
|
-
true
|
153
|
-
end
|
154
|
-
end
|
155
|
-
result
|
156
|
-
when String
|
157
|
-
proc do |driver|
|
158
|
-
element = driver.find_element(name_or_id: args.first)
|
159
|
-
Applitools::AccessibilityRegion.new(
|
160
|
-
element,
|
161
|
-
options[:type]
|
162
|
-
)
|
163
|
-
end
|
164
|
-
else
|
165
|
-
proc do |driver|
|
166
|
-
elements = driver.find_elements(*args)
|
167
|
-
elements.map do |e|
|
168
|
-
Applitools::AccessibilityRegion.new(
|
169
|
-
e,
|
170
|
-
options[:type]
|
171
|
-
)
|
172
|
-
end
|
173
|
-
end
|
174
|
-
end
|
175
16
|
self
|
176
17
|
end
|
177
18
|
|
178
|
-
def
|
19
|
+
def region(*args)
|
20
|
+
value = convert_to_universal(args)
|
21
|
+
value = { type: args[0], selector: args[1] } if value.nil?
|
22
|
+
# value = value[:selector] if value.is_a?(Hash) && (value[:type].to_s === 'id') && !is_a?(Applitools::Appium::Target)
|
23
|
+
self.region_to_check = value
|
24
|
+
self.coordinate_type = Applitools::EyesScreenshot::COORDINATE_TYPES[:context_relative]
|
25
|
+
options[:timeout] = nil
|
26
|
+
reset_ignore
|
27
|
+
reset_floating
|
179
28
|
self
|
180
29
|
end
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
30
|
+
# class Target
|
31
|
+
# include Applitools::FluentInterface
|
32
|
+
# attr_accessor :region_to_check, :options, :ignored_regions, :floating_regions, :layout_regions, :content_regions, :strict_regions, :accessibility_regions
|
33
|
+
#
|
34
|
+
# class << self
|
35
|
+
# def window
|
36
|
+
# new
|
37
|
+
# end
|
38
|
+
#
|
39
|
+
# def region(*args)
|
40
|
+
# new.region(*args)
|
41
|
+
# end
|
42
|
+
# end
|
43
|
+
#
|
44
|
+
# def initialize
|
45
|
+
# self.region_to_check = proc { Applitools::Region::EMPTY }
|
46
|
+
# self.ignored_regions = []
|
47
|
+
# self.floating_regions = []
|
48
|
+
# self.layout_regions = []
|
49
|
+
# self.content_regions = []
|
50
|
+
# self.strict_regions = []
|
51
|
+
# self.accessibility_regions = []
|
52
|
+
# self.options = {}
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# def region(*args)
|
56
|
+
# self.region_to_check = case args.first
|
57
|
+
# when ::Selenium::WebDriver::Element
|
58
|
+
# proc { args.first }
|
59
|
+
# else
|
60
|
+
# proc do |driver|
|
61
|
+
# driver.find_element(*args)
|
62
|
+
# end
|
63
|
+
# end
|
64
|
+
# self
|
65
|
+
# end
|
66
|
+
#
|
67
|
+
# def ignore(*args)
|
68
|
+
# requested_padding = if args.last.is_a? Applitools::PaddingBounds
|
69
|
+
# args.pop
|
70
|
+
# else
|
71
|
+
# Applitools::PaddingBounds::ZERO_PADDING
|
72
|
+
# end
|
73
|
+
# ignored_regions << case (first_argument = args.first)
|
74
|
+
# when ::Selenium::WebDriver::Element
|
75
|
+
# proc do
|
76
|
+
# Applitools::Region
|
77
|
+
# .from_location_size(first_argument.location, first_argument.size)
|
78
|
+
# .padding(requested_padding)
|
79
|
+
# end
|
80
|
+
# when Applitools::Region
|
81
|
+
# result = first_argument.padding(requested_padding)
|
82
|
+
# if Applitools::Appium::Utils.ios?(Applitools::Appium::Driver::AppiumLib)
|
83
|
+
# def result.converted?
|
84
|
+
# true
|
85
|
+
# end
|
86
|
+
# end
|
87
|
+
# result
|
88
|
+
# else
|
89
|
+
# proc do |driver|
|
90
|
+
# element = driver.find_element(*args)
|
91
|
+
# Applitools::Region
|
92
|
+
# .from_location_size(element.location, element.size)
|
93
|
+
# .padding(requested_padding)
|
94
|
+
# end
|
95
|
+
# end
|
96
|
+
# self
|
97
|
+
# end
|
98
|
+
#
|
99
|
+
# def floating(*args)
|
100
|
+
# value = case args.first
|
101
|
+
# when Applitools::FloatingRegion
|
102
|
+
# args.first
|
103
|
+
# when Applitools::Region
|
104
|
+
# result = Applitools::FloatingRegion.any(*args)
|
105
|
+
# if Applitools::Appium::Utils.ios?(Applitools::Appium::Driver::AppiumLib)
|
106
|
+
# def result.converted?
|
107
|
+
# true
|
108
|
+
# end
|
109
|
+
# end
|
110
|
+
# result
|
111
|
+
# when ::Selenium::WebDriver::Element
|
112
|
+
# args_dup = args.dup
|
113
|
+
# Applitools::FloatingRegion.any(*args_dup)
|
114
|
+
# else
|
115
|
+
# proc do |driver|
|
116
|
+
# args_dup = args.dup
|
117
|
+
# region = driver.find_element(args_dup.shift, args_dup.shift)
|
118
|
+
# Applitools::FloatingRegion.any(
|
119
|
+
# region, *args_dup
|
120
|
+
# )
|
121
|
+
# end
|
122
|
+
# end
|
123
|
+
# floating_regions << value
|
124
|
+
# self
|
125
|
+
# end
|
126
|
+
#
|
127
|
+
# def layout
|
128
|
+
# return match_level(Applitools::MatchLevel::LAYOUT) if args.empty?
|
129
|
+
# region = process_region(*args)
|
130
|
+
# layout_regions << region
|
131
|
+
# self
|
132
|
+
#
|
133
|
+
# end
|
134
|
+
#
|
135
|
+
# def content(*args)
|
136
|
+
# return match_level(Applitools::MatchLevel::CONTENT) if args.empty?
|
137
|
+
# region = process_region(*args)
|
138
|
+
# content_regions << region
|
139
|
+
# self
|
140
|
+
# end
|
141
|
+
#
|
142
|
+
# def strict(*args)
|
143
|
+
# return match_level(Applitools::MatchLevel::STRICT) if args.empty?
|
144
|
+
# region = process_region(*args)
|
145
|
+
# strict_regions << region
|
146
|
+
# self
|
147
|
+
# end
|
148
|
+
#
|
149
|
+
# def exact(*args)
|
150
|
+
# match_level(Applitools::MatchLevel::EXACT, *args)
|
151
|
+
# end
|
152
|
+
#
|
153
|
+
# def accessibility(*args)
|
154
|
+
# options = Applitools::Utils.extract_options! args
|
155
|
+
# unless options[:type]
|
156
|
+
# raise Applitools::EyesError,
|
157
|
+
# 'You should call Target.accessibility(region, type: type). The region_type option is required'
|
158
|
+
# end
|
159
|
+
# unless Applitools::AccessibilityRegionType.enum_values.include?(options[:type])
|
160
|
+
# raise Applitools::EyesIllegalArgument,
|
161
|
+
# "The region type should be one of [#{Applitools::AccessibilityRegionType.enum_values.join(', ')}]"
|
162
|
+
# end
|
163
|
+
#
|
164
|
+
# accessibility_regions << case args.first
|
165
|
+
# when ::Selenium::WebDriver::Element
|
166
|
+
# element = args.first
|
167
|
+
# Applitools::AccessibilityRegion.new(
|
168
|
+
# element,
|
169
|
+
# options[:type]
|
170
|
+
# )
|
171
|
+
# when Applitools::Region
|
172
|
+
# result = Applitools::AccessibilityRegion.new(
|
173
|
+
# args.first, options[:type]
|
174
|
+
# )
|
175
|
+
# if Applitools::Appium::Utils.ios?(Applitools::Appium::Driver::AppiumLib)
|
176
|
+
# def result.converted?
|
177
|
+
# true
|
178
|
+
# end
|
179
|
+
# end
|
180
|
+
# result
|
181
|
+
# when String
|
182
|
+
# proc do |driver|
|
183
|
+
# element = driver.find_element(name_or_id: args.first)
|
184
|
+
# Applitools::AccessibilityRegion.new(
|
185
|
+
# element,
|
186
|
+
# options[:type]
|
187
|
+
# )
|
188
|
+
# end
|
189
|
+
# else
|
190
|
+
# proc do |driver|
|
191
|
+
# elements = driver.find_elements(*args)
|
192
|
+
# elements.map do |e|
|
193
|
+
# Applitools::AccessibilityRegion.new(
|
194
|
+
# e,
|
195
|
+
# options[:type]
|
196
|
+
# )
|
197
|
+
# end
|
198
|
+
# end
|
199
|
+
# end
|
200
|
+
# self
|
201
|
+
# end
|
202
|
+
#
|
203
|
+
# def finalize
|
204
|
+
# self
|
205
|
+
# end
|
206
|
+
#
|
207
|
+
# private
|
208
|
+
#
|
209
|
+
# def process_region(*args)
|
210
|
+
# r = args.first
|
211
|
+
# case r
|
212
|
+
# when ::Selenium::WebDriver::Element
|
213
|
+
# proc do |driver|
|
214
|
+
# Applitools::Region.from_location_size(r.location, r.size)
|
215
|
+
# end
|
216
|
+
# when Applitools::Region
|
217
|
+
# if Applitools::Appium::Utils.ios?(Applitools::Appium::Driver::AppiumLib)
|
218
|
+
# def r.converted?
|
219
|
+
# true
|
220
|
+
# end
|
221
|
+
# end
|
222
|
+
# r
|
223
|
+
# else
|
224
|
+
# proc do |driver|
|
225
|
+
# element = driver.find_element(*args)
|
226
|
+
# Applitools::Region.from_location_size(element.location, element.size)
|
227
|
+
# end
|
228
|
+
# end
|
229
|
+
# end
|
230
|
+
#
|
206
231
|
end
|
207
232
|
end
|
208
233
|
end
|
@@ -44,19 +44,19 @@ module Applitools
|
|
44
44
|
def capture_screenshot(options = {})
|
45
45
|
sleep WAIT_BEFORE_SCREENSHOT
|
46
46
|
result = nil
|
47
|
-
Applitools::Calabash::Utils.using_screenshot(context) do |screenshot_path|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
end
|
47
|
+
# Applitools::Calabash::Utils.using_screenshot(context) do |screenshot_path|
|
48
|
+
# screenshot = ::ChunkyPNG::Image.from_file(screenshot_path)
|
49
|
+
# save_debug_screenshot(screenshot, ['original', options[:debug_suffix]])
|
50
|
+
# viewport_size = Applitools::Calabash::EyesSettings.instance.viewport_size
|
51
|
+
# screenshot.crop!(0, 0, viewport_size[:width], viewport_size[:height])
|
52
|
+
# save_debug_screenshot(screenshot, ['cropped', options[:debug_suffix]])
|
53
|
+
# result = Applitools::Calabash::EyesCalabashAndroidScreenshot.new(
|
54
|
+
# Applitools::Screenshot.from_image(
|
55
|
+
# screenshot
|
56
|
+
# ),
|
57
|
+
# density: density
|
58
|
+
# )
|
59
|
+
# end
|
60
60
|
result
|
61
61
|
end
|
62
62
|
end
|
@@ -66,16 +66,16 @@ module Applitools
|
|
66
66
|
def capture_screenshot(options = {})
|
67
67
|
sleep WAIT_BEFORE_SCREENSHOT
|
68
68
|
result = nil
|
69
|
-
Applitools::Calabash::Utils.using_screenshot(context) do |screenshot_path|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
end
|
69
|
+
# Applitools::Calabash::Utils.using_screenshot(context) do |screenshot_path|
|
70
|
+
# screenshot = ::ChunkyPNG::Image.from_file(screenshot_path)
|
71
|
+
# save_debug_screenshot(screenshot, options[:debug_suffix])
|
72
|
+
# result = Applitools::Calabash::EyesCalabashIosScreenshot.new(
|
73
|
+
# Applitools::Screenshot.from_image(
|
74
|
+
# screenshot
|
75
|
+
# ),
|
76
|
+
# scale_factor: density
|
77
|
+
# )
|
78
|
+
# end
|
79
79
|
result
|
80
80
|
end
|
81
81
|
end
|
@@ -30,7 +30,7 @@ module Applitools
|
|
30
30
|
|
31
31
|
def create_entire_image
|
32
32
|
current_entire_size = entire_size
|
33
|
-
@stitched_image = ::ChunkyPNG::Image.new(current_entire_size.width, current_entire_size.height)
|
33
|
+
# @stitched_image = ::ChunkyPNG::Image.new(current_entire_size.width, current_entire_size.height)
|
34
34
|
end
|
35
35
|
|
36
36
|
def entire_content
|
@@ -1,12 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Applitools::Connectivity
|
4
|
-
Proxy = Struct.new(:uri, :user, :password) do
|
4
|
+
Proxy = Struct.new(:uri, :user, :password, :is_http_only) do
|
5
|
+
# export type Proxy = {
|
6
|
+
# url: string
|
7
|
+
# username?: string
|
8
|
+
# password?: string
|
9
|
+
# isHttpOnly?: boolean
|
10
|
+
# }
|
5
11
|
def to_hash
|
6
12
|
result = {}
|
7
|
-
result[:
|
8
|
-
result[:
|
13
|
+
result[:url] = uri.is_a?(String) ? uri : uri.to_s
|
14
|
+
result[:username] = user unless user.nil?
|
9
15
|
result[:password] = password unless password.nil?
|
16
|
+
result[:isHttpOnly] = !!is_http_only unless is_http_only.nil?
|
10
17
|
result
|
11
18
|
end
|
12
19
|
|
@@ -19,3 +26,4 @@ module Applitools::Connectivity
|
|
19
26
|
end
|
20
27
|
end
|
21
28
|
end
|
29
|
+
# U-Notes : add is_http_only/isHttpOnly flag
|
@@ -310,10 +310,11 @@ module Applitools::Connectivity
|
|
310
310
|
private
|
311
311
|
|
312
312
|
def faraday_connection(url, pass_user_agent_header = true)
|
313
|
+
raise Applitools::NotUniversalServerRequestError.new(url)
|
313
314
|
Faraday.new(
|
314
315
|
url: url,
|
315
316
|
ssl: { ca_file: SSL_CERT },
|
316
|
-
proxy: @proxy.nil? ? nil : @proxy.
|
317
|
+
proxy: @proxy.nil? ? nil : {uri: @proxy.uri}
|
317
318
|
) do |faraday|
|
318
319
|
if pass_user_agent_header
|
319
320
|
faraday.use(
|
@@ -42,5 +42,16 @@ module Applitools
|
|
42
42
|
def json_data
|
43
43
|
to_h
|
44
44
|
end
|
45
|
+
|
46
|
+
# accessibilitySettings?: {
|
47
|
+
# level?: AccessibilityLevel
|
48
|
+
# guidelinesVersion?: AccessibilityGuidelinesVersion
|
49
|
+
# }
|
50
|
+
def to_hash
|
51
|
+
{
|
52
|
+
level: level,
|
53
|
+
guidelinesVersion: version
|
54
|
+
}
|
55
|
+
end
|
45
56
|
end
|
46
57
|
end
|
@@ -4,6 +4,8 @@ require 'securerandom'
|
|
4
4
|
require 'applitools/utils/utils'
|
5
5
|
require_relative 'helpers'
|
6
6
|
|
7
|
+
PROCESS_DEFAULT_BATCH_ID = SecureRandom.uuid # Unique per-process
|
8
|
+
|
7
9
|
module Applitools
|
8
10
|
class BatchInfo
|
9
11
|
extend Helpers
|
@@ -30,7 +32,7 @@ module Applitools
|
|
30
32
|
if id
|
31
33
|
self.id = id
|
32
34
|
elsif self.id.nil? || self.id.empty?
|
33
|
-
self.id =
|
35
|
+
self.id = PROCESS_DEFAULT_BATCH_ID
|
34
36
|
end
|
35
37
|
self.properties = properties if properties
|
36
38
|
self.notify_on_completion = 'true'.casecmp(env_notify_on_completion || '') == 0 ? true : false
|
@@ -47,8 +49,27 @@ module Applitools
|
|
47
49
|
}
|
48
50
|
end
|
49
51
|
|
52
|
+
# export type Batch = {
|
53
|
+
# id?: string
|
54
|
+
# name?: string
|
55
|
+
# sequenceName?: string
|
56
|
+
# startedAt?: Date | string
|
57
|
+
# notifyOnCompletion?: boolean
|
58
|
+
# properties?: CustomProperty[]
|
59
|
+
# }
|
60
|
+
# export type CustomProperty = {
|
61
|
+
# name: string
|
62
|
+
# value: string
|
63
|
+
# }
|
50
64
|
def to_hash
|
51
|
-
|
65
|
+
{
|
66
|
+
id: id,
|
67
|
+
name: name, # 'Ruby Coverage Tests',
|
68
|
+
startedAt: @started_at.iso8601,
|
69
|
+
sequenceName: sequence_name,
|
70
|
+
notifyOnCompletion: notify_on_completion,
|
71
|
+
properties: properties
|
72
|
+
}.compact
|
52
73
|
end
|
53
74
|
|
54
75
|
def to_s
|
@@ -56,3 +77,4 @@ module Applitools
|
|
56
77
|
end
|
57
78
|
end
|
58
79
|
end
|
80
|
+
# U-Notes : change 'batchSequenceName' to 'sequenceName'
|
@@ -29,11 +29,19 @@ module Applitools
|
|
29
29
|
ensure
|
30
30
|
delete_all_batches
|
31
31
|
end
|
32
|
-
all_test_results
|
32
|
+
return all_test_results unless all_test_results.empty?
|
33
|
+
all_universal_results = close_all_eyes
|
34
|
+
test_result_summary = Applitools::TestResultSummary.new(all_universal_results).old_style_results_array
|
35
|
+
return [] if test_result_summary.reject { |tr| tr.aborted? }.empty?
|
36
|
+
test_result_summary
|
33
37
|
end
|
34
38
|
|
35
39
|
def rendering_info(connector)
|
36
40
|
@rendering_info ||= RenderingInfo.new(connector.rendering_info)
|
37
41
|
end
|
42
|
+
|
43
|
+
def universal_eyes_manager_config
|
44
|
+
Applitools::UniversalEyesManagerConfig.classic
|
45
|
+
end
|
38
46
|
end
|
39
47
|
end
|
@@ -13,12 +13,12 @@ module Applitools
|
|
13
13
|
def save(image, suffix = '')
|
14
14
|
return unless debug
|
15
15
|
case image
|
16
|
-
when
|
16
|
+
when Applitools::Screenshot
|
17
17
|
image.save(file_name_to_save(suffix)) if image.area > 0
|
18
18
|
when Applitools::EyesScreenshot
|
19
19
|
image.image.save(file_name_to_save(suffix)) if image.image.area > 0
|
20
|
-
when String
|
21
|
-
|
20
|
+
# when String
|
21
|
+
# ::ChunkyPNG::Image.from_string(image).save(file_name_to_save(suffix))
|
22
22
|
else
|
23
23
|
return
|
24
24
|
end
|