eyes_core 4.0.2 → 4.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/applitools/appium/eyes.rb +2 -2
- data/lib/applitools/calabash/calabash_screenshot_provider.rb +23 -23
- data/lib/applitools/calabash/full_page_capture_algorithm/base.rb +1 -1
- data/lib/applitools/core/batch_info.rb +3 -1
- data/lib/applitools/core/classic_runner.rb +3 -2
- data/lib/applitools/core/debug_screenshot_provider.rb +3 -3
- data/lib/applitools/core/eyes_base.rb +2 -1
- data/lib/applitools/core/eyes_runner.rb +18 -0
- data/lib/applitools/core/screenshot.rb +7 -7
- data/lib/applitools/core/test_result_summary.rb +17 -4
- data/lib/applitools/universal_sdk/universal_check_settings.rb +7 -1
- data/lib/applitools/universal_sdk/universal_client.rb +9 -2
- data/lib/applitools/universal_sdk/universal_eyes_config.rb +4 -2
- data/lib/applitools/universal_sdk/universal_server.rb +2 -1
- data/lib/applitools/utils/image_utils.rb +7 -7
- data/lib/applitools/version.rb +2 -2
- data/lib/eyes_core.rb +1 -1
- metadata +4 -34
- data/lib/applitools/chunky_png/resampling.rb +0 -51
- data/lib/applitools/chunky_png_patch.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 594c8d4219a36eebaef4d76310a8c9525235891d
|
4
|
+
data.tar.gz: f098d430a1c294deb84141dd2b8fb2c8505e0b01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6442028a1b2f6eee6c86538d50c4272310f8ec9928216deee68062f93b7e89b0d9df9a342affcd7aa996faba44128d43227e8b32f0b917e522753a0dc08daffd
|
7
|
+
data.tar.gz: 842eb9c9fab4f64621a7d15f508112c20ade9f80f04c4eb34c84f180a8c19a3140c8ef04bd71e23ddb7dd2d22b412c2b4adb6ac748c63235530505519e316918
|
@@ -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
|
-
|
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
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
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
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
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
|
@@ -35,7 +35,9 @@ module Applitools
|
|
35
35
|
self.id = PROCESS_DEFAULT_BATCH_ID
|
36
36
|
end
|
37
37
|
self.properties = properties if properties
|
38
|
-
|
38
|
+
unless env_notify_on_completion.nil?
|
39
|
+
self.notify_on_completion = 'true'.casecmp(env_notify_on_completion || '') == 0 ? true : false
|
40
|
+
end
|
39
41
|
end
|
40
42
|
|
41
43
|
def json_data
|
@@ -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
|
-
|
35
|
-
|
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
|
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
|
-
|
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
|
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
|
@@ -27,5 +27,23 @@ module Applitools
|
|
27
27
|
def close_all_eyes
|
28
28
|
get_universal_eyes_manager.close_all_eyes
|
29
29
|
end
|
30
|
+
|
31
|
+
# def close_batch(batch_id)
|
32
|
+
# if 'true'.casecmp(ENV['APPLITOOLS_DONT_CLOSE_BATCHES'] || '') == 0
|
33
|
+
# return Applitools::EyesLogger.info(
|
34
|
+
# 'APPLITOOLS_DONT_CLOSE_BATCHES environment variable set to true. Doing nothing.'
|
35
|
+
# ) && false
|
36
|
+
# end
|
37
|
+
# Applitools::ArgumentGuard.not_nil(batch_id, 'batch_id')
|
38
|
+
# Applitools::EyesLogger.info("Close batch called with #{batch_id}")
|
39
|
+
#
|
40
|
+
# close_batches_result = universal_client.core_close_batches(batch_id)
|
41
|
+
# if close_batches_result.is_a?(Hash) && close_batches_result[:message] && close_batches_result[:stack]
|
42
|
+
# Applitools::EyesLogger.logger.debug "Eyes close Batch: #{close_batches_result[:message]}"
|
43
|
+
# Applitools::EyesLogger.logger.debug "Stack for #{Applitools::Connectivity::UniversalClient::CORE_CLOSE_BATCHES} : #{close_batches_result[:stack]}"
|
44
|
+
# else
|
45
|
+
# Applitools::EyesLogger.info "delete batch is done with #{close_batches_result}"
|
46
|
+
# end
|
47
|
+
# end
|
30
48
|
end
|
31
49
|
end
|
@@ -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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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.
|
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'
|
@@ -93,8 +93,15 @@ module Applitools::Connectivity
|
|
93
93
|
await(->(cb) { @socket.request(CORE_SET_VIEWPORT_SIZE, {driver: driver, size: size}, cb) })
|
94
94
|
end
|
95
95
|
|
96
|
-
def core_close_batches(close_batch_settings)
|
96
|
+
def core_close_batches(close_batch_settings=nil)
|
97
97
|
# batchIds, serverUrl?, apiKey?, proxy?
|
98
|
+
unless close_batch_settings.is_a?(Hash)
|
99
|
+
batch_ids = [@open_config[:batch][:id]]
|
100
|
+
batch_ids = [close_batch_settings] if close_batch_settings.is_a?(String)
|
101
|
+
batch_ids = close_batch_settings if close_batch_settings.is_a?(Array)
|
102
|
+
optional = [:serverUrl, :apiKey, :proxy].map {|k| [k, @open_config[k]] }.to_h
|
103
|
+
close_batch_settings = { settings: ({ batchIds: batch_ids }.merge(optional).compact) }
|
104
|
+
end
|
98
105
|
await(->(cb) { @socket.request(CORE_CLOSE_BATCHES, close_batch_settings, cb) })
|
99
106
|
end
|
100
107
|
|
@@ -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
|
@@ -46,8 +46,9 @@ module Applitools::Connectivity
|
|
46
46
|
private
|
47
47
|
|
48
48
|
def filename
|
49
|
+
return 'eyes-universal-win.exe' if Gem.win_platform?
|
49
50
|
case RUBY_PLATFORM
|
50
|
-
when /mswin|windows/i
|
51
|
+
when /mswin|windows|mingw/i
|
51
52
|
'eyes-universal-win.exe'
|
52
53
|
when /linux|arch/i
|
53
54
|
'eyes-universal-linux'
|
@@ -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
|
-
|
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
|
-
|
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
|
data/lib/applitools/version.rb
CHANGED
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.
|
4
|
+
version: 4.0.5
|
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-
|
11
|
+
date: 2022-05-18 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:
|
117
|
+
version: 2.5.11
|
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:
|
124
|
+
version: 2.5.11
|
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
|