eyes_selenium 3.0.8 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/applitools/selenium/driver.rb +2 -2
- data/lib/applitools/selenium/eyes.rb +3 -3
- data/lib/applitools/selenium/eyes_target_locator.rb +2 -2
- data/lib/applitools/selenium/eyes_web_driver_screenshot.rb +3 -2
- data/lib/applitools/selenium/full_page_capture_algorithm.rb +1 -1
- data/lib/applitools/selenium/takes_screenshot_image_provider.rb +1 -1
- data/lib/applitools/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6896d25d23d811f8aca85bf603c0603bb0990ee3
|
4
|
+
data.tar.gz: f0f99ac4def013f90e8a3efa66540f67f096bf4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 621992921ad99724a5dce1ea5883dd071e2d3cd139486c6891434861e7afaab8a1043f293db0ad46ebed57ae7229bcbe58add4db8abb86bbed6e919e4cf545fd
|
7
|
+
data.tar.gz: 540099b4c7dee3fabc8745615103519e008013154c7810880f4cdb55ba1613c9d1b75fe21f0196f9ab810497e5de6ea1cd885e4dab0eb9c949451284d060eaf6
|
@@ -99,10 +99,10 @@ module Applitools::Selenium
|
|
99
99
|
# @param [:Symbol] format A format to store screenshot (one of +:base64+ or +:png+)
|
100
100
|
# @return [String] A byte string, representing the screenshot
|
101
101
|
def screenshot_as(format)
|
102
|
-
raise "Invalid format (#{format}) passed! Available formats: :png, :base64" unless
|
102
|
+
raise "Invalid format (#{format}) passed! Available formats: :png, :base64" unless [:base64, :png].include? format
|
103
103
|
png_screenshot = driver.screenshot_as(:png)
|
104
104
|
yield png_screenshot if block_given?
|
105
|
-
screenshot = Applitools::Screenshot.
|
105
|
+
screenshot = Applitools::Screenshot.from_any_image(png_screenshot)
|
106
106
|
self.class.normalize_rotation(self, screenshot, rotation)
|
107
107
|
return Applitools::Utils::ImageUtils.base64_from_png_image(screenshot.restore) if format == :base64
|
108
108
|
screenshot.to_blob
|
@@ -140,7 +140,7 @@ module Applitools::Selenium
|
|
140
140
|
|
141
141
|
self.eyes_screenshot_factory = lambda do |image|
|
142
142
|
Applitools::Selenium::EyesWebDriverScreenshot.new(
|
143
|
-
|
143
|
+
image, driver: @driver, force_offset: position_provider.force_offset
|
144
144
|
)
|
145
145
|
end
|
146
146
|
|
@@ -327,7 +327,7 @@ module Applitools::Selenium
|
|
327
327
|
' or :frame_chain option or :frames_path option'
|
328
328
|
end
|
329
329
|
|
330
|
-
if (needed_keys = (options.keys &
|
330
|
+
if (needed_keys = (options.keys & [:index, :name_or_id, :frame_element, :frame_chain, :frames_path])).length == 1
|
331
331
|
frame_key = needed_keys.first
|
332
332
|
else
|
333
333
|
raise Applitools::EyesIllegalArgument.new 'You\'ve passed some extra keys!' \
|
@@ -393,7 +393,7 @@ module Applitools::Selenium
|
|
393
393
|
'or :frame_chain option or :frames_path option'
|
394
394
|
end
|
395
395
|
|
396
|
-
if (needed_keys = (options.keys &
|
396
|
+
if (needed_keys = (options.keys & [:index, :name_or_id, :frame_element, :frame_chain, :frames_path])).length == 1
|
397
397
|
frame_key = needed_keys.first
|
398
398
|
else
|
399
399
|
raise Applitools::EyesIllegalArgument.new 'You\'ve passed some extra keys!' /
|
@@ -21,7 +21,7 @@ module Applitools::Selenium
|
|
21
21
|
def frame(options = {})
|
22
22
|
raise Applitools::EyesIllegalArgument.new 'You must pass :index or :name_or_id or :frame_element option' unless
|
23
23
|
options[:index] || options[:name_or_id] || options[:frame_element]
|
24
|
-
if (needed_keys = (options.keys &
|
24
|
+
if (needed_keys = (options.keys & [:index, :name_or_id, :frame_element])).length == 1
|
25
25
|
send "frame_by_#{needed_keys.first}", options[needed_keys.first]
|
26
26
|
else
|
27
27
|
raise Applitools::EyesIllegalArgument.new 'You\'ve passed some extra keys!' /
|
@@ -48,7 +48,7 @@ module Applitools::Selenium
|
|
48
48
|
raise Applitools::EyesIllegalArgument.new 'You must pass :frame_chain or :frames_path' if
|
49
49
|
options[:frame_chain].nil? & options[:frames_path].nil?
|
50
50
|
|
51
|
-
if (needed_keys = (options.keys &
|
51
|
+
if (needed_keys = (options.keys & [:frame_chain, :frames_path])).length == 1
|
52
52
|
send "frames_by_#{needed_keys.first}", options[needed_keys.first]
|
53
53
|
else
|
54
54
|
raise Applitools::EyesIllegalArgument.new 'You\'ve passed some extra keys!' /
|
@@ -252,13 +252,14 @@ module Applitools::Selenium
|
|
252
252
|
" of screenshot bounds [#{frame_window}]"
|
253
253
|
end
|
254
254
|
|
255
|
-
sub_screenshot_image = Applitools::Screenshot.
|
255
|
+
sub_screenshot_image = Applitools::Screenshot.from_image image.crop(as_is_subscreenshot_region.left,
|
256
256
|
as_is_subscreenshot_region.top, as_is_subscreenshot_region.width,
|
257
|
-
as_is_subscreenshot_region.height)
|
257
|
+
as_is_subscreenshot_region.height)
|
258
258
|
|
259
259
|
context_relative_region_location = convert_location as_is_subscreenshot_region.location,
|
260
260
|
Applitools::EyesScreenshot::COORDINATE_TYPES[:screenshot_as_is],
|
261
261
|
Applitools::EyesScreenshot::COORDINATE_TYPES[:context_relative]
|
262
|
+
|
262
263
|
result = self.class.new sub_screenshot_image, driver: driver,
|
263
264
|
entire_frame_size: Applitools::RectangleSize.new(sub_screenshot_image.width, sub_screenshot_image.height),
|
264
265
|
frame_location_in_screenshot: context_relative_region_location
|
@@ -22,7 +22,7 @@ module Applitools::Selenium
|
|
22
22
|
screenshot = driver.screenshot_as(:png)
|
23
23
|
end
|
24
24
|
logger.info 'Done getting screenshot! Creating Applitools::Screenshot...'
|
25
|
-
Applitools::Screenshot.
|
25
|
+
Applitools::Screenshot.from_datastream screenshot
|
26
26
|
end
|
27
27
|
|
28
28
|
private
|
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.1.1
|
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-
|
11
|
+
date: 2017-04-05 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.1.1
|
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.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: selenium-webdriver
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|