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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cbdef44822534d84943eef2844f0cc53b9efcef5
4
- data.tar.gz: c5f52fc16dd766035460772dc3e5d882dcd52635
3
+ metadata.gz: 6896d25d23d811f8aca85bf603c0603bb0990ee3
4
+ data.tar.gz: f0f99ac4def013f90e8a3efa66540f67f096bf4a
5
5
  SHA512:
6
- metadata.gz: 0dd5267129e4b6d82728c837d484d54d2a2871a4efeac2a10918a38a90d08c3cf01d3b9f984ac0988281339d85ed62b56d1cd1c8ff9acea0ec12e98e3e9faefc
7
- data.tar.gz: fce1c53e8e30b2620dc6353e1400a3c0abd6474d6e217836b94b6d55154d63884a3c2d94b6aa61ab338c85b4ff8fd199bc3a20329465a8856bc7dbcc0711e01b
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 %i(base64 png).include? format
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.new(png_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
- image, driver: @driver, force_offset: position_provider.force_offset
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 & %i(index name_or_id frame_element frame_chain frames_path))).length == 1
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 & %i(index name_or_id frame_element frame_chain frames_path))).length == 1
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 & %i(index name_or_id frame_element))).length == 1
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 & %i(frame_chain frames_path))).length == 1
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.new image.crop(as_is_subscreenshot_region.left,
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).to_datastream.to_blob
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
@@ -157,7 +157,7 @@ module Applitools::Selenium
157
157
  logger.info 'Done!'
158
158
  end
159
159
 
160
- Applitools::Screenshot.new(stitched_image.to_blob)
160
+ Applitools::Screenshot.from_any_image(stitched_image.to_blob)
161
161
  end
162
162
  end
163
163
  end
@@ -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.new screenshot
25
+ Applitools::Screenshot.from_datastream screenshot
26
26
  end
27
27
 
28
28
  private
@@ -1,3 +1,3 @@
1
1
  module Applitools
2
- VERSION = '3.0.8'.freeze
2
+ VERSION = '3.1.1'.freeze
3
3
  end
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.0.8
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-03-31 00:00:00.000000000 Z
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.0.8
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.0.8
26
+ version: 3.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: selenium-webdriver
29
29
  requirement: !ruby/object:Gem::Requirement