eyes_selenium 3.4.1 → 3.5.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f93b8793605ac58e0e53ea8e917b514c7edf3b64
|
4
|
+
data.tar.gz: 9c641c00d1f5c417c6c657f6f7b0c3bcfa9e7d02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9846f6b0578ad8aee3bfb76bfcc40cdd1107040b87f516e12ce62d68b60f0a551c419838dbffaaeb84ad3643366a3e966666efea6e1349a3f94b38505ab0a892
|
7
|
+
data.tar.gz: 37271c08ea7a37e15a45f6e0f9a8b242cd3f6f77e0e1056ebff55eaba57d46987500d3e9c9216b9fc49b3d6f1694598aa4fd8db17b2e621dc15bab92bcb93ac3
|
@@ -226,30 +226,29 @@ module Applitools::Selenium
|
|
226
226
|
|
227
227
|
self.eyes_screenshot_factory = lambda do |image|
|
228
228
|
Applitools::Selenium::EyesWebDriverScreenshot.new(
|
229
|
-
|
229
|
+
image, driver: driver, force_offset: position_provider.force_offset
|
230
230
|
)
|
231
231
|
end
|
232
232
|
|
233
233
|
check_in_frame target_frames: target.frames do
|
234
234
|
begin
|
235
235
|
eyes_element = target.region_to_check.call(driver)
|
236
|
-
|
237
236
|
region_visibility_strategy.move_to_region original_position_provider,
|
238
237
|
Applitools::Location.new(eyes_element.location.x.to_i, eyes_element.location.y.to_i)
|
239
238
|
|
240
239
|
check_window = false
|
241
|
-
if
|
242
|
-
#check_current_frame
|
240
|
+
if !target.frames.empty? && eyes_element.is_a?(Applitools::Region)
|
241
|
+
# check_current_frame
|
243
242
|
region_provider = region_provider_for_frame
|
244
243
|
|
245
244
|
elsif eyes_element.is_a? Applitools::Selenium::Element
|
246
|
-
#check_element
|
245
|
+
# check_element
|
247
246
|
region_provider = Applitools::Selenium::RegionProvider.new(
|
248
|
-
|
249
|
-
|
247
|
+
region_for_element(eyes_element),
|
248
|
+
target.coordinate_type
|
250
249
|
)
|
251
250
|
else
|
252
|
-
#check_window
|
251
|
+
# check_window
|
253
252
|
region_provider = Applitools::Selenium::RegionProvider.new(
|
254
253
|
region_for_element(eyes_element),
|
255
254
|
target.coordinate_type
|
@@ -268,23 +267,18 @@ module Applitools::Selenium
|
|
268
267
|
|
269
268
|
self.region_to_check = region_provider
|
270
269
|
|
271
|
-
region_provider =
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
end
|
276
|
-
|
277
|
-
define_singleton_method :coordinate_type do
|
278
|
-
nil
|
279
|
-
end
|
280
|
-
end
|
281
|
-
end
|
270
|
+
region_provider = Applitools::Selenium::RegionProvider.new(
|
271
|
+
Applitools::Region::EMPTY,
|
272
|
+
nil
|
273
|
+
)
|
282
274
|
end
|
283
275
|
|
284
276
|
check_window_base(
|
285
277
|
region_provider, name, false, target.options[:timeout] || USE_DEFAULT_MATCH_TIMEOUT,
|
286
|
-
ignore: target.ignored_regions.map {|i| i.call(driver)},
|
287
|
-
trim: target.options[:trim]
|
278
|
+
ignore: target.ignored_regions.map { |i| i.call(driver) },
|
279
|
+
trim: target.options[:trim],
|
280
|
+
match_level: default_match_settings[:match_level],
|
281
|
+
exact: default_match_settings[:exact]
|
288
282
|
)
|
289
283
|
ensure
|
290
284
|
eyes_element.overflow = original_overflow unless original_overflow.nil?
|
@@ -312,13 +306,11 @@ module Applitools::Selenium
|
|
312
306
|
|
313
307
|
yield if block_given?
|
314
308
|
|
315
|
-
|
316
309
|
logger.info 'Switching back into top level frame...'
|
317
|
-
driver.switch_to.default_content
|
318
|
-
unless original_frame_chain
|
319
|
-
|
320
|
-
|
321
|
-
end
|
310
|
+
driver.switch_to.default_content
|
311
|
+
return unless original_frame_chain
|
312
|
+
logger.info 'Switching back into original frame...'
|
313
|
+
driver.switch_to.frames frame_chain: original_frame_chain
|
322
314
|
end
|
323
315
|
|
324
316
|
def region_for_element(element)
|
@@ -333,23 +325,23 @@ module Applitools::Selenium
|
|
333
325
|
border_bottom_width = element.border_bottom_width
|
334
326
|
|
335
327
|
Applitools::Region.new(
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
328
|
+
p.x + border_left_width,
|
329
|
+
p.y + border_top_width,
|
330
|
+
d.width - border_left_width - border_right_width,
|
331
|
+
d.height - border_top_width - border_bottom_width
|
340
332
|
)
|
341
333
|
end
|
342
334
|
|
343
|
-
def region_provider_for_frame
|
335
|
+
def region_provider_for_frame
|
344
336
|
Object.new.tap do |provider|
|
345
337
|
current_frame_size = lambda do
|
346
338
|
frame_region = Applitools::Region.from_location_size(
|
347
|
-
|
339
|
+
Applitools::Location.new(0, 0), driver.frame_chain!.current_frame.size
|
348
340
|
)
|
349
341
|
begin
|
350
342
|
frame_region.intersect Applitools::Region.from_location_size(
|
351
|
-
|
352
|
-
|
343
|
+
Applitools::Location.new(0, 0),
|
344
|
+
Applitools::Utils::EyesSeleniumUtils.entire_page_size(driver)
|
353
345
|
)
|
354
346
|
frame_region
|
355
347
|
ensure
|
@@ -557,9 +549,11 @@ module Applitools::Selenium
|
|
557
549
|
'or :frame_chain option or :frames_path option'
|
558
550
|
end
|
559
551
|
|
560
|
-
|
561
|
-
|
562
|
-
|
552
|
+
needed_keys = (
|
553
|
+
options.keys & [:index, :name_or_id, :frame_element, :frame_chain, :frames_path, :target_frames]
|
554
|
+
)
|
555
|
+
|
556
|
+
if needed_keys.length == 1
|
563
557
|
frame_key = needed_keys.first
|
564
558
|
else
|
565
559
|
raise Applitools::EyesIllegalArgument.new 'You\'ve passed some extra keys!' /
|
@@ -183,12 +183,12 @@ module Applitools::Selenium
|
|
183
183
|
logger.info 'Switching to frame...'
|
184
184
|
logger.info frame_name_or_id
|
185
185
|
case frame_name_or_id
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
186
|
+
when String
|
187
|
+
frame(name_or_id: frame_name_or_id)
|
188
|
+
when Applitools::Selenium::Element
|
189
|
+
frame(frame_element: frame_name_or_id.reference)
|
190
|
+
else
|
191
|
+
Applitools::ArgumentGuard.raise_argument_error Applitools::EyesNoSuchFrame.new frame_name_or_id
|
192
192
|
end
|
193
193
|
|
194
194
|
logger.info 'Done!'
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Applitools::Selenium
|
2
2
|
class RegionProvider
|
3
|
-
|
3
|
+
# Do we need it under Selenium module?
|
4
4
|
attr_reader :region, :coordinate_type
|
5
5
|
def initialize(region, coordinate_type)
|
6
6
|
@region = region
|
7
7
|
@coordinate_type = coordinate_type
|
8
8
|
end
|
9
9
|
end
|
10
|
-
end
|
10
|
+
end
|
@@ -3,40 +3,40 @@ module Applitools
|
|
3
3
|
class Target
|
4
4
|
class << self
|
5
5
|
def window
|
6
|
-
|
6
|
+
new
|
7
7
|
end
|
8
8
|
|
9
9
|
def region(element)
|
10
|
-
|
10
|
+
new.region(element)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
attr_accessor
|
14
|
+
attr_accessor :element, :frames, :region_to_check, :coordinate_type, :options, :ignored_regions
|
15
15
|
|
16
|
-
def initialize
|
16
|
+
def initialize
|
17
17
|
self.frames = []
|
18
18
|
self.options = {}
|
19
19
|
reset_for_fullscreen
|
20
20
|
end
|
21
21
|
|
22
22
|
def ignore(*args)
|
23
|
-
if
|
24
|
-
if args.first.is_a? Applitools::Selenium::Element
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
23
|
+
if args.first
|
24
|
+
ignored_regions << if args.first.is_a? Applitools::Selenium::Element
|
25
|
+
proc do
|
26
|
+
args.first
|
27
|
+
end
|
28
|
+
else
|
29
|
+
proc do |driver|
|
30
|
+
driver.find_element(*args)
|
31
|
+
end
|
32
|
+
end
|
33
33
|
else
|
34
34
|
reset_ignore
|
35
35
|
end
|
36
36
|
self
|
37
37
|
end
|
38
38
|
|
39
|
-
def float(*
|
39
|
+
def float(*_)
|
40
40
|
self
|
41
41
|
end
|
42
42
|
|
@@ -57,15 +57,15 @@ module Applitools
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def region(*args)
|
60
|
-
if args.first.is_a? Applitools::Selenium::Element
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
60
|
+
self.region_to_check = if args.first.is_a? Applitools::Selenium::Element
|
61
|
+
proc do
|
62
|
+
args.first
|
63
|
+
end
|
64
|
+
else
|
65
|
+
proc do |driver|
|
66
|
+
driver.find_element(*args)
|
67
|
+
end
|
68
|
+
end
|
69
69
|
self.coordinate_type = Applitools::EyesScreenshot::COORDINATE_TYPES[:context_relative]
|
70
70
|
options[:timeout] = nil
|
71
71
|
reset_ignore
|
@@ -94,4 +94,3 @@ module Applitools
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
end
|
97
|
-
|
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.
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Applitools Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-27 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.
|
19
|
+
version: 3.5.0
|
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.
|
26
|
+
version: 3.5.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: selenium-webdriver
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|