eyes_selenium 3.18.4 → 4.6.3
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 +5 -5
- data/lib/applitools/selenium/browser_types.rb +12 -10
- data/lib/applitools/selenium/browsers_info.rb +8 -0
- data/lib/applitools/selenium/concerns/selenium_eyes.rb +2 -6
- data/lib/applitools/selenium/configuration.rb +11 -2
- data/lib/applitools/selenium/devices.rb +133 -24
- data/lib/applitools/selenium/driver.rb +21 -1
- data/lib/applitools/selenium/eyes.rb +2 -2
- data/lib/applitools/selenium/full_page_capture_algorithm.rb +1 -1
- data/lib/applitools/selenium/scripts/templates.rb +11 -11
- data/lib/applitools/selenium/selenium_eyes.rb +54 -49
- data/lib/applitools/selenium/target.rb +174 -134
- 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/chrome_emulation_info.rb +4 -0
- data/lib/applitools/selenium/visual_grid/desktop_browser_info.rb +6 -0
- data/lib/applitools/selenium/visual_grid/dom_snapshot_script.rb +2 -1
- data/lib/applitools/selenium/visual_grid/ios_device_info.rb +12 -0
- data/lib/applitools/selenium/visual_grid/ios_device_name.rb +17 -1
- data/lib/applitools/selenium/visual_grid/thread_pool.rb +2 -1
- data/lib/applitools/selenium/visual_grid/vg_resource.rb +7 -6
- data/lib/applitools/selenium/visual_grid/visual_grid_eyes.rb +108 -56
- data/lib/applitools/selenium/visual_grid/visual_grid_runner.rb +4 -0
- data/lib/applitools/version.rb +4 -1
- data/lib/eyes_selenium.rb +17 -0
- metadata +9 -23
- data/lib/applitools/selenium/scripts/process_page_and_poll.rb +0 -17
@@ -49,49 +49,8 @@ module Applitools
|
|
49
49
|
if args.empty?
|
50
50
|
reset_ignore
|
51
51
|
else
|
52
|
-
|
53
|
-
|
54
|
-
else
|
55
|
-
Applitools::PaddingBounds::PIXEL_PADDING
|
56
|
-
end
|
57
|
-
ignored_regions << case args.first
|
58
|
-
when Applitools::Region
|
59
|
-
proc { args.first.padding(requested_padding) }
|
60
|
-
when ::Selenium::WebDriver::Element
|
61
|
-
proc do |driver, return_element = false|
|
62
|
-
region = applitools_element_from_selenium_element(driver, args.first)
|
63
|
-
padding_proc = proc do |reg|
|
64
|
-
Applitools::Region.from_location_size(
|
65
|
-
reg.location, reg.size
|
66
|
-
).padding(requested_padding)
|
67
|
-
end
|
68
|
-
next region, padding_proc if return_element
|
69
|
-
padding_proc.call(region)
|
70
|
-
end
|
71
|
-
when Applitools::Selenium::Element
|
72
|
-
proc do |_driver, return_element = false|
|
73
|
-
region = args.first
|
74
|
-
padding_proc = proc do |reg|
|
75
|
-
Applitools::Region.from_location_size(
|
76
|
-
reg.location, reg.size
|
77
|
-
).padding(requested_padding)
|
78
|
-
end
|
79
|
-
next region, padding_proc if return_element
|
80
|
-
padding_proc.call(region)
|
81
|
-
end
|
82
|
-
else
|
83
|
-
proc do |driver, return_element = false|
|
84
|
-
region = driver.find_element(*args)
|
85
|
-
padding_proc = proc do |reg|
|
86
|
-
Applitools::Region.from_location_size(
|
87
|
-
reg.location, reg.size
|
88
|
-
).padding(requested_padding)
|
89
|
-
end
|
90
|
-
next region, padding_proc if return_element
|
91
|
-
padding_proc.call(region)
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
52
|
+
region = region_from_args(args)
|
53
|
+
ignored_regions << region if region
|
95
54
|
end
|
96
55
|
self
|
97
56
|
end
|
@@ -120,71 +79,36 @@ module Applitools
|
|
120
79
|
# @!parse def floating(region_or_element, bounds, left,top, right, bottom, padding); end;
|
121
80
|
|
122
81
|
def floating(*args)
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
value =
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
args_dup = args.dup
|
136
|
-
region = applitools_element_from_selenium_element(driver, args_dup.shift)
|
137
|
-
padding_proc = proc do |reg|
|
138
|
-
Applitools::FloatingRegion.any(reg, *args_dup).padding(requested_padding)
|
139
|
-
end
|
140
|
-
next region, padding_proc if return_element
|
141
|
-
padding_proc.call(region)
|
142
|
-
end
|
143
|
-
when ::Applitools::Selenium::Element
|
144
|
-
proc do |_driver, return_element = false|
|
145
|
-
args_dup = args.dup
|
146
|
-
region = args_dup.shift
|
147
|
-
padding_proc = proc do |reg|
|
148
|
-
Applitools::FloatingRegion.any(reg, *args_dup).padding(requested_padding)
|
149
|
-
end
|
150
|
-
next region, padding_proc if return_element
|
151
|
-
padding_proc.call(region)
|
152
|
-
end
|
153
|
-
else
|
154
|
-
proc do |driver, return_element = false|
|
155
|
-
args_dup = args.dup
|
156
|
-
region = driver.find_element(args_dup.shift, args_dup.shift)
|
157
|
-
padding_proc = proc do |reg|
|
158
|
-
Applitools::FloatingRegion.any(
|
159
|
-
reg, *args_dup
|
160
|
-
).padding(requested_padding)
|
161
|
-
end
|
162
|
-
next region, padding_proc if return_element
|
163
|
-
padding_proc.call(region)
|
164
|
-
end
|
165
|
-
end
|
166
|
-
floating_regions << value
|
82
|
+
options = Applitools::Utils.extract_options!(args)
|
83
|
+
padding = options && options[:padding]
|
84
|
+
requested_padding = get_requested_padding(padding, args)
|
85
|
+
bounds = get_bounds(args)
|
86
|
+
value = convert_to_universal(args)
|
87
|
+
value = { type: args[0], selector: args[1] } if value.nil?
|
88
|
+
value = value[:selector] if value.is_a?(Hash) && (value[:type].to_s === 'id')
|
89
|
+
region = { region: value }
|
90
|
+
region.merge!(bounds) if bounds != {}
|
91
|
+
region.merge!(padding: requested_padding) if requested_padding != {}
|
92
|
+
region.merge!(regionId: options[:region_id]) if options[:region_id]
|
93
|
+
floating_regions << region
|
167
94
|
self
|
168
95
|
end
|
169
96
|
|
170
97
|
def layout(*args)
|
171
|
-
|
172
|
-
region
|
173
|
-
layout_regions << region
|
98
|
+
region = region_from_args(args)
|
99
|
+
layout_regions << region if region
|
174
100
|
self
|
175
101
|
end
|
176
102
|
|
177
103
|
def content(*args)
|
178
|
-
|
179
|
-
region
|
180
|
-
content_regions << region
|
104
|
+
region = region_from_args(args)
|
105
|
+
content_regions << region if region
|
181
106
|
self
|
182
107
|
end
|
183
108
|
|
184
109
|
def strict(*args)
|
185
|
-
|
186
|
-
region
|
187
|
-
strict_regions << region
|
110
|
+
region = region_from_args(args)
|
111
|
+
strict_regions << region if region
|
188
112
|
self
|
189
113
|
end
|
190
114
|
|
@@ -262,8 +186,9 @@ module Applitools
|
|
262
186
|
else
|
263
187
|
proc { |d| d.find_element(*args) }
|
264
188
|
end
|
265
|
-
frames <<
|
266
|
-
|
189
|
+
frames << element
|
190
|
+
# frames << frame_or_element if frame_or_element
|
191
|
+
# self.frame_or_element = element
|
267
192
|
reset_for_fullscreen
|
268
193
|
self
|
269
194
|
end
|
@@ -280,23 +205,10 @@ module Applitools
|
|
280
205
|
# @!parse def region(element, how, what); end;
|
281
206
|
|
282
207
|
def region(*args)
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
applitools_element_from_selenium_element(driver, args.first)
|
288
|
-
end
|
289
|
-
when Applitools::Selenium::Element, Applitools::Region
|
290
|
-
proc { args.first }
|
291
|
-
when String
|
292
|
-
proc do |driver|
|
293
|
-
driver.find_element(name_or_id: args.first)
|
294
|
-
end
|
295
|
-
else
|
296
|
-
proc do |driver|
|
297
|
-
driver.find_element(*args)
|
298
|
-
end
|
299
|
-
end
|
208
|
+
value = convert_to_universal(args)
|
209
|
+
value = { type: args[0], selector: args[1] } if value.nil?
|
210
|
+
value = value[:selector] if value.is_a?(Hash) && (value[:type].to_s === 'id')
|
211
|
+
self.region_to_check = value
|
300
212
|
self.coordinate_type = Applitools::EyesScreenshot::COORDINATE_TYPES[:context_relative]
|
301
213
|
options[:timeout] = nil
|
302
214
|
reset_ignore
|
@@ -315,11 +227,16 @@ module Applitools
|
|
315
227
|
end
|
316
228
|
|
317
229
|
def before_render_screenshot_hook(hook)
|
318
|
-
|
230
|
+
if hook.is_a?(Hash) && hook[:beforeCaptureScreenshot]
|
231
|
+
options[:script_hooks] = hook
|
232
|
+
else
|
233
|
+
options[:script_hooks][:beforeCaptureScreenshot] = hook
|
234
|
+
end
|
319
235
|
self
|
320
236
|
end
|
321
237
|
|
322
238
|
alias script_hook before_render_screenshot_hook
|
239
|
+
alias hooks before_render_screenshot_hook
|
323
240
|
|
324
241
|
def finalize
|
325
242
|
return self unless frame_or_element
|
@@ -339,11 +256,7 @@ module Applitools
|
|
339
256
|
"The region type should be one of [#{Applitools::AccessibilityRegionType.enum_values.join(', ')}]"
|
340
257
|
end
|
341
258
|
handle_frames
|
342
|
-
padding_proc = proc
|
343
|
-
Applitools::AccessibilityRegion.new(
|
344
|
-
region, options[:type]
|
345
|
-
)
|
346
|
-
end
|
259
|
+
padding_proc = proc { |region| Applitools::AccessibilityRegion.new(region, options[:type]) }
|
347
260
|
|
348
261
|
accessibility_regions << case args.first
|
349
262
|
when ::Selenium::WebDriver::Element
|
@@ -367,30 +280,34 @@ module Applitools
|
|
367
280
|
next element, padding_proc if return_element
|
368
281
|
padding_proc.call(element)
|
369
282
|
end
|
283
|
+
when :css
|
284
|
+
# (:css, '.ignore', type: 'LargeText')
|
285
|
+
{ region: args[1], type: options[:type] }
|
370
286
|
else
|
371
287
|
proc do |driver, return_element = false|
|
372
288
|
elements = driver.find_elements(*args)
|
373
289
|
next elements, padding_proc if return_element
|
374
290
|
elements.map { |e| padding_proc.call(e) }
|
375
291
|
end
|
292
|
+
|
376
293
|
end
|
377
294
|
self
|
378
295
|
end
|
379
296
|
|
380
297
|
def default_full_page_for_vg
|
381
|
-
if options[:stitch_content].nil?
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
end
|
298
|
+
# if options[:stitch_content].nil?
|
299
|
+
# case region_to_check
|
300
|
+
# when nil
|
301
|
+
# fully(true)
|
302
|
+
# when Proc
|
303
|
+
# begin
|
304
|
+
# r = region_to_check.call
|
305
|
+
# # fully(true) if r == Applitools::Region::EMPTY
|
306
|
+
# rescue StandardError
|
307
|
+
# fully(false)
|
308
|
+
# end
|
309
|
+
# end
|
310
|
+
# end
|
394
311
|
nil
|
395
312
|
end
|
396
313
|
|
@@ -398,6 +315,41 @@ module Applitools
|
|
398
315
|
self.convert_coordinates_block = block
|
399
316
|
end
|
400
317
|
|
318
|
+
def scroll_root_element(by, what = nil)
|
319
|
+
options[:scroll_root_element] = if is_element?(by)
|
320
|
+
ref = by.ref
|
321
|
+
ref = by.ref[1] if ref.is_a?(Array) && ref[0] === :element
|
322
|
+
{ elementId: ref }
|
323
|
+
elsif what
|
324
|
+
{ type: by.to_s, selector: what }
|
325
|
+
else
|
326
|
+
by
|
327
|
+
end
|
328
|
+
self
|
329
|
+
end
|
330
|
+
|
331
|
+
def layout_breakpoints(value = true)
|
332
|
+
options[:layout_breakpoints] = value.is_a?(Array) ? value : value
|
333
|
+
self
|
334
|
+
end
|
335
|
+
|
336
|
+
def wait_before_capture(value)
|
337
|
+
Applitools::ArgumentGuard.not_nil(value, 'wait_before_capture')
|
338
|
+
options[:wait_before_capture] = value
|
339
|
+
self
|
340
|
+
end
|
341
|
+
|
342
|
+
def page_id(value)
|
343
|
+
Applitools::ArgumentGuard.not_nil(value, 'page_id')
|
344
|
+
options[:page_id] = value
|
345
|
+
self
|
346
|
+
end
|
347
|
+
|
348
|
+
def lazy_load(*args) # scroll_length, waiting_time, max_amount_to_scroll
|
349
|
+
options[:lazy_load] = args.is_a?(Hash) ? args : true
|
350
|
+
self
|
351
|
+
end
|
352
|
+
|
401
353
|
private
|
402
354
|
|
403
355
|
def reset_for_fullscreen
|
@@ -448,6 +400,94 @@ module Applitools
|
|
448
400
|
xpath = driver.execute_script(Applitools::Selenium::Scripts::GET_ELEMENT_XPATH_JS, selenium_element)
|
449
401
|
driver.find_element(:xpath, xpath)
|
450
402
|
end
|
403
|
+
|
404
|
+
def get_requested_padding(padding, args)
|
405
|
+
return padding.to_hash if padding && padding.is_a?(Applitools::PaddingBounds)
|
406
|
+
return padding if padding && (padding.is_a?(Hash) || padding.is_a?(Numeric))
|
407
|
+
if args.last.is_a? Applitools::PaddingBounds
|
408
|
+
args.pop
|
409
|
+
# elsif args.last.is_a?(Applitools::FloatingBounds)
|
410
|
+
# args.pop.to_hash
|
411
|
+
else
|
412
|
+
{}
|
413
|
+
end
|
414
|
+
end
|
415
|
+
|
416
|
+
def get_bounds(args)
|
417
|
+
return args.pop.to_hash if args.last.is_a?(Applitools::FloatingBounds)
|
418
|
+
last4 = args.last(4)
|
419
|
+
if last4.size === 4 && last4.all? { |e| e.is_a?(Numeric) }
|
420
|
+
FloatingBounds.new(*last4).to_hash
|
421
|
+
else
|
422
|
+
{}
|
423
|
+
end
|
424
|
+
end
|
425
|
+
|
426
|
+
def region_from_args(args)
|
427
|
+
options = Applitools::Utils.extract_options!(args)
|
428
|
+
padding = options && options[:padding]
|
429
|
+
requested_padding = get_requested_padding(padding, args)
|
430
|
+
value = convert_to_universal(args)
|
431
|
+
value = { type: args[0], selector: args[1] } if value.nil?
|
432
|
+
value = value[:selector] if value.is_a?(Hash) && (value[:type].to_s === 'id')
|
433
|
+
return nil if value === {selector: nil, type: nil}
|
434
|
+
region = { region: value }
|
435
|
+
region.merge!(padding: requested_padding) if requested_padding != {}
|
436
|
+
region.merge!(regionId: options[:region_id]) if options[:region_id]
|
437
|
+
region
|
438
|
+
end
|
439
|
+
|
440
|
+
|
441
|
+
def is_element?(el)
|
442
|
+
el.is_a?(::Selenium::WebDriver::Element) || (el.is_a?(Applitools::Selenium::Element) && el.respond_to?(:ref))
|
443
|
+
end
|
444
|
+
|
445
|
+
def is_region?(region)
|
446
|
+
region.is_a?(Applitools::FloatingRegion) || region.is_a?(Applitools::Region) # || region.is_a?(Applitools::Selenium::Element)
|
447
|
+
end
|
448
|
+
|
449
|
+
def is_finder?(finders)
|
450
|
+
return false unless finders.is_a?(Array)
|
451
|
+
return false unless finders[1]
|
452
|
+
return true if [:uiautomator, :predicate, :accessibility_id].include?(finders[0].to_sym)
|
453
|
+
Applitools::Selenium::Driver::FINDERS.has_key?(finders[0].to_sym)
|
454
|
+
end
|
455
|
+
|
456
|
+
def convert_to_universal(args)
|
457
|
+
if is_element?(args.first)
|
458
|
+
ref = args.first.ref
|
459
|
+
ref = args.first.ref[1] if ref.is_a?(Array) && ref[0] === :element
|
460
|
+
return { elementId: ref }
|
461
|
+
end
|
462
|
+
return args.first.to_hash if is_region?(args.first)
|
463
|
+
if is_finder?(args)
|
464
|
+
if Applitools::Selenium::Driver::FINDERS.has_key?(args[0])
|
465
|
+
selector = args[1]
|
466
|
+
selector = "##{args[1]}" if args[0] === :id && !args[1].start_with?('#') && instance_of?(Applitools::Selenium::Target)
|
467
|
+
return {type: Applitools::Selenium::Driver::FINDERS[args[0]], selector: selector}
|
468
|
+
end
|
469
|
+
case args[0]
|
470
|
+
when :uiautomator # ANDROID_UI_AUTOMATOR: '-android uiautomator'
|
471
|
+
return {type: '-android uiautomator', selector: args[1]}
|
472
|
+
when :predicate # IOS_PREDICATE: '-ios predicate string',
|
473
|
+
return {type: '-ios predicate string', selector: args[1]}
|
474
|
+
when :accessibility_id
|
475
|
+
return {type: 'accessibility id', selector: args[1]}
|
476
|
+
end
|
477
|
+
end
|
478
|
+
if args.first.is_a?(String)
|
479
|
+
return proc { |driver| driver.find_element(name_or_id: args.first) }
|
480
|
+
end
|
481
|
+
if args.first.is_a?(Hash) && args.first.has_key?('selector')
|
482
|
+
if args.first.has_key?('shadow')
|
483
|
+
return {selector: args.first['selector'], shadow: args.first['shadow']}
|
484
|
+
else
|
485
|
+
return {selector: args.first['selector']}
|
486
|
+
end
|
487
|
+
end
|
488
|
+
nil
|
489
|
+
end
|
490
|
+
|
451
491
|
end
|
452
492
|
end
|
453
493
|
end
|
@@ -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
|
@@ -36,6 +36,10 @@ module Applitools
|
|
36
36
|
ios_device_info.device_name
|
37
37
|
end
|
38
38
|
|
39
|
+
def to_hash
|
40
|
+
{iosDeviceInfo: ios_device_info.to_hash}
|
41
|
+
end
|
42
|
+
|
39
43
|
private
|
40
44
|
|
41
45
|
class EmulationInfo < EmulationBaseInfo
|
@@ -49,6 +53,14 @@ module Applitools
|
|
49
53
|
version: 'latest'
|
50
54
|
}
|
51
55
|
end
|
56
|
+
|
57
|
+
def to_hash
|
58
|
+
{
|
59
|
+
deviceName: device_name,
|
60
|
+
screenOrientation: screen_orientation,
|
61
|
+
iosVersion: 'latest'
|
62
|
+
}
|
63
|
+
end
|
52
64
|
end
|
53
65
|
end
|
54
66
|
end
|
@@ -1,5 +1,10 @@
|
|
1
1
|
module IosDeviceName
|
2
2
|
extend self
|
3
|
+
IPhone_14 = 'iPhone 14'
|
4
|
+
IPhone_14_Pro_Max = 'iPhone 14 Pro Max'
|
5
|
+
IPhone_13_Pro_Max = 'iPhone 13 Pro Max'
|
6
|
+
IPhone_13_Pro = 'iPhone 13 Pro'
|
7
|
+
IPhone_13 = 'iPhone 13'
|
3
8
|
IPhone_12_Pro_Max = 'iPhone 12 Pro Max'
|
4
9
|
IPhone_12_Pro = 'iPhone 12 Pro'
|
5
10
|
IPhone_12 = 'iPhone 12'
|
@@ -14,10 +19,18 @@ module IosDeviceName
|
|
14
19
|
IPhone_7 = 'iPhone 7'
|
15
20
|
IPad_Pro_3 = 'iPad Pro (12.9-inch) (3rd generation)'
|
16
21
|
IPad_7 = 'iPad (7th generation)'
|
22
|
+
IPad_9 = 'iPad (9th generation)'
|
17
23
|
IPad_Air_2 = 'iPad Air (2nd generation)'
|
24
|
+
IPhone_8_Plus = 'iPhone 8 Plus'
|
25
|
+
IPhone_SE = 'iPhone SE (1st generation)'
|
18
26
|
|
19
27
|
def enum_values
|
20
28
|
[
|
29
|
+
IPhone_14,
|
30
|
+
IPhone_14_Pro_Max,
|
31
|
+
IPhone_13_Pro_Max,
|
32
|
+
IPhone_13_Pro,
|
33
|
+
IPhone_13,
|
21
34
|
IPhone_12_Pro_Max,
|
22
35
|
IPhone_12_Pro,
|
23
36
|
IPhone_12,
|
@@ -32,7 +45,10 @@ module IosDeviceName
|
|
32
45
|
IPhone_7,
|
33
46
|
IPad_Pro_3,
|
34
47
|
IPad_7,
|
35
|
-
|
48
|
+
IPad_9,
|
49
|
+
IPad_Air_2,
|
50
|
+
IPhone_8_Plus,
|
51
|
+
IPhone_SE
|
36
52
|
]
|
37
53
|
end
|
38
54
|
end
|
@@ -58,7 +58,8 @@ module Applitools
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def init_or_renew_threads
|
61
|
-
|
61
|
+
one_concurrency = 1 # Thread's moved to universal server
|
62
|
+
(one_concurrency - @thread_group.list.count).times do
|
62
63
|
logger.debug 'starting new thread (task worker)'
|
63
64
|
next_thread
|
64
65
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'base64'
|
4
4
|
require 'digest'
|
5
|
-
require 'nokogiri'
|
5
|
+
# require 'nokogiri'
|
6
6
|
|
7
7
|
module Applitools
|
8
8
|
module Selenium
|
@@ -58,11 +58,12 @@ module Applitools
|
|
58
58
|
|
59
59
|
def lookup_for_svg_resources
|
60
60
|
return unless %r{^image/svg\+xml} =~ content_type && handle_discovered_resources_block
|
61
|
-
attrs =
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
61
|
+
attrs = []
|
62
|
+
# attrs = Nokogiri::XML(content)
|
63
|
+
# .xpath("//@*[namespace-uri(.) = 'http://www.w3.org/1999/xlink'] | //@href")
|
64
|
+
# .select { |a| a.name == 'href' }
|
65
|
+
# .map(&:value)
|
66
|
+
# .select { |a| /^(?!#).*/.match(a) }
|
66
67
|
handle_discovered_resources_block.call(attrs, url)
|
67
68
|
end
|
68
69
|
|