eyes_selenium 1.34.0 → 1.35.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/eyes_selenium/eyes/match_window_task.rb +12 -1
- data/lib/eyes_selenium/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzEwYjZmOWVkMjcxNzQ3NTNkNGE0NDRmODQ1NTcwOGU1NDM4ZWViOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTA3Y2UwM2Q4OTc1MjQwMTMwNjlkZmE3MjUxNmMyZTg1OWM3ZDViNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzNjOWVhYmNhYzZhYmExYTczZjM2OTZjN2U3YmQyNzM5ZTMxYTgxOWI5NzMy
|
10
|
+
N2U1NjNhZDI4MjZkN2EyNmRjMjYzNGIwODIzNzQ3NmM3ZDM5NzQ3ZWM1MmY2
|
11
|
+
NTA5ZjAyNmMwMjFiYWQyMDI2ZGExZjBlYzVhYjJkNTk0NDlmNmI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDA0YjljYTNmNmE2MjY1MDRmYWFjODFhMDM0NDNjNThkZTcwYmE1NTg5ZTlm
|
14
|
+
OTE5ZmJjZGIwZGJlYTFmZWQwYmM4YmE5Y2VkYjliZWM5NzA3OWMxODc0Yjdk
|
15
|
+
YzlhZDJkZTdlMTdiMTZlMjJkZWFkYTZjMTc1NDE3ZjI5NmQzMzA=
|
@@ -55,6 +55,14 @@ class Applitools::MatchWindowTask
|
|
55
55
|
|
56
56
|
private
|
57
57
|
|
58
|
+
def get_clipped_region(region, image)
|
59
|
+
left, top = [region.left, 0].max, [region.top, 0].max
|
60
|
+
max_width = image.width - left
|
61
|
+
max_height = image.height - top
|
62
|
+
width, height = [region.width, max_width].min, [region.height, max_height].min
|
63
|
+
Applitools::Region.new(left, top, width, height)
|
64
|
+
end
|
65
|
+
|
58
66
|
def prep_match_data(region, tag, ignore_mismatch)
|
59
67
|
title = eyes.title
|
60
68
|
# 'encoded', as in 'png'.
|
@@ -62,7 +70,10 @@ class Applitools::MatchWindowTask
|
|
62
70
|
@current_screenshot = ChunkyPNG::Image.from_blob(current_screenshot_encoded)
|
63
71
|
# If a region was defined, we refer to the sub-image defined by the region.
|
64
72
|
unless region.empty?
|
65
|
-
|
73
|
+
# If the region is out of bounds, clip it
|
74
|
+
clipped_region = get_clipped_region(region, @current_screenshot)
|
75
|
+
raise Applitools::EyesError.new("Region is outside the viewport: #{region}") if clipped_region.empty?
|
76
|
+
@current_screenshot.crop!(clipped_region.left, clipped_region.top, clipped_region.width, clipped_region.height)
|
66
77
|
current_screenshot_encoded = @current_screenshot.to_blob.force_encoding('BINARY')
|
67
78
|
end
|
68
79
|
compressed_screenshot = Applitools::Utils::ImageDeltaCompressor.compress_by_raw_blocks(@current_screenshot,
|
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: 1.
|
4
|
+
version: 1.35.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: 2014-
|
11
|
+
date: 2014-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|