eyes_core 4.0.2 → 4.0.3

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: 81a4242f3c4b1abc7dfc40017e842bd62ffff201
4
- data.tar.gz: 60c91ce7eaa4204cd9679f84e7241625720fb016
3
+ metadata.gz: e1794c043c986eae53c0ec2f544c3927d23e8e35
4
+ data.tar.gz: cdabd0d4c839a670abfe72a506d10ac0328e0fa5
5
5
  SHA512:
6
- metadata.gz: 61e53f261d8dfc5b881b701cb496068c556b22c749cab6943a4ba3a7ab14af00be33a93b1bad27f5cdefe24ce06c39406ff7b97f9e5777305673705a07f182af
7
- data.tar.gz: e403debe4f47c24a17e3feb9ce9583a8b4504f3fec0578b5131693dce22221a2835c45d9da3480c7799f9a7d3bcc5cd908c2f61b8f2ec3e665be96c96e5074c3
6
+ metadata.gz: abb2ce4f8d46e97979e7e68d075ab5d910512d208c46f6202096e40d8bbe4c4411ded61ceff4e55496b6941d1579ef463917b69803fcdfc196d5fe14c95fee87
7
+ data.tar.gz: 96637eb89ef8c1604aa330eecb3b4155f0aae98d98221008c2bd0e73508881c9b9cd5230c7a6e05c3886fbdc3e1aefb7e767362140bdd8d048d95eb739b15c2a
@@ -84,8 +84,8 @@ class Applitools::Appium::Eyes < Applitools::Selenium::SeleniumEyes
84
84
  self.screenshot = screenshot_class.new(
85
85
  Applitools::Screenshot.from_image(
86
86
  case scaled_image
87
- when ChunkyPNG::Image
88
- scaled_image
87
+ # when ChunkyPNG::Image
88
+ # scaled_image
89
89
  when Applitools::Screenshot::Datastream
90
90
  scaled_image.image
91
91
  else
@@ -44,19 +44,19 @@ module Applitools
44
44
  def capture_screenshot(options = {})
45
45
  sleep WAIT_BEFORE_SCREENSHOT
46
46
  result = nil
47
- Applitools::Calabash::Utils.using_screenshot(context) do |screenshot_path|
48
- screenshot = ::ChunkyPNG::Image.from_file(screenshot_path)
49
- save_debug_screenshot(screenshot, ['original', options[:debug_suffix]])
50
- viewport_size = Applitools::Calabash::EyesSettings.instance.viewport_size
51
- screenshot.crop!(0, 0, viewport_size[:width], viewport_size[:height])
52
- save_debug_screenshot(screenshot, ['cropped', options[:debug_suffix]])
53
- result = Applitools::Calabash::EyesCalabashAndroidScreenshot.new(
54
- Applitools::Screenshot.from_image(
55
- screenshot
56
- ),
57
- density: density
58
- )
59
- end
47
+ # Applitools::Calabash::Utils.using_screenshot(context) do |screenshot_path|
48
+ # screenshot = ::ChunkyPNG::Image.from_file(screenshot_path)
49
+ # save_debug_screenshot(screenshot, ['original', options[:debug_suffix]])
50
+ # viewport_size = Applitools::Calabash::EyesSettings.instance.viewport_size
51
+ # screenshot.crop!(0, 0, viewport_size[:width], viewport_size[:height])
52
+ # save_debug_screenshot(screenshot, ['cropped', options[:debug_suffix]])
53
+ # result = Applitools::Calabash::EyesCalabashAndroidScreenshot.new(
54
+ # Applitools::Screenshot.from_image(
55
+ # screenshot
56
+ # ),
57
+ # density: density
58
+ # )
59
+ # end
60
60
  result
61
61
  end
62
62
  end
@@ -66,16 +66,16 @@ module Applitools
66
66
  def capture_screenshot(options = {})
67
67
  sleep WAIT_BEFORE_SCREENSHOT
68
68
  result = nil
69
- Applitools::Calabash::Utils.using_screenshot(context) do |screenshot_path|
70
- screenshot = ::ChunkyPNG::Image.from_file(screenshot_path)
71
- save_debug_screenshot(screenshot, options[:debug_suffix])
72
- result = Applitools::Calabash::EyesCalabashIosScreenshot.new(
73
- Applitools::Screenshot.from_image(
74
- screenshot
75
- ),
76
- scale_factor: density
77
- )
78
- end
69
+ # Applitools::Calabash::Utils.using_screenshot(context) do |screenshot_path|
70
+ # screenshot = ::ChunkyPNG::Image.from_file(screenshot_path)
71
+ # save_debug_screenshot(screenshot, options[:debug_suffix])
72
+ # result = Applitools::Calabash::EyesCalabashIosScreenshot.new(
73
+ # Applitools::Screenshot.from_image(
74
+ # screenshot
75
+ # ),
76
+ # scale_factor: density
77
+ # )
78
+ # end
79
79
  result
80
80
  end
81
81
  end
@@ -30,7 +30,7 @@ module Applitools
30
30
 
31
31
  def create_entire_image
32
32
  current_entire_size = entire_size
33
- @stitched_image = ::ChunkyPNG::Image.new(current_entire_size.width, current_entire_size.height)
33
+ # @stitched_image = ::ChunkyPNG::Image.new(current_entire_size.width, current_entire_size.height)
34
34
  end
35
35
 
36
36
  def entire_content
@@ -31,8 +31,9 @@ module Applitools
31
31
  end
32
32
  return all_test_results unless all_test_results.empty?
33
33
  all_universal_results = close_all_eyes
34
- key_transformed_results = Applitools::Utils.deep_stringify_keys(all_universal_results)
35
- key_transformed_results.map {|result| Applitools::TestResults.new(result) }
34
+ test_result_summary = Applitools::TestResultSummary.new(all_universal_results).old_style_results_array
35
+ return [] if test_result_summary.reject { |tr| tr.aborted? }.empty?
36
+ test_result_summary
36
37
  end
37
38
 
38
39
  def rendering_info(connector)
@@ -13,12 +13,12 @@ module Applitools
13
13
  def save(image, suffix = '')
14
14
  return unless debug
15
15
  case image
16
- when ::ChunkyPNG::Image, Applitools::Screenshot
16
+ when Applitools::Screenshot
17
17
  image.save(file_name_to_save(suffix)) if image.area > 0
18
18
  when Applitools::EyesScreenshot
19
19
  image.image.save(file_name_to_save(suffix)) if image.image.area > 0
20
- when String
21
- ::ChunkyPNG::Image.from_string(image).save(file_name_to_save(suffix))
20
+ # when String
21
+ # ::ChunkyPNG::Image.from_string(image).save(file_name_to_save(suffix))
22
22
  else
23
23
  return
24
24
  end
@@ -456,7 +456,8 @@ module Applitools
456
456
  # binding.pry
457
457
  key_transformed_results = Applitools::Utils.deep_stringify_keys(universal_results)
458
458
  results = key_transformed_results.map {|result| Applitools::TestResults.new(result) }
459
- results = results.first if results.size == 1
459
+ results = results.first if results.size >= 1
460
+
460
461
  session_results_url = results.url
461
462
  # results = server_connector.stop_session running_session, false, save
462
463
  runner.aggregate_result(results) if runner
@@ -5,7 +5,7 @@ module Applitools
5
5
  class Screenshot < Delegator
6
6
  class << self
7
7
  def from_region(region)
8
- self::Image.new(::ChunkyPNG::Image.new(region.width, region.height))
8
+ # self::Image.new(::ChunkyPNG::Image.new(region.width, region.height))
9
9
  end
10
10
 
11
11
  def from_datastream(datastream)
@@ -18,7 +18,7 @@ module Applitools
18
18
 
19
19
  def from_any_image(image)
20
20
  return from_region(image) if image.is_a? Applitools::Region
21
- return from_image(image) if image.is_a? ::ChunkyPNG::Image
21
+ # return from_image(image) if image.is_a? ::ChunkyPNG::Image
22
22
  return image if image.is_a?(Image) | image.is_a?(Datastream)
23
23
  from_datastream(image)
24
24
  end
@@ -60,12 +60,12 @@ module Applitools
60
60
  "Expected image to be Datastream or String, but got #{image.class}"
61
61
  )
62
62
  end
63
- @datastream = ::ChunkyPNG::Datastream.from_string image
63
+ # @datastream = ::ChunkyPNG::Datastream.from_string image
64
64
  end
65
65
 
66
66
  def update!(image)
67
67
  Applitools::ArgumentGuard.not_nil(image, 'image')
68
- Applitools::ArgumentGuard.is_a?(image, 'image', ::ChunkyPNG::Image)
68
+ # Applitools::ArgumentGuard.is_a?(image, 'image', ::ChunkyPNG::Image)
69
69
  @datastream = image.to_datastream
70
70
  self
71
71
  end
@@ -90,7 +90,7 @@ module Applitools
90
90
  end
91
91
 
92
92
  def restore
93
- ::ChunkyPNG::Image.from_datastream @datastream
93
+ # ::ChunkyPNG::Image.from_datastream @datastream
94
94
  end
95
95
 
96
96
  def sha256
@@ -103,13 +103,13 @@ module Applitools
103
103
 
104
104
  def initialize(image)
105
105
  Applitools::ArgumentGuard.not_nil(image, 'image')
106
- Applitools::ArgumentGuard.is_a?(image, 'image', ::ChunkyPNG::Image)
106
+ # Applitools::ArgumentGuard.is_a?(image, 'image', ::ChunkyPNG::Image)
107
107
  @image = image
108
108
  end
109
109
 
110
110
  def update!(image)
111
111
  Applitools::ArgumentGuard.not_nil(image, 'image')
112
- Applitools::ArgumentGuard.is_a?(image, 'image', ::ChunkyPNG::Image)
112
+ # Applitools::ArgumentGuard.is_a?(image, 'image', ::ChunkyPNG::Image)
113
113
  @image = image
114
114
  end
115
115
 
@@ -3,10 +3,23 @@
3
3
  module Applitools
4
4
  class TestResultSummary
5
5
  attr_accessor :results, :passed, :unresolved, :failed, :exceptions, :mismatches, :missing, :matches
6
- def initialize(results)
7
- Applitools::ArgumentGuard.is_a?(results, 'results', Array)
8
- results.each_with_index do |r, i|
9
- Applitools::ArgumentGuard.is_a?(r, "results[#{i}]", Applitools::TestResults)
6
+ attr_accessor :original_test_results
7
+ def initialize(all_test_results)
8
+ @original_test_results = all_test_results
9
+ @results = all_test_results[:results]
10
+ @passed = all_test_results[:passed]
11
+ @unresolved = all_test_results[:unresolved]
12
+ @failed = all_test_results[:failed]
13
+ @exceptions = all_test_results[:exceptions]
14
+ @mismatches = all_test_results[:mismatches]
15
+ @missing = all_test_results[:missing]
16
+ @matches = all_test_results[:matches]
17
+ end
18
+
19
+ def old_style_results_array
20
+ Applitools::Utils.deep_stringify_keys(results).map do |e|
21
+ r = e['testResults'] ? e['testResults'] : {}
22
+ Applitools::TestResults.new(r)
10
23
  end
11
24
  end
12
25
  end
@@ -11,18 +11,22 @@ module Applitools
11
11
  # layoutBreakpoints?: boolean | number[]
12
12
  # visualGridOptions?: {[key: string]: any}
13
13
  # hooks?: {beforeCaptureScreenshot: string}
14
+ # pageId?: string
14
15
  # renderId?: string
15
16
  # variationGroupId?: string
16
17
  # timeout?: number
18
+ # waitBeforeCapture?: number
17
19
  # }
18
20
  json_fields :name,
19
21
  :disableBrowserFetching,
20
22
  :layoutBreakpoints,
21
23
  :visualGridOptions,
22
24
  :hooks,
25
+ :pageId,
23
26
  :renderId,
24
27
  :variationGroupId,
25
- :timeout
28
+ :timeout,
29
+ :waitBeforeCapture
26
30
 
27
31
  # export type MatchSettings<TRegion> = {
28
32
  # exact?: {
@@ -139,6 +143,8 @@ module Applitools
139
143
  self.strict_regions = target.strict_regions
140
144
  self.timeout = target.options[:timeout]
141
145
  self.variation_group_id = target.options[:variation_group_id]
146
+ self.wait_before_capture = target.options[:wait_before_capture]
147
+ self.page_id = target.options[:page_id]
142
148
 
143
149
  self.scroll_root_element = target.options[:scroll_root_element] || eyes.scroll_root_element
144
150
  self.layout_breakpoints = target.options[:layout_breakpoints] || eyes.layout_breakpoints
@@ -20,7 +20,7 @@ module Applitools::Connectivity
20
20
  CORE_DELETE_TEST = 'Core.deleteTest'
21
21
 
22
22
  EYES_MANAGER_MAKE_EYES = 'EyesManager.openEyes'
23
- EYES_MANAGER_CLOSE_ALL_EYES = 'EyesManager.closeAllEyes'
23
+ EYES_MANAGER_CLOSE_ALL_EYES = 'EyesManager.closeManager'
24
24
  EYES_CHECK = 'Eyes.check'
25
25
  EYES_LOCATE = 'Eyes.locate'
26
26
  EYES_EXTRACT_TEXT_REGIONS = 'Eyes.extractTextRegions'
@@ -97,6 +97,7 @@ module Applitools
97
97
  # cut?: ImageCropRect | ImageCropRegion
98
98
  # rotation?: ImageRotation
99
99
  # scaleRatio?: number
100
+ # waitBeforeCapture?: number
100
101
  # }
101
102
  json_fields :waitBeforeScreenshots,
102
103
  :stitchMode,
@@ -106,7 +107,8 @@ module Applitools
106
107
  :scrollRootElement,
107
108
  :cut,
108
109
  :rotation,
109
- :scaleRatio
110
+ :scaleRatio,
111
+ :waitBeforeCapture
110
112
 
111
113
  # export type EyesUFGConfig = {
112
114
  # concurrentSessions?: number
@@ -125,7 +127,7 @@ module Applitools
125
127
  FROM_ORIGINAL_EYES = [:api_key, :app_name, :batch, :browsers_info, :concurrent_sessions, :debug_screenshots,
126
128
  :force_full_page_screenshot, :hide_caret, :hide_scrollbars, :host_app, :host_os, :match_timeout, :proxy,
127
129
  :save_failed_tests, :save_new_tests, :scale_ratio, :send_dom, :server_url, :stitch_mode, :test_name,
128
- :viewport_size, :visual_grid_options, :wait_before_screenshots] + [
130
+ :viewport_size, :visual_grid_options, :wait_before_screenshots, :wait_before_capture] + [
129
131
  :disabled?, # disabled? => is_disabled
130
132
  :stitching_overlap, # SeleniumEyes.stitching_overlap => stitch_overlap
131
133
  :dont_fetch_resources # dont_fetch_resources => disable_browser_fetching
@@ -15,16 +15,16 @@ module Applitools::Utils
15
15
  # Creates an image object from the PNG bytes.
16
16
  # @param [String] png_bytes A binary string of the PNG bytes of the image.
17
17
  # @return [ChunkyPNG::Canvas] An image object.
18
- def png_image_from_bytes(png_bytes)
19
- ChunkyPNG::Image.from_blob(png_bytes)
20
- end
18
+ # def png_image_from_bytes(png_bytes)
19
+ # ChunkyPNG::Image.from_blob(png_bytes)
20
+ # end
21
21
 
22
22
  # Creates an image instance from a base64 representation of its PNG encoding.
23
23
  # @param [String] png_bytes The Base64 representation of a PNG image.
24
24
  # @return [ChunkyPNG::Canvas] An image object.
25
- def png_image_from_base64(png_bytes)
26
- png_image_from_bytes(Base64.decode64(png_bytes))
27
- end
25
+ # def png_image_from_base64(png_bytes)
26
+ # png_image_from_bytes(Base64.decode64(png_bytes))
27
+ # end
28
28
 
29
29
  # Get the raw PNG bytes of an image.
30
30
  # @param [ChunkyPNG::Canvas] image The image object for which to get the PNG bytes.
@@ -99,7 +99,7 @@ module Applitools::Utils
99
99
  Applitools::ArgumentGuard.not_nil(new_width, 'new_width')
100
100
  Applitools::ArgumentGuard.not_nil(new_height, 'new_height')
101
101
  Applitools::ArgumentGuard.not_nil(image, 'image')
102
- Applitools::ArgumentGuard.is_a?(image, 'image', ::ChunkyPNG::Image)
102
+ # Applitools::ArgumentGuard.is_a?(image, 'image', ::ChunkyPNG::Image)
103
103
 
104
104
  raise Applitools::EyesIllegalArgument.new "Invalid width: #{new_width}" if new_width <= 0
105
105
  raise Applitools::EyesIllegalArgument.new "Invalid height: #{new_height}" if new_height <= 0
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Applitools
4
- VERSION = '4.0.2'.freeze
5
- UNIVERSAL_VERSION = '1.0.9'.freeze
4
+ VERSION = '4.0.3'.freeze
5
+ UNIVERSAL_VERSION = '2.5.7'.freeze
6
6
  end
data/lib/eyes_core.rb CHANGED
@@ -65,7 +65,7 @@ end
65
65
  require_relative 'applitools/method_tracer'
66
66
  require_relative 'applitools/extensions'
67
67
  require_relative 'applitools/version'
68
- require_relative 'applitools/chunky_png_patch'
68
+ # require_relative 'applitools/chunky_png_patch'
69
69
 
70
70
  Applitools.require_dir 'utils'
71
71
  Applitools.require_dir 'core'
metadata CHANGED
@@ -1,43 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eyes_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Applitools Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-17 00:00:00.000000000 Z
11
+ date: 2022-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: oily_png
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.2'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.2'
27
- - !ruby/object:Gem::Dependency
28
- name: chunky_png
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '='
32
- - !ruby/object:Gem::Version
33
- version: 1.3.6
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '='
39
- - !ruby/object:Gem::Version
40
- version: 1.3.6
41
13
  - !ruby/object:Gem::Dependency
42
14
  name: faraday
43
15
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +114,14 @@ dependencies:
142
114
  requirements:
143
115
  - - "~>"
144
116
  - !ruby/object:Gem::Version
145
- version: 1.0.9
117
+ version: 2.5.7
146
118
  type: :runtime
147
119
  prerelease: false
148
120
  version_requirements: !ruby/object:Gem::Requirement
149
121
  requirements:
150
122
  - - "~>"
151
123
  - !ruby/object:Gem::Version
152
- version: 1.0.9
124
+ version: 2.5.7
153
125
  - !ruby/object:Gem::Dependency
154
126
  name: bundler
155
127
  requirement: !ruby/object:Gem::Requirement
@@ -353,8 +325,6 @@ files:
353
325
  - lib/applitools/calabash_steps.rb
354
326
  - lib/applitools/capybara/capybara_settings.rb
355
327
  - lib/applitools/capybara/driver.rb
356
- - lib/applitools/chunky_png/resampling.rb
357
- - lib/applitools/chunky_png_patch.rb
358
328
  - lib/applitools/connectivity/proxy.rb
359
329
  - lib/applitools/connectivity/server_connector.rb
360
330
  - lib/applitools/connectivity/user_agent_middleware.rb
@@ -1,51 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Applitools
4
- class Enumerator < ::Enumerator
5
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
6
- attr_reader :size
7
- def initialize(*args)
8
- @size = args[0] if args.size == 1
9
- super()
10
- end
11
- end
12
- end
13
- end
14
-
15
- module Applitools::ChunkyPNG
16
- module Resampling
17
- def resample_bicubic!(dst_width, dst_height)
18
- new_pixels = resampling_first_step(dst_width, dst_height)
19
- replace_canvas!(dst_width, dst_height, new_pixels)
20
- self
21
- end
22
-
23
- def resample_bicubic(new_width, new_height)
24
- dup.resample_bicubic!(new_width, new_height)
25
- end
26
-
27
- def bicubic_x_points(dst_width)
28
- bicubic_points2(width, dst_width, false)
29
- end
30
-
31
- def bicubic_y_points(dst_height)
32
- bicubic_points2(height, dst_height, true)
33
- end
34
-
35
- def line_with_bounds(y, src_dimension, direction)
36
- line = (direction ? column(y) : row(y))
37
- [imaginable_point(line[0], line[1])] + line + [
38
- imaginable_point(line[src_dimension - 2], line[src_dimension - 3]),
39
- imaginable_point(line[src_dimension - 1], line[src_dimension - 2])
40
- ]
41
- end
42
-
43
- def imaginable_point(point1, point2)
44
- r = [0, [255, ChunkyPNG::Color.r(point1) << 1].min - ChunkyPNG::Color.r(point2)].max
45
- g = [0, [255, ChunkyPNG::Color.g(point1) << 1].min - ChunkyPNG::Color.g(point2)].max
46
- b = [0, [255, ChunkyPNG::Color.b(point1) << 1].min - ChunkyPNG::Color.b(point2)].max
47
- a = [0, [255, ChunkyPNG::Color.a(point1) << 1].min - ChunkyPNG::Color.a(point2)].max
48
- ChunkyPNG::Color.rgba(r, g, b, a)
49
- end
50
- end
51
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'oily_png'
4
- # require 'chunky_png'
5
- require_relative 'chunky_png/resampling'
6
- require 'eyes_core/eyes_core'
7
-
8
- ChunkyPNG::Canvas.class_eval do
9
- include Applitools::ChunkyPNG::Resampling
10
- include Applitools::ResamplingFast
11
- end