eyes_core 3.18.4 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/applitools/appium/eyes.rb +3 -2
- data/lib/applitools/appium/target.rb +218 -193
- 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/connectivity/proxy.rb +11 -3
- data/lib/applitools/connectivity/server_connector.rb +2 -1
- data/lib/applitools/core/accessibility_level.rb +11 -0
- data/lib/applitools/core/batch_info.rb +24 -2
- data/lib/applitools/core/classic_runner.rb +9 -1
- data/lib/applitools/core/debug_screenshot_provider.rb +3 -3
- data/lib/applitools/core/eyes_base.rb +81 -28
- data/lib/applitools/core/eyes_base_configuration.rb +22 -1
- data/lib/applitools/core/eyes_runner.rb +12 -0
- data/lib/applitools/core/floating_region.rb +17 -8
- data/lib/applitools/core/image_match_settings.rb +54 -0
- data/lib/applitools/core/match_level.rb +3 -1
- data/lib/applitools/core/screenshot.rb +7 -7
- data/lib/applitools/core/test_result_summary.rb +17 -4
- data/lib/applitools/core/test_results.rb +2 -2
- data/lib/applitools/core/universal_eyes_checks.rb +66 -0
- data/lib/applitools/core/universal_eyes_open.rb +100 -0
- data/lib/applitools/core/universal_new_api.rb +43 -0
- data/lib/applitools/universal_sdk/universal_check_settings.rb +190 -0
- data/lib/applitools/universal_sdk/universal_client.rb +142 -0
- data/lib/applitools/universal_sdk/universal_client_socket.rb +110 -0
- data/lib/applitools/universal_sdk/universal_eyes.rb +45 -0
- data/lib/applitools/universal_sdk/universal_eyes_config.rb +205 -0
- data/lib/applitools/universal_sdk/universal_eyes_manager.rb +40 -0
- data/lib/applitools/universal_sdk/universal_eyes_manager_config.rb +62 -0
- data/lib/applitools/universal_sdk/universal_server.rb +81 -0
- data/lib/applitools/utils/image_utils.rb +7 -7
- data/lib/applitools/utils/utils.rb +13 -0
- data/lib/applitools/version.rb +2 -1
- data/lib/eyes_core.rb +4 -1
- metadata +55 -18
- data/lib/applitools/chunky_png/resampling.rb +0 -51
- data/lib/applitools/chunky_png_patch.rb +0 -11
@@ -0,0 +1,205 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Applitools
|
4
|
+
class UniversalEyesConfig
|
5
|
+
include Applitools::Jsonable
|
6
|
+
|
7
|
+
# export type EyesBaseConfig = {
|
8
|
+
# logs?: LogHandler
|
9
|
+
# debugScreenshots?: DebugScreenshotHandler
|
10
|
+
# agentId?: string
|
11
|
+
# apiKey?: string
|
12
|
+
# serverUrl?: string
|
13
|
+
# proxy?: Proxy
|
14
|
+
# isDisabled?: boolean
|
15
|
+
# connectionTimeout?: number
|
16
|
+
# removeSession?: boolean
|
17
|
+
# remoteEvents?: {serverUrl: string; accessKey?: string; timeout?: number}
|
18
|
+
# }
|
19
|
+
json_fields :logs,
|
20
|
+
:debugScreenshots,
|
21
|
+
:agentId,
|
22
|
+
:apiKey,
|
23
|
+
:serverUrl,
|
24
|
+
:proxy,
|
25
|
+
:isDisabled,
|
26
|
+
:connectionTimeout,
|
27
|
+
:removeSession,
|
28
|
+
:remoteEvents
|
29
|
+
|
30
|
+
# export type EyesOpenConfig = {
|
31
|
+
# appName?: string
|
32
|
+
# testName?: string
|
33
|
+
# displayName?: string
|
34
|
+
# viewportSize?: Size
|
35
|
+
# sessionType?: SessionType
|
36
|
+
# properties?: CustomProperty[]
|
37
|
+
# batch?: Batch
|
38
|
+
# defaultMatchSettings?: MatchSettings<Region>
|
39
|
+
# hostApp?: string
|
40
|
+
# hostOS?: string
|
41
|
+
# hostAppInfo?: string
|
42
|
+
# hostOSInfo?: string
|
43
|
+
# deviceInfo?: string
|
44
|
+
# baselineEnvName?: string
|
45
|
+
# environmentName?: string
|
46
|
+
# branchName?: string
|
47
|
+
# parentBranchName?: string
|
48
|
+
# baselineBranchName?: string
|
49
|
+
# compareWithParentBranch?: boolean
|
50
|
+
# ignoreBaseline?: boolean
|
51
|
+
# saveFailedTests?: boolean
|
52
|
+
# saveNewTests?: boolean
|
53
|
+
# saveDiffs?: boolean
|
54
|
+
# dontCloseBatches?: boolean
|
55
|
+
# }
|
56
|
+
json_fields :appName,
|
57
|
+
:testName,
|
58
|
+
:displayName,
|
59
|
+
:viewportSize,
|
60
|
+
:sessionType,
|
61
|
+
:properties,
|
62
|
+
:batch,
|
63
|
+
:defaultMatchSettings,
|
64
|
+
:hostApp,
|
65
|
+
:hostOS,
|
66
|
+
:hostAppInfo,
|
67
|
+
:hostOSInfo,
|
68
|
+
:deviceInfo,
|
69
|
+
:baselineEnvName,
|
70
|
+
:environmentName,
|
71
|
+
:branchName,
|
72
|
+
:parentBranchName,
|
73
|
+
:baselineBranchName,
|
74
|
+
:compareWithParentBranch,
|
75
|
+
:ignoreBaseline,
|
76
|
+
:saveFailedTests,
|
77
|
+
:saveNewTests,
|
78
|
+
:saveDiffs,
|
79
|
+
:dontCloseBatches
|
80
|
+
|
81
|
+
# export type EyesCheckConfig = {
|
82
|
+
# sendDom?: boolean
|
83
|
+
# matchTimeout?: number
|
84
|
+
# forceFullPageScreenshot?: boolean
|
85
|
+
# }
|
86
|
+
json_fields :sendDom,
|
87
|
+
:matchTimeout,
|
88
|
+
:forceFullPageScreenshot
|
89
|
+
|
90
|
+
# export type EyesClassicConfig<TElement = unknown, TSelector = unknown> = {
|
91
|
+
# waitBeforeScreenshots?: number
|
92
|
+
# stitchMode?: StitchMode
|
93
|
+
# hideScrollbars?: boolean
|
94
|
+
# hideCaret?: boolean
|
95
|
+
# stitchOverlap?: number
|
96
|
+
# scrollRootElement?: TElement | TSelector
|
97
|
+
# cut?: ImageCropRect | ImageCropRegion
|
98
|
+
# rotation?: ImageRotation
|
99
|
+
# scaleRatio?: number
|
100
|
+
# waitBeforeCapture?: number
|
101
|
+
# }
|
102
|
+
json_fields :waitBeforeScreenshots,
|
103
|
+
:stitchMode,
|
104
|
+
:hideScrollbars,
|
105
|
+
:hideCaret,
|
106
|
+
:stitchOverlap,
|
107
|
+
:scrollRootElement,
|
108
|
+
:cut,
|
109
|
+
:rotation,
|
110
|
+
:scaleRatio,
|
111
|
+
:waitBeforeCapture
|
112
|
+
|
113
|
+
# export type EyesUFGConfig = {
|
114
|
+
# concurrentSessions?: number
|
115
|
+
# browsersInfo?: (DesktopBrowserRenderer | ChromeEmulationDeviceRenderer | IOSDeviceRenderer)[]
|
116
|
+
# visualGridOptions?: Record<string, any>
|
117
|
+
# layoutBreakpoints?: boolean | number[]
|
118
|
+
# disableBrowserFetching?: boolean
|
119
|
+
# }
|
120
|
+
json_fields :concurrentSessions,
|
121
|
+
:browsersInfo,
|
122
|
+
:visualGridOptions,
|
123
|
+
:layoutBreakpoints,
|
124
|
+
:disableBrowserFetching
|
125
|
+
|
126
|
+
# 23 + 3 + 2 + 11 = 39
|
127
|
+
FROM_ORIGINAL_EYES = [:api_key, :app_name, :batch, :browsers_info, :concurrent_sessions, :debug_screenshots,
|
128
|
+
:force_full_page_screenshot, :hide_caret, :hide_scrollbars, :host_app, :host_os, :match_timeout, :proxy,
|
129
|
+
:save_failed_tests, :save_new_tests, :scale_ratio, :send_dom, :server_url, :stitch_mode, :test_name,
|
130
|
+
:viewport_size, :visual_grid_options, :wait_before_screenshots, :wait_before_capture] + [
|
131
|
+
:disabled?, # disabled? => is_disabled
|
132
|
+
:stitching_overlap, # SeleniumEyes.stitching_overlap => stitch_overlap
|
133
|
+
:dont_fetch_resources # dont_fetch_resources => disable_browser_fetching
|
134
|
+
] + [
|
135
|
+
:layout_breakpoints,
|
136
|
+
:scroll_root_element,
|
137
|
+
] + [
|
138
|
+
:environment_name, :branch_name, :default_match_settings, :properties, :parent_branch_name,
|
139
|
+
:compare_with_parent_branch, :baseline_env_name, :save_diffs, :session_type, :baseline_branch_name
|
140
|
+
]
|
141
|
+
|
142
|
+
# 51 - 39 - 2 = 10
|
143
|
+
OTHER = [:logs, :remove_session, :remote_events, :display_name, :host_app_info, :host_os_info, :device_info,
|
144
|
+
:ignore_baseline, :cut, :rotation ]
|
145
|
+
|
146
|
+
|
147
|
+
alias disabled= is_disabled=
|
148
|
+
alias stitching_overlap= stitch_overlap=
|
149
|
+
alias dont_fetch_resources= disable_browser_fetching=
|
150
|
+
|
151
|
+
def initialize(*args)
|
152
|
+
options = Applitools::Utils.extract_options! args
|
153
|
+
options.keys.select {|k| options[k] && respond_to?("#{k}=") }.each {|k| send("#{k}=", options[k]) }
|
154
|
+
# other
|
155
|
+
self.connection_timeout = Applitools::Connectivity::ServerConnector::DEFAULT_TIMEOUT
|
156
|
+
if 'true'.casecmp(ENV['APPLITOOLS_DONT_CLOSE_BATCHES'] || '') == 0
|
157
|
+
self.dont_close_batches = true
|
158
|
+
Applitools::EyesLogger.info('APPLITOOLS_DONT_CLOSE_BATCHES environment variable set to true. Doing nothing.')
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
def from_original_sdk(original_eyes)
|
163
|
+
FROM_ORIGINAL_EYES.each {|m| copy_from(m, original_eyes) }
|
164
|
+
self.agent_id = original_eyes.base_agent_id if original_eyes.respond_to?(:base_agent_id)
|
165
|
+
self.agent_id = original_eyes.full_agent_id if original_eyes.respond_to?(:full_agent_id)
|
166
|
+
# self.display_name = original_eyes.app_name
|
167
|
+
prepare_for_json!
|
168
|
+
end
|
169
|
+
|
170
|
+
def copy_from(what, from)
|
171
|
+
if from.respond_to?(what)
|
172
|
+
send("#{what.to_s.chomp('?') }=", from.send(what))
|
173
|
+
else
|
174
|
+
puts "respond_to? #{what} - fail"
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
def prepare_for_json!
|
179
|
+
self.batch = batch.to_hash if batch.is_a?(Applitools::BatchInfo)
|
180
|
+
self.browsers_info = browsers_info.to_hash if browsers_info.is_a?(Applitools::Selenium::BrowsersInfo)
|
181
|
+
self.default_match_settings = default_match_settings.to_hash if default_match_settings.is_a?(Applitools::ImageMatchSettings)
|
182
|
+
self.proxy = proxy.to_hash if proxy.is_a?(Applitools::Connectivity::Proxy)
|
183
|
+
self.viewport_size = viewport_size.to_h if viewport_size.is_a?(Applitools::RectangleSize)
|
184
|
+
# require 'pry'
|
185
|
+
# binding.pry
|
186
|
+
end
|
187
|
+
|
188
|
+
def to_hash
|
189
|
+
json_data.compact.reject do |_, v|
|
190
|
+
case v
|
191
|
+
when Array, Hash
|
192
|
+
v.empty?
|
193
|
+
when Numeric
|
194
|
+
v.zero?
|
195
|
+
# when FalseClass
|
196
|
+
# true
|
197
|
+
else
|
198
|
+
false
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
end
|
204
|
+
end
|
205
|
+
# U-Notes : Added internal Applitools::UniversalEyesConfig
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# require_relative 'universal_eyes'
|
4
|
+
|
5
|
+
module Applitools
|
6
|
+
class UniversalEyesManager
|
7
|
+
|
8
|
+
extend Forwardable
|
9
|
+
def_delegators 'Applitools::EyesLogger', :logger
|
10
|
+
|
11
|
+
def initialize(manager, universal_client)
|
12
|
+
@manager = manager
|
13
|
+
@universal_client = universal_client
|
14
|
+
end
|
15
|
+
|
16
|
+
def open_eyes(driver_config_json, config)
|
17
|
+
# Applitools::EyesLogger.logger.debug "Driver: #{driver_config_json}"
|
18
|
+
# Applitools::EyesLogger.logger.debug "open config: #{config}"
|
19
|
+
|
20
|
+
@eyes = @universal_client.eyes_manager_make_eyes(@manager, driver_config_json, config)
|
21
|
+
|
22
|
+
if @eyes[:message] && @eyes[:stack]
|
23
|
+
Applitools::EyesLogger.logger.debug "Eyes not opened: #{@eyes[:message]}"
|
24
|
+
Applitools::EyesLogger.logger.debug "Stack for #{Applitools::Connectivity::UniversalClient::EYES_MANAGER_MAKE_EYES} : #{@eyes[:stack]}"
|
25
|
+
return nil
|
26
|
+
end
|
27
|
+
|
28
|
+
Applitools::EyesLogger.logger.debug "Eyes applitools-ref-id: #{@eyes[:"applitools-ref-id"]}"
|
29
|
+
# U-Notes : !!! Eyes.new
|
30
|
+
Applitools::UniversalEyes.new(@eyes, @universal_client)
|
31
|
+
end
|
32
|
+
|
33
|
+
def close_all_eyes
|
34
|
+
@universal_client.eyes_manager_close_all_eyes(@manager)
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
# U-Notes : Added internal Applitools::UniversalEyesManager
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Applitools
|
4
|
+
class UniversalEyesManagerConfig
|
5
|
+
|
6
|
+
def self.classic
|
7
|
+
new(type: CLASSIC)
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.vg(concurrent_open_sessions=1)
|
11
|
+
new(type: VG, concurrency: concurrent_open_sessions, legacy: false)
|
12
|
+
end
|
13
|
+
|
14
|
+
# export type EyesManagerConfig<TType extends 'vg' | 'classic' = 'vg' | 'classic'> = {
|
15
|
+
# type: TType
|
16
|
+
# concurrency?: TType extends 'vg' ? number : never
|
17
|
+
# legacy?: TType extends 'vg' ? boolean : never
|
18
|
+
# }
|
19
|
+
attr_reader :type, :concurrency, :legacy
|
20
|
+
|
21
|
+
VG = 'vg'.freeze
|
22
|
+
CLASSIC = 'classic'.freeze
|
23
|
+
def type_enum_values
|
24
|
+
[VG, CLASSIC]
|
25
|
+
end
|
26
|
+
|
27
|
+
def initialize(*args)
|
28
|
+
options = Applitools::Utils.extract_options!(args)
|
29
|
+
self.type = options[:type].to_s
|
30
|
+
self.concurrency = options[:concurrency]
|
31
|
+
self.legacy = options[:legacy]
|
32
|
+
end
|
33
|
+
|
34
|
+
# enum_field :type, Applitools::UniversalEyesManagerConfig.type_enum_values
|
35
|
+
def type=(value)
|
36
|
+
available_values_array = type_enum_values
|
37
|
+
unless available_values_array.include? value
|
38
|
+
msg = "Unknown type #{value}. Allowed type values: #{available_values_array.join(', ')}"
|
39
|
+
raise(Applitools::EyesIllegalArgument, msg)
|
40
|
+
end
|
41
|
+
@type = value
|
42
|
+
end
|
43
|
+
|
44
|
+
def concurrency=(value)
|
45
|
+
@concurrency = value.to_i if type == VG
|
46
|
+
end
|
47
|
+
|
48
|
+
def legacy=(value)
|
49
|
+
@legacy = !!value if type == VG
|
50
|
+
end
|
51
|
+
|
52
|
+
def to_hash
|
53
|
+
result = {}
|
54
|
+
result[:type] = type
|
55
|
+
result[:concurrency] = concurrency if concurrency
|
56
|
+
result[:legacy] = legacy if legacy
|
57
|
+
result.compact
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
# U-Notes : Added internal Applitools::UniversalEyesManagerConfig
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'open-uri'
|
4
|
+
require 'digest'
|
5
|
+
require 'fileutils'
|
6
|
+
|
7
|
+
module Applitools::Connectivity
|
8
|
+
module UniversalServer
|
9
|
+
extend self
|
10
|
+
|
11
|
+
DEFAULT_SERVER_IP = '127.0.0.1'
|
12
|
+
DEFAULT_SERVER_PORT = 21077
|
13
|
+
|
14
|
+
def run
|
15
|
+
raise 'Universal server unrecognized' unless find_server_file?
|
16
|
+
pid = spawn(filepath, '--singleton --lazy', [:out, :err] => ["log", 'w'])
|
17
|
+
Process.detach(pid)
|
18
|
+
end
|
19
|
+
|
20
|
+
def confirm_is_up(ip, port, attempt = 1)
|
21
|
+
raise 'Universal server unavailable' if (attempt === 16)
|
22
|
+
begin
|
23
|
+
TCPSocket.new(ip, port)
|
24
|
+
rescue Errno::ECONNREFUSED
|
25
|
+
sleep 1
|
26
|
+
confirm_is_up(ip, port, attempt + 1)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def check_or_run(ip = DEFAULT_SERVER_IP, port = DEFAULT_SERVER_PORT)
|
31
|
+
server_uri = "#{ip}:#{port}"
|
32
|
+
socket_uri = "ws://#{server_uri}/eyes"
|
33
|
+
begin
|
34
|
+
TCPSocket.new(ip, port)
|
35
|
+
msg = "Connect to #{server_uri}"
|
36
|
+
rescue Errno::ECONNREFUSED
|
37
|
+
run
|
38
|
+
confirm_is_up(ip, port)
|
39
|
+
msg = "Connect to #{server_libname} : #{filename}"
|
40
|
+
end
|
41
|
+
|
42
|
+
Applitools::EyesLogger.logger.debug(msg) if ENV['APPLITOOLS_SHOW_LOGS']
|
43
|
+
socket_uri
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def filename
|
49
|
+
case RUBY_PLATFORM
|
50
|
+
when /mswin|windows/i
|
51
|
+
'eyes-universal-win.exe'
|
52
|
+
when /linux|arch/i
|
53
|
+
'eyes-universal-linux'
|
54
|
+
when /darwin/i
|
55
|
+
'eyes-universal-macos'
|
56
|
+
else
|
57
|
+
raise 'Unsupported platform'
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def server_libname
|
62
|
+
'eyes_universal'
|
63
|
+
end
|
64
|
+
|
65
|
+
def server_lib
|
66
|
+
Gem::Specification.find_by_name(server_libname)
|
67
|
+
rescue Gem::MissingSpecError
|
68
|
+
nil
|
69
|
+
end
|
70
|
+
|
71
|
+
def filepath
|
72
|
+
server_lib ? File.join(server_lib.gem_dir, 'ext', 'eyes-universal', filename) : ''
|
73
|
+
end
|
74
|
+
|
75
|
+
def find_server_file?
|
76
|
+
File.exist?(filepath) && File.executable?(filepath)
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
end
|
81
|
+
# U-Notes : Added internal Applitools::Connectivity::UniversalServer
|
@@ -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
|
@@ -84,6 +84,19 @@ module Applitools::Utils
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
+
def deep_stringify_keys(value)
|
88
|
+
case value
|
89
|
+
when Hash
|
90
|
+
value.each_with_object({}) do |(key, val), result|
|
91
|
+
result[key.to_s] = deep_stringify_keys(val)
|
92
|
+
end
|
93
|
+
when Array
|
94
|
+
value.map { |e| deep_stringify_keys(e) }
|
95
|
+
else
|
96
|
+
value
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
87
100
|
private
|
88
101
|
|
89
102
|
def convert_hash_keys(value, method)
|
data/lib/applitools/version.rb
CHANGED
data/lib/eyes_core.rb
CHANGED
@@ -31,6 +31,8 @@ module Applitools
|
|
31
31
|
# @!visibility private
|
32
32
|
class UnknownNetworkStackError < EyesError; end
|
33
33
|
|
34
|
+
class NotUniversalServerRequestError < EyesError; end
|
35
|
+
|
34
36
|
# @!visibility private
|
35
37
|
class AbstractMethodCalled < EyesError
|
36
38
|
attr_accessor :method_name, :object
|
@@ -63,10 +65,11 @@ end
|
|
63
65
|
require_relative 'applitools/method_tracer'
|
64
66
|
require_relative 'applitools/extensions'
|
65
67
|
require_relative 'applitools/version'
|
66
|
-
require_relative 'applitools/chunky_png_patch'
|
68
|
+
# require_relative 'applitools/chunky_png_patch'
|
67
69
|
|
68
70
|
Applitools.require_dir 'utils'
|
69
71
|
Applitools.require_dir 'core'
|
70
72
|
Applitools.require_dir 'connectivity'
|
73
|
+
Applitools.require_dir 'universal_sdk'
|
71
74
|
|
72
75
|
require_relative 'applitools/eyes_logger'
|
metadata
CHANGED
@@ -1,45 +1,45 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eyes_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
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:
|
11
|
+
date: 2022-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
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: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: faraday_middleware
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: faraday
|
42
|
+
name: faraday-cookie_jar
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: oj
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: colorize
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,7 +81,21 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: faye-websocket
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: eventmachine
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - ">="
|
@@ -94,6 +108,20 @@ dependencies:
|
|
94
108
|
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: eyes_universal
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 2.5.7
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 2.5.7
|
97
125
|
- !ruby/object:Gem::Dependency
|
98
126
|
name: bundler
|
99
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -297,8 +325,6 @@ files:
|
|
297
325
|
- lib/applitools/calabash_steps.rb
|
298
326
|
- lib/applitools/capybara/capybara_settings.rb
|
299
327
|
- lib/applitools/capybara/driver.rb
|
300
|
-
- lib/applitools/chunky_png/resampling.rb
|
301
|
-
- lib/applitools/chunky_png_patch.rb
|
302
328
|
- lib/applitools/connectivity/proxy.rb
|
303
329
|
- lib/applitools/connectivity/server_connector.rb
|
304
330
|
- lib/applitools/connectivity/user_agent_middleware.rb
|
@@ -352,11 +378,22 @@ files:
|
|
352
378
|
- lib/applitools/core/test_results.rb
|
353
379
|
- lib/applitools/core/text_trigger.rb
|
354
380
|
- lib/applitools/core/trigger.rb
|
381
|
+
- lib/applitools/core/universal_eyes_checks.rb
|
382
|
+
- lib/applitools/core/universal_eyes_open.rb
|
383
|
+
- lib/applitools/core/universal_new_api.rb
|
355
384
|
- lib/applitools/extensions.rb
|
356
385
|
- lib/applitools/eyes_logger.rb
|
357
386
|
- lib/applitools/method_tracer.rb
|
358
387
|
- lib/applitools/rspec/target_matcher.rb
|
359
388
|
- lib/applitools/sauce.rb
|
389
|
+
- lib/applitools/universal_sdk/universal_check_settings.rb
|
390
|
+
- lib/applitools/universal_sdk/universal_client.rb
|
391
|
+
- lib/applitools/universal_sdk/universal_client_socket.rb
|
392
|
+
- lib/applitools/universal_sdk/universal_eyes.rb
|
393
|
+
- lib/applitools/universal_sdk/universal_eyes_config.rb
|
394
|
+
- lib/applitools/universal_sdk/universal_eyes_manager.rb
|
395
|
+
- lib/applitools/universal_sdk/universal_eyes_manager_config.rb
|
396
|
+
- lib/applitools/universal_sdk/universal_server.rb
|
360
397
|
- lib/applitools/utils/eyes_selenium_utils.rb
|
361
398
|
- lib/applitools/utils/image_delta_compressor.rb
|
362
399
|
- lib/applitools/utils/image_utils.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
|