eyes_selenium 3.15.35 → 3.15.36
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 +4 -4
- data/lib/applitools/selenium/configuration.rb +12 -2
- data/lib/applitools/selenium/css_translate_position_provider.rb +1 -1
- data/lib/applitools/selenium/selenium_eyes.rb +22 -22
- data/lib/applitools/selenium/target.rb +65 -2
- data/lib/applitools/selenium/visual_grid/eyes_connector.rb +12 -12
- data/lib/applitools/selenium/visual_grid/vg_match_window_data.rb +14 -1
- data/lib/applitools/selenium/visual_grid/visual_grid_eyes.rb +18 -1
- data/lib/applitools/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98905b34227b182a4581d739c47ff5f739589e69d6474d0814f5701d25d49958
|
4
|
+
data.tar.gz: 25b294fc312dca6753f9c79c4d1738c6eb52d4085931cd1dd07541291b860402
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d908efe3bf2ca41e3d2e5091c0c181d066370c4da3563679eb706ae456cc947fe13bb37c8d612884a9a255d21cbd2a3efcfe91d532146411d28c1b40adf4136f
|
7
|
+
data.tar.gz: f0b1b319f3ed27dd24e1641e6821728824fcb54279c072353c3c60f406f00d965fa7be46d789512ba3267db87ee27957e1f929df4dcd538f8db9f3a3da239588
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'applitools/selenium/stitch_modes'
|
2
|
-
require 'applitools/selenium/stitch_modes'
|
3
2
|
require 'applitools/selenium/browsers_info'
|
4
3
|
|
5
4
|
module Applitools
|
6
5
|
module Selenium
|
7
6
|
class Configuration < Applitools::EyesBaseConfiguration
|
7
|
+
|
8
8
|
DEFAULT_CONFIG = proc do
|
9
9
|
{
|
10
10
|
force_full_page_screenshot: false,
|
@@ -12,7 +12,8 @@ module Applitools
|
|
12
12
|
stitch_mode: Applitools::Selenium::StitchModes::CSS,
|
13
13
|
hide_scrollbars: false,
|
14
14
|
hide_caret: false,
|
15
|
-
browsers_info: Applitools::Selenium::BrowsersInfo.new
|
15
|
+
browsers_info: Applitools::Selenium::BrowsersInfo.new,
|
16
|
+
accessibility_validation: Applitools::AccessibilityLevel::NONE
|
16
17
|
}
|
17
18
|
end
|
18
19
|
class << self
|
@@ -30,6 +31,15 @@ module Applitools
|
|
30
31
|
|
31
32
|
object_field :browsers_info, Applitools::Selenium::BrowsersInfo
|
32
33
|
int_field :concurrent_sessions
|
34
|
+
enum_field :accessibility_validation, Applitools::AccessibilityLevel.enum_values
|
35
|
+
|
36
|
+
def match_level_keys
|
37
|
+
super << :accessibility_validation
|
38
|
+
end
|
39
|
+
|
40
|
+
def default_match_settings
|
41
|
+
super.merge(accessibility_validation: accessibility_validation)
|
42
|
+
end
|
33
43
|
|
34
44
|
def add_browser(*args)
|
35
45
|
case args.size
|
@@ -38,7 +38,7 @@ module Applitools::Selenium
|
|
38
38
|
#
|
39
39
|
# @param [Applitools::Location] value The location.
|
40
40
|
def restore_state(value)
|
41
|
-
transforms = value.values.compact.select { |el| !el.empty? }
|
41
|
+
transforms = value.values.compact.map(&:to_s).select { |el| !el.empty? }
|
42
42
|
Applitools::Utils::EyesSeleniumUtils.set_transforms(executor, value)
|
43
43
|
if transforms.empty?
|
44
44
|
self.last_state_position = Applitools::Location::TOP_LEFT
|
@@ -178,7 +178,7 @@ module Applitools::Selenium
|
|
178
178
|
|
179
179
|
self.device_pixel_ratio = UNKNOWN_DEVICE_PIXEL_RATIO
|
180
180
|
self.position_provider = self.class.position_provider(
|
181
|
-
|
181
|
+
stitch_mode, driver, disable_horizontal_scrolling, disable_vertical_scrolling, explicit_entire_size
|
182
182
|
)
|
183
183
|
|
184
184
|
self.eyes_screenshot_factory = lambda do |image|
|
@@ -208,25 +208,25 @@ module Applitools::Selenium
|
|
208
208
|
# @option value [Symbol] :css use Css to perform stitching.
|
209
209
|
# @option value [Symbol] :scroll Scroll to perform stitching.
|
210
210
|
# @return [Symbol] The type of stitching.
|
211
|
-
def stitch_mode=(value)
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
end
|
211
|
+
# def stitch_mode=(value)
|
212
|
+
# @stitch_mode = if value.to_s.upcase == Applitools::STITCH_MODE[:css].to_s
|
213
|
+
# Applitools::STITCH_MODE[:css]
|
214
|
+
# else
|
215
|
+
# Applitools::STITCH_MODE[:scroll]
|
216
|
+
# end
|
217
|
+
# unless driver.nil?
|
218
|
+
# self.position_provider = self.class.position_provider(
|
219
|
+
# stitch_mode, driver, disable_horizontal_scrolling, disable_vertical_scrolling, explicit_entire_size
|
220
|
+
# )
|
221
|
+
# end
|
222
|
+
# if stitch_mode == Applitools::STITCH_MODE[:css]
|
223
|
+
# @css_transition_original_hide_scrollbars = hide_scrollbars
|
224
|
+
# self.hide_scrollbars = true
|
225
|
+
# else
|
226
|
+
# self.hide_scrollbars = @css_transition_original_hide_scrollbars || false
|
227
|
+
# end
|
228
|
+
# value
|
229
|
+
# end
|
230
230
|
|
231
231
|
# Takes a snapshot of the application under test and matches it with the expected output.
|
232
232
|
#
|
@@ -860,10 +860,10 @@ module Applitools::Selenium
|
|
860
860
|
max_height = explicit_entire_size.height
|
861
861
|
end
|
862
862
|
case stitch_mode
|
863
|
-
when
|
863
|
+
when Applitools::Selenium::StitchModes::SCROLL
|
864
864
|
Applitools::Selenium::ScrollPositionProvider.new(driver, disable_horizontal, disable_vertical,
|
865
865
|
max_width, max_height)
|
866
|
-
when
|
866
|
+
when Applitools::Selenium::StitchModes::CSS
|
867
867
|
Applitools::Selenium::CssTranslatePositionProvider.new(driver, disable_horizontal, disable_vertical,
|
868
868
|
max_width, max_height)
|
869
869
|
end
|
@@ -21,7 +21,7 @@ module Applitools
|
|
21
21
|
|
22
22
|
attr_accessor :element, :frames, :region_to_check, :coordinate_type, :options, :ignored_regions,
|
23
23
|
:floating_regions, :frame_or_element, :regions, :match_level, :layout_regions, :content_regions,
|
24
|
-
:strict_regions
|
24
|
+
:strict_regions, :accessibility_regions
|
25
25
|
|
26
26
|
private :frame_or_element, :frame_or_element=
|
27
27
|
|
@@ -221,11 +221,20 @@ module Applitools
|
|
221
221
|
replace_element(original_region, new_region, floating_regions)
|
222
222
|
when :ignore
|
223
223
|
replace_element(original_region, new_region, ignored_regions)
|
224
|
+
when :accessibility_regions
|
225
|
+
replace_element(original_region, new_region, accessibility_regions)
|
224
226
|
end
|
225
227
|
end
|
226
228
|
|
227
229
|
def replace_element(original, new, array)
|
228
|
-
|
230
|
+
case new
|
231
|
+
when Array
|
232
|
+
index = array.index(original)
|
233
|
+
array.delete_at(index)
|
234
|
+
array.insert(index, *new)
|
235
|
+
when Applitools::Selenium::VGRegion
|
236
|
+
array[array.index(original)] = new
|
237
|
+
end
|
229
238
|
end
|
230
239
|
|
231
240
|
def match_level(*args)
|
@@ -306,6 +315,55 @@ module Applitools
|
|
306
315
|
dup.region(region)
|
307
316
|
end
|
308
317
|
|
318
|
+
def accessibility(*args)
|
319
|
+
options = Applitools::Utils.extract_options! args
|
320
|
+
unless options[:type]
|
321
|
+
raise Applitools::EyesError,
|
322
|
+
'You should call Target.accessibility(region, region_type: type). The region_type option is required'
|
323
|
+
end
|
324
|
+
unless Applitools::AccessibilityRegionType.enum_values.include?(options[:type])
|
325
|
+
raise Applitools::EyesIllegalArgument,
|
326
|
+
"The region type should be one of [#{Applitools::AccessibilityRegionType.enum_values.join(', ')}]"
|
327
|
+
end
|
328
|
+
handle_frames
|
329
|
+
padding_proc = proc do |region|
|
330
|
+
Applitools::AccessibilityRegion.new(
|
331
|
+
region, options[:type]
|
332
|
+
)
|
333
|
+
end
|
334
|
+
|
335
|
+
accessibility_regions << case args.first
|
336
|
+
when ::Selenium::WebDriver::Element
|
337
|
+
proc do |driver, return_element = false|
|
338
|
+
element = applitools_element_from_selenium_element(driver, args.first)
|
339
|
+
next element, padding_proc if return_element
|
340
|
+
padding_proc.call(element)
|
341
|
+
end
|
342
|
+
when Applitools::Selenium::Element
|
343
|
+
proc do |_driver, return_element = false|
|
344
|
+
next args.first, padding_proc if return_element
|
345
|
+
padding_proc.call(args.first)
|
346
|
+
end
|
347
|
+
when Applitools::Region
|
348
|
+
Applitools::AccessibilityRegion.new(
|
349
|
+
args.first, options[:type]
|
350
|
+
)
|
351
|
+
when String
|
352
|
+
proc do |driver, return_element = false|
|
353
|
+
element = driver.find_element(name_or_id: args.first)
|
354
|
+
next element, padding_proc if return_element
|
355
|
+
padding_proc.call(element)
|
356
|
+
end
|
357
|
+
else
|
358
|
+
proc do |driver, return_element = false|
|
359
|
+
elements = driver.find_elements(*args)
|
360
|
+
next elements, padding_proc if return_element
|
361
|
+
elements.map { |e| padding_proc.call(e) }
|
362
|
+
end
|
363
|
+
end
|
364
|
+
self
|
365
|
+
end
|
366
|
+
|
309
367
|
private
|
310
368
|
|
311
369
|
def reset_for_fullscreen
|
@@ -316,11 +374,16 @@ module Applitools
|
|
316
374
|
reset_content_regions
|
317
375
|
reset_layout_regions
|
318
376
|
reset_strict_regions
|
377
|
+
reset_accessibility_regions
|
319
378
|
options[:stitch_content] = false
|
320
379
|
options[:timeout] = nil
|
321
380
|
options[:trim] = false
|
322
381
|
end
|
323
382
|
|
383
|
+
def reset_accessibility_regions
|
384
|
+
self.accessibility_regions = []
|
385
|
+
end
|
386
|
+
|
324
387
|
def reset_ignore
|
325
388
|
self.ignored_regions = []
|
326
389
|
end
|
@@ -94,12 +94,12 @@ module Applitools
|
|
94
94
|
render_status['selectorRegions']
|
95
95
|
end
|
96
96
|
|
97
|
-
def match_level_keys
|
98
|
-
|
99
|
-
end
|
97
|
+
# def match_level_keys
|
98
|
+
# %w(match_level exact scale remainder ).map(&:to_sym)
|
99
|
+
# end
|
100
100
|
|
101
101
|
def update_default_settings(match_data)
|
102
|
-
match_level_keys.each do |k|
|
102
|
+
config.match_level_keys.each do |k|
|
103
103
|
match_data.send("#{k}=", default_match_settings[k])
|
104
104
|
end
|
105
105
|
end
|
@@ -108,14 +108,14 @@ module Applitools
|
|
108
108
|
"useragent: #{render_status['userAgent']}"
|
109
109
|
end
|
110
110
|
|
111
|
-
def default_match_settings
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
end
|
111
|
+
# def default_match_settings
|
112
|
+
# {
|
113
|
+
# match_level: match_level,
|
114
|
+
# exact: exact,
|
115
|
+
# scale: server_scale,
|
116
|
+
# remainder: server_remainder
|
117
|
+
# }
|
118
|
+
# end
|
119
119
|
|
120
120
|
def set_viewport_size(*_args); end
|
121
121
|
|
@@ -53,6 +53,11 @@ module Applitools
|
|
53
53
|
@need_convert_strict_regions_coordinates = true unless @strict_regions.empty?
|
54
54
|
end
|
55
55
|
|
56
|
+
if target.respond_to? :accessibility_regions
|
57
|
+
@accessibility_regions = obtain_regions_coordinates(target.accessibility_regions, driver)
|
58
|
+
@need_convert_accessibility_regions_coordinates = true unless @accessibility_regions.empty?
|
59
|
+
end
|
60
|
+
|
56
61
|
# # floating regions
|
57
62
|
return unless target.respond_to? :floating_regions
|
58
63
|
target.floating_regions.each do |r|
|
@@ -97,7 +102,9 @@ module Applitools
|
|
97
102
|
region = r.region
|
98
103
|
region = selector_regions[target.regions[region]]
|
99
104
|
raise RegionCoordinatesError.new(r, region['error']) if region['error']
|
100
|
-
|
105
|
+
retrieved_region = Applitools::Region.new(region['x'], region['y'], region['width'], region['height'])
|
106
|
+
result_region = r.padding_proc.call(retrieved_region) if r.padding_proc.is_a? Proc
|
107
|
+
result << result_region
|
101
108
|
end
|
102
109
|
end
|
103
110
|
result
|
@@ -132,6 +139,12 @@ module Applitools
|
|
132
139
|
self.content_regions = @content_regions
|
133
140
|
@need_convert_content_regions_coordinates = false
|
134
141
|
end
|
142
|
+
|
143
|
+
def convert_accessibility_regions_coordinates
|
144
|
+
return unless @need_convert_accessibility_regions_coordinates
|
145
|
+
self.accessibility_regions = @accessibility_regions
|
146
|
+
@need_convert_accessibility_regions_coordinates = false
|
147
|
+
end
|
135
148
|
end
|
136
149
|
end
|
137
150
|
end
|
@@ -48,6 +48,7 @@ module Applitools
|
|
48
48
|
|
49
49
|
config.app_name = options[:app_name] if config.app_name.nil? || config.app_name && config.app_name.empty?
|
50
50
|
config.test_name = options[:test_name] if config.test_name.nil? || config.test_name && config.test_name.empty?
|
51
|
+
config.viewport_size = Applitools::RectangleSize.from_any_argument(options[:viewport_size]) if config.viewport_size.nil? || config.viewport_size && config.viewport_size.empty?
|
51
52
|
|
52
53
|
self.driver = options.delete(:driver)
|
53
54
|
self.current_url = driver.current_url
|
@@ -169,6 +170,16 @@ module Applitools
|
|
169
170
|
target.content_regions.each do |r|
|
170
171
|
selenium_regions[element_or_region(r, target, :content_regions)] = :content
|
171
172
|
end
|
173
|
+
target.accessibility_regions.each do |r|
|
174
|
+
case (r = element_or_region(r, target, :accessibility_regions))
|
175
|
+
when Array
|
176
|
+
r.each do |rr|
|
177
|
+
selenium_regions[rr] = :accessibility
|
178
|
+
end
|
179
|
+
else
|
180
|
+
selenium_regions[r] = :accessibility
|
181
|
+
end
|
182
|
+
end
|
172
183
|
selenium_regions[region_to_check] = :target if size_mod == 'selector'
|
173
184
|
|
174
185
|
selenium_regions
|
@@ -194,7 +205,13 @@ module Applitools
|
|
194
205
|
def element_or_region(target_element, target, options_key)
|
195
206
|
if target_element.respond_to?(:call)
|
196
207
|
region, padding_proc = target_element.call(driver, true)
|
197
|
-
|
208
|
+
case region
|
209
|
+
when Array
|
210
|
+
regions_to_replace = region.map { |r| Applitools::Selenium::VGRegion.new(r, padding_proc) }
|
211
|
+
target.replace_region(target_element, regions_to_replace, options_key)
|
212
|
+
else
|
213
|
+
target.replace_region(target_element, Applitools::Selenium::VGRegion.new(region, padding_proc), options_key)
|
214
|
+
end
|
198
215
|
region
|
199
216
|
else
|
200
217
|
target_element
|
data/lib/applitools/version.rb
CHANGED
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.15.
|
4
|
+
version: 3.15.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Applitools Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-07 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.15.
|
19
|
+
version: 3.15.36
|
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.15.
|
26
|
+
version: 3.15.36
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: selenium-webdriver
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|