eyes_core 3.16.1 → 3.16.2
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 +1 -1
- data/lib/applitools/calabash/eyes.rb +1 -2
- data/lib/applitools/core/eyes_base.rb +2 -8
- data/lib/applitools/core/eyes_base_configuration.rb +28 -40
- data/lib/applitools/core/eyes_configuration_dsl.rb +24 -8
- data/lib/applitools/core/image_match_settings.rb +82 -0
- data/lib/applitools/core/match_level_setter.rb +1 -1
- data/lib/applitools/core/match_window_data.rb +31 -59
- data/lib/applitools/core/rendering_info.rb +3 -1
- data/lib/applitools/version.rb +1 -1
- data/lib/eyes_core.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72c04d816c39ee12a767a8fa6e0511f759d67bd5eeaeb81259bf4cafcbbf75db
|
4
|
+
data.tar.gz: a95cf25bf88d074a1f4a929d1a65ff2a695d0f471115ebc5d4b7f6a30c5b1d72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5cf5a5acd9f4d66afdf26af9895087fae8d7e70626dfd838d101a09cdbae4f0c3720e3b46c36e8abd13aaeba2cd07d5bdbed03c15d5dde3f64bc47c4d83705e
|
7
|
+
data.tar.gz: b689820896767659dfa66c7eae56832a4e2f67cea6e18967f2911b03c0550f133abbd0673143b031088507816f94defdcea9bf805fee1fcb17538d0e3300b6b3
|
@@ -30,7 +30,7 @@ class Applitools::Appium::Eyes < Applitools::Selenium::SeleniumEyes
|
|
30
30
|
logger.info "check_native(#{name}) is called"
|
31
31
|
update_scaling_params
|
32
32
|
target_to_check = target.finalize
|
33
|
-
match_data = Applitools::MatchWindowData.new
|
33
|
+
match_data = Applitools::MatchWindowData.new(default_match_settings)
|
34
34
|
match_data.tag = name
|
35
35
|
timeout = target_to_check.options[:timeout] || USE_DEFAULT_MATCH_TIMEOUT
|
36
36
|
|
@@ -24,7 +24,7 @@ module Applitools
|
|
24
24
|
|
25
25
|
def check(name, target)
|
26
26
|
self.tag_for_debug = get_tag_for_debug(name)
|
27
|
-
check_it(name, target, Applitools::MatchWindowData.new)
|
27
|
+
check_it(name, target, Applitools::MatchWindowData.new(default_match_settings))
|
28
28
|
end
|
29
29
|
|
30
30
|
def inferred_environment
|
@@ -75,7 +75,6 @@ module Applitools
|
|
75
75
|
end
|
76
76
|
|
77
77
|
match_window_data.tag = name
|
78
|
-
update_default_settings(match_window_data)
|
79
78
|
match_window_data.read_target(target, nil)
|
80
79
|
|
81
80
|
self.viewport_size = Applitools::Calabash::EyesSettings.instance.viewport_size if viewport_size.nil?
|
@@ -319,7 +319,7 @@ module Applitools
|
|
319
319
|
session_start_info = SessionStartInfo.new agent_id: base_agent_id, app_id_or_name: app_name,
|
320
320
|
scenario_id_or_name: test_name, batch_info: batch,
|
321
321
|
env_name: baseline_env_name, environment: app_environment,
|
322
|
-
default_match_settings: default_match_settings,
|
322
|
+
default_match_settings: default_match_settings.json_data,
|
323
323
|
branch_name: branch_name, parent_branch_name: parent_branch_name, properties: properties
|
324
324
|
|
325
325
|
match_window_data.start_info = session_start_info
|
@@ -486,12 +486,6 @@ module Applitools
|
|
486
486
|
{}
|
487
487
|
end
|
488
488
|
|
489
|
-
def update_default_settings(match_data)
|
490
|
-
config.match_level_keys.each do |k|
|
491
|
-
match_data.send("#{k}=", default_match_settings[k])
|
492
|
-
end
|
493
|
-
end
|
494
|
-
|
495
489
|
def app_environment
|
496
490
|
Applitools::AppEnvironment.new os: host_os, hosting_app: host_app,
|
497
491
|
display_size: viewport_size, inferred: inferred_environment
|
@@ -600,7 +594,7 @@ module Applitools
|
|
600
594
|
self.session_start_info = SessionStartInfo.new agent_id: base_agent_id, app_id_or_name: app_name,
|
601
595
|
scenario_id_or_name: test_name, batch_info: batch,
|
602
596
|
env_name: baseline_env_name, environment: app_env,
|
603
|
-
default_match_settings: default_match_settings,
|
597
|
+
default_match_settings: default_match_settings.json_data,
|
604
598
|
branch_name: branch_name, parent_branch_name: parent_branch_name,
|
605
599
|
properties: properties
|
606
600
|
|
@@ -7,11 +7,10 @@ require 'applitools/connectivity/proxy'
|
|
7
7
|
require 'applitools/core/match_level'
|
8
8
|
require 'applitools/core/match_level_setter'
|
9
9
|
require 'applitools/connectivity/server_connector'
|
10
|
+
require 'applitools/core/image_match_settings'
|
10
11
|
|
11
12
|
module Applitools
|
12
13
|
class EyesBaseConfiguration < AbstractConfiguration
|
13
|
-
include Applitools::MatchLevelSetter
|
14
|
-
|
15
14
|
DEFAULT_CONFIG = {
|
16
15
|
branch_name: ENV['APPLITOOLS_BRANCH'] || '',
|
17
16
|
parent_branch_name: ENV['APPLITOOLS_PARENT_BRANCH'] || '',
|
@@ -20,10 +19,8 @@ module Applitools
|
|
20
19
|
server_url: ENV['APPLITOOLS_SERVER_URL'] ||
|
21
20
|
ENV['bamboo_APPLITOOLS_SERVER_URL'] || Applitools::Connectivity::ServerConnector::DEFAULT_SERVER_URL,
|
22
21
|
api_key: ENV['APPLITOOLS_API_KEY'] || ENV['bamboo_APPLITOOLS_API_KEY'] || '',
|
23
|
-
|
24
|
-
|
25
|
-
remainder: 0,
|
26
|
-
save_new_tests: true
|
22
|
+
save_new_tests: true,
|
23
|
+
default_match_settings: Applitools::ImageMatchSettings.new
|
27
24
|
}.freeze
|
28
25
|
|
29
26
|
class << self
|
@@ -106,8 +103,9 @@ module Applitools
|
|
106
103
|
string_field :host_os
|
107
104
|
string_field :host_app
|
108
105
|
object_field :proxy, Applitools::Connectivity::Proxy
|
109
|
-
|
110
|
-
object_field :exact,
|
106
|
+
enum_field :match_level, Applitools::MatchLevel.enum_values
|
107
|
+
object_field :exact, Applitools::ImageMatchSettings::Exact
|
108
|
+
object_field :default_match_settings, Applitools::ImageMatchSettings
|
111
109
|
int_field :scale
|
112
110
|
int_field :remainder
|
113
111
|
|
@@ -122,48 +120,38 @@ module Applitools
|
|
122
120
|
self.proxy = Applitools::Connectivity::Proxy.new(uri, user, password)
|
123
121
|
end
|
124
122
|
|
125
|
-
def
|
126
|
-
|
127
|
-
return config_hash[:match_level] = Applitools::MATCH_LEVEL[value.to_sym] if
|
128
|
-
Applitools::MATCH_LEVEL.keys.include?(value.to_sym)
|
129
|
-
raise Applitools::EyesError, "Unknown match level #{value}"
|
123
|
+
def custom_setter_for_exact(value)
|
124
|
+
default_match_settings.exact = value
|
130
125
|
end
|
131
126
|
|
132
|
-
def
|
133
|
-
|
127
|
+
def custom_setter_for_match_level(value)
|
128
|
+
default_match_settings.match_level = value
|
134
129
|
end
|
135
130
|
|
136
|
-
def
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
131
|
+
def custom_setter_for_scale(value)
|
132
|
+
default_match_settings.scale = value
|
133
|
+
end
|
134
|
+
|
135
|
+
def custom_setter_for_remainder(value)
|
136
|
+
default_match_settings.remainder = value
|
137
|
+
end
|
138
|
+
|
139
|
+
def custom_getter_for_exact(_value)
|
140
|
+
default_match_settings.exact
|
141
|
+
end
|
142
|
+
|
143
|
+
def custom_getter_for_scale(_value)
|
144
|
+
default_match_settings.scale
|
149
145
|
end
|
150
146
|
|
151
|
-
def
|
152
|
-
|
153
|
-
match_level: match_level,
|
154
|
-
exact: exact,
|
155
|
-
scale: scale,
|
156
|
-
remainder: remainder
|
157
|
-
}
|
147
|
+
def custom_getter_for_remainder(_value)
|
148
|
+
default_match_settings.remainder
|
158
149
|
end
|
159
150
|
|
160
|
-
def
|
161
|
-
|
151
|
+
def custom_getter_for_match_level(_value)
|
152
|
+
default_match_settings.match_level
|
162
153
|
end
|
163
154
|
|
164
155
|
methods_to_delegate.push(:set_proxy)
|
165
|
-
methods_to_delegate.push(:set_default_match_settings)
|
166
|
-
methods_to_delegate.push(:default_match_settings=)
|
167
|
-
methods_to_delegate.push(:default_match_settings)
|
168
156
|
end
|
169
157
|
end
|
@@ -19,13 +19,17 @@ module Applitools
|
|
19
19
|
def boolean_field(field_name)
|
20
20
|
collect_method field_name
|
21
21
|
define_method(field_name) do
|
22
|
-
return
|
22
|
+
return send("custom_getter_for_#{field_name}", config_hash[field_name.to_sym]) if
|
23
|
+
respond_to?("custom_getter_for_#{field_name}")
|
24
|
+
return true if config_hash[field_name.to_sym]
|
23
25
|
false
|
24
26
|
end
|
25
27
|
|
26
28
|
define_method("#{field_name}=") do |*args|
|
27
29
|
value = args.shift
|
28
|
-
config_hash[field_name] = value ? true : false
|
30
|
+
config_hash[field_name.to_sym] = value ? true : false
|
31
|
+
config_hash[field_name.to_sym] = send("custom_setter_for_#{field_name}", config_hash[field_name.to_sym]) if
|
32
|
+
respond_to?("custom_setter_for_#{field_name}")
|
29
33
|
end
|
30
34
|
|
31
35
|
define_method("defined_#{field_name}?") do
|
@@ -36,6 +40,8 @@ module Applitools
|
|
36
40
|
def string_field(field_name)
|
37
41
|
collect_method field_name
|
38
42
|
define_method(field_name) do
|
43
|
+
return send("custom_getter_for_#{field_name}", config_hash[field_name.to_sym]) if
|
44
|
+
respond_to?("custom_getter_for_#{field_name}")
|
39
45
|
config_hash[field_name.to_sym]
|
40
46
|
end
|
41
47
|
|
@@ -45,6 +51,8 @@ module Applitools
|
|
45
51
|
raise Applitools::EyesIllegalArgument, "Expected #{field_name} to be a String but got #{value.class} instead"
|
46
52
|
end
|
47
53
|
config_hash[field_name.to_sym] = value.freeze
|
54
|
+
config_hash[field_name.to_sym] = send("custom_setter_for_#{field_name}", config_hash[field_name.to_sym]) if
|
55
|
+
respond_to?("custom_setter_for_#{field_name}")
|
48
56
|
end
|
49
57
|
|
50
58
|
define_method("defined_#{field_name}?") do
|
@@ -57,6 +65,8 @@ module Applitools
|
|
57
65
|
def object_field(field_name, klass)
|
58
66
|
collect_method field_name
|
59
67
|
define_method(field_name) do
|
68
|
+
return send("custom_getter_for_#{field_name}", config_hash[field_name.to_sym]) if
|
69
|
+
respond_to?("custom_getter_for_#{field_name}")
|
60
70
|
config_hash[field_name.to_sym]
|
61
71
|
end
|
62
72
|
define_method("#{field_name}=") do |*args|
|
@@ -68,6 +78,8 @@ module Applitools
|
|
68
78
|
)
|
69
79
|
end
|
70
80
|
config_hash[field_name.to_sym] = value
|
81
|
+
config_hash[field_name.to_sym] = send("custom_setter_for_#{field_name}", config_hash[field_name.to_sym]) if
|
82
|
+
respond_to?("custom_setter_for_#{field_name}")
|
71
83
|
end
|
72
84
|
define_method("defined_#{field_name}?") do
|
73
85
|
value = send(field_name)
|
@@ -78,17 +90,17 @@ module Applitools
|
|
78
90
|
def int_field(field_name)
|
79
91
|
collect_method(field_name)
|
80
92
|
define_method(field_name) do
|
93
|
+
return send("custom_getter_for_#{field_name}", config_hash[field_name.to_sym]) if
|
94
|
+
respond_to?("custom_getter_for_#{field_name}")
|
81
95
|
config_hash[field_name.to_sym]
|
82
|
-
# value =
|
83
|
-
# return value if value.is_a? Integer
|
84
|
-
# 0
|
85
96
|
end
|
86
97
|
|
87
98
|
define_method("#{field_name}=") do |*args|
|
88
99
|
value = args.shift
|
89
|
-
|
90
|
-
|
91
|
-
|
100
|
+
raise Applitools::EyesIllegalArgument, "Expected #{field_name} to be an Integer" unless value.respond_to?(:to_i)
|
101
|
+
config_hash[field_name.to_sym] = value.to_i if value.respond_to? :to_i
|
102
|
+
config_hash[field_name.to_sym] = send("custom_setter_for_#{field_name}", config_hash[field_name.to_sym]) if
|
103
|
+
respond_to?("custom_setter_for_#{field_name}")
|
92
104
|
end
|
93
105
|
|
94
106
|
define_method("defined_#{field_name}?") do
|
@@ -101,6 +113,8 @@ module Applitools
|
|
101
113
|
collect_method(field_name)
|
102
114
|
|
103
115
|
define_method(field_name) do
|
116
|
+
return send("custom_getter_for_#{field_name}", config_hash[field_name.to_sym]) if
|
117
|
+
respond_to?("custom_getter_for_#{field_name}")
|
104
118
|
config_hash[field_name.to_sym]
|
105
119
|
end
|
106
120
|
|
@@ -114,6 +128,8 @@ module Applitools
|
|
114
128
|
)
|
115
129
|
end
|
116
130
|
config_hash[field_name.to_sym] = value
|
131
|
+
config_hash[field_name.to_sym] = send("custom_setter_for_#{field_name}", config_hash[field_name.to_sym]) if
|
132
|
+
respond_to?("custom_setter_for_#{field_name}")
|
117
133
|
end
|
118
134
|
|
119
135
|
define_method("defined_#{field_name}?") do
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'jsonable'
|
4
|
+
|
5
|
+
module Applitools
|
6
|
+
class ImageMatchSettings
|
7
|
+
include Applitools::Jsonable
|
8
|
+
include Applitools::MatchLevelSetter
|
9
|
+
json_fields :accessibilityLevel, :MatchLevel, :IgnoreCaret, :IgnoreDisplacements, :Accessibility,
|
10
|
+
:Ignore, :Floating, :Layout, :Strict, :Content, :Exact, :EnablePatterns, :UseDom,
|
11
|
+
:SplitTopHeight, :SplitBottomHeight, :scale, :remainder
|
12
|
+
|
13
|
+
def initialize
|
14
|
+
self.accessibility_level = 'None'
|
15
|
+
self.match_level = Applitools::MatchLevel::STRICT
|
16
|
+
self.split_top_height = 0
|
17
|
+
self.split_bottom_height = 0
|
18
|
+
self.ignore_caret = true
|
19
|
+
self.ignore_displacements = false
|
20
|
+
self.accessibility = []
|
21
|
+
self.ignore = []
|
22
|
+
self.floating = []
|
23
|
+
self.layout = []
|
24
|
+
self.strict = []
|
25
|
+
self.content = []
|
26
|
+
self.exact = Exact.new
|
27
|
+
self.scale = 0
|
28
|
+
self.remainder = 0
|
29
|
+
self.enable_patterns = false
|
30
|
+
self.use_dom = false
|
31
|
+
end
|
32
|
+
|
33
|
+
def set_match_level(value, exact_options = {})
|
34
|
+
(self.match_level, self.exact) = match_level_with_exact(value, exact_options)
|
35
|
+
match_level
|
36
|
+
end
|
37
|
+
|
38
|
+
def deep_dup
|
39
|
+
cloned_value = self.class.new
|
40
|
+
self.class.json_methods.keys.each do |f|
|
41
|
+
new_value = case (v = send(f))
|
42
|
+
when Symbol, FalseClass, TrueClass, Integer, Float
|
43
|
+
v
|
44
|
+
else
|
45
|
+
v.clone
|
46
|
+
end
|
47
|
+
cloned_value.send("#{f}=", new_value)
|
48
|
+
end
|
49
|
+
cloned_value
|
50
|
+
end
|
51
|
+
|
52
|
+
class Exact
|
53
|
+
include Applitools::Jsonable
|
54
|
+
json_fields :MinDiffIntensity, :MinDiffWidth, :MinDiffHeight, :MatchThreshold
|
55
|
+
|
56
|
+
class << self
|
57
|
+
def from_exact_options(options)
|
58
|
+
new.tap do |exact|
|
59
|
+
exact.min_diff_intensity = options['MinDiffIntensity']
|
60
|
+
exact.min_diff_width = options['MinDiffWidth']
|
61
|
+
exact.min_diff_height = options['MinDiffHeight']
|
62
|
+
exact.match_threshold = options['MatchThreshold']
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def initialize
|
68
|
+
self.min_diff_intensity = 0
|
69
|
+
self.min_diff_width = 0
|
70
|
+
self.min_diff_height = 0
|
71
|
+
self.match_threshold = 0
|
72
|
+
end
|
73
|
+
|
74
|
+
def ==(other)
|
75
|
+
min_diff_intensity == other.min_diff_intensity &&
|
76
|
+
min_diff_width == other.min_diff_width &&
|
77
|
+
min_diff_height == other.min_diff_height &&
|
78
|
+
match_threshold == other.match_threshold
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -18,30 +18,6 @@ module Applitools
|
|
18
18
|
'Options' => {
|
19
19
|
'Name' => nil,
|
20
20
|
'UserInputs' => [],
|
21
|
-
'ImageMatchSettings' => {
|
22
|
-
'accessibilityLevel' => 'None',
|
23
|
-
'MatchLevel' => 'Strict',
|
24
|
-
'SplitTopHeight' => 0,
|
25
|
-
'SplitBottomHeight' => 0,
|
26
|
-
'IgnoreCaret' => true,
|
27
|
-
'IgnoreDisplacements' => false,
|
28
|
-
'Accessibility' => [],
|
29
|
-
'Ignore' => [],
|
30
|
-
'Floating' => [],
|
31
|
-
'Layout' => [],
|
32
|
-
'Strict' => [],
|
33
|
-
'Content' => [],
|
34
|
-
'Exact' => {
|
35
|
-
'MinDiffIntensity' => 0,
|
36
|
-
'MinDiffWidth' => 0,
|
37
|
-
'MinDiffHeight' => 0,
|
38
|
-
'MatchThreshold' => 0
|
39
|
-
},
|
40
|
-
'scale' => 0,
|
41
|
-
'remainder' => 0,
|
42
|
-
'EnablePatterns' => false,
|
43
|
-
'UseDom' => false
|
44
|
-
},
|
45
21
|
'IgnoreExpectedOutputSettings' => false,
|
46
22
|
'ForceMatch' => false,
|
47
23
|
'ForceMismatch' => false,
|
@@ -79,9 +55,9 @@ module Applitools
|
|
79
55
|
end
|
80
56
|
end
|
81
57
|
|
82
|
-
attr_accessor :app_output, :user_inputs, :tag, :options, :ignore_mismatch
|
58
|
+
attr_accessor :app_output, :user_inputs, :tag, :options, :ignore_mismatch, :default_image_match_settings
|
83
59
|
|
84
|
-
def initialize
|
60
|
+
def initialize(default_image_match_settings = nil)
|
85
61
|
@app_output = nil
|
86
62
|
@ignored_regions = []
|
87
63
|
@floating_regions = []
|
@@ -91,6 +67,7 @@ module Applitools
|
|
91
67
|
@need_convert_content_regions_coordinates = false
|
92
68
|
@need_convert_layout_regions_coordinates = false
|
93
69
|
@need_convert_accessibility_regions_coordinates = false
|
70
|
+
self.default_image_match_settings = default_image_match_settings.deep_dup || Applitools::ImageMatchSettings.new
|
94
71
|
end
|
95
72
|
|
96
73
|
def screenshot
|
@@ -118,42 +95,43 @@ module Applitools
|
|
118
95
|
def ignored_regions=(value)
|
119
96
|
Applitools::ArgumentGuard.is_a? value, 'value', Array
|
120
97
|
value.each do |r|
|
121
|
-
current_data['Options']['ImageMatchSettings']['Ignore'] << r.to_hash if self.class.valid_region(r)
|
98
|
+
# current_data['Options']['ImageMatchSettings']['Ignore'] << r.to_hash if self.class.valid_region(r)
|
99
|
+
default_image_match_settings.ignore << r.to_hash if self.class.valid_region(r)
|
122
100
|
end
|
123
101
|
end
|
124
102
|
|
125
103
|
def floating_regions=(value)
|
126
104
|
Applitools::ArgumentGuard.is_a? value, 'value', Array
|
127
105
|
value.each do |r|
|
128
|
-
|
106
|
+
default_image_match_settings.floating << r.to_hash
|
129
107
|
end
|
130
108
|
end
|
131
109
|
|
132
110
|
def layout_regions=(value)
|
133
111
|
Applitools::ArgumentGuard.is_a? value, 'value', Array
|
134
112
|
value.each do |r|
|
135
|
-
|
113
|
+
default_image_match_settings.layout << r.to_hash if self.class.valid_region(r)
|
136
114
|
end
|
137
115
|
end
|
138
116
|
|
139
117
|
def strict_regions=(value)
|
140
118
|
Applitools::ArgumentGuard.is_a? value, 'value', Array
|
141
119
|
value.each do |r|
|
142
|
-
|
120
|
+
default_image_match_settings.strict << r.to_hash if self.class.valid_region(r)
|
143
121
|
end
|
144
122
|
end
|
145
123
|
|
146
124
|
def content_regions=(value)
|
147
125
|
Applitools::ArgumentGuard.is_a? value, 'value', Array
|
148
126
|
value.each do |r|
|
149
|
-
|
127
|
+
default_image_match_settings.content << r.to_hash if self.class.valid_region(r)
|
150
128
|
end
|
151
129
|
end
|
152
130
|
|
153
131
|
def accessibility_regions=(value)
|
154
132
|
Applitools::ArgumentGuard.is_a? value, 'value', Array
|
155
133
|
value.each do |r|
|
156
|
-
|
134
|
+
default_image_match_settings.accessibility << r.to_hash if self.class.valid_region(r)
|
157
135
|
end
|
158
136
|
end
|
159
137
|
|
@@ -173,55 +151,55 @@ module Applitools
|
|
173
151
|
end
|
174
152
|
|
175
153
|
def match_level=(value)
|
176
|
-
|
154
|
+
default_image_match_settings.match_level = value
|
177
155
|
end
|
178
156
|
|
179
157
|
def match_level
|
180
|
-
|
158
|
+
default_image_match_settings.match_level
|
181
159
|
end
|
182
160
|
|
183
161
|
def scale=(value)
|
184
|
-
|
162
|
+
default_image_match_settings.scale = value
|
185
163
|
end
|
186
164
|
|
187
165
|
def scale
|
188
|
-
|
166
|
+
default_image_match_settings.scale
|
189
167
|
end
|
190
168
|
|
191
169
|
def remainder=(value)
|
192
|
-
|
170
|
+
default_image_match_settings.remainder = value
|
193
171
|
end
|
194
172
|
|
195
173
|
def remainder
|
196
|
-
|
174
|
+
default_image_match_settings.remainder
|
197
175
|
end
|
198
176
|
|
199
177
|
def exact
|
200
|
-
|
178
|
+
default_image_match_settings.exact
|
201
179
|
end
|
202
180
|
|
203
181
|
def use_dom
|
204
|
-
|
182
|
+
default_image_match_settings.use_dom
|
205
183
|
end
|
206
184
|
|
207
185
|
def use_dom=(value)
|
208
|
-
|
186
|
+
default_image_match_settings.use_dom = value
|
209
187
|
end
|
210
188
|
|
211
189
|
def enable_patterns
|
212
|
-
|
190
|
+
default_image_match_settings.enable_patterns
|
213
191
|
end
|
214
192
|
|
215
193
|
def enable_patterns=(value)
|
216
|
-
|
194
|
+
default_image_match_settings.enable_patterns = value
|
217
195
|
end
|
218
196
|
|
219
197
|
def ignore_displacements
|
220
|
-
|
198
|
+
default_image_match_settings.ignore_displacements
|
221
199
|
end
|
222
200
|
|
223
201
|
def ignore_displacements=(value)
|
224
|
-
|
202
|
+
default_image_match_settings.ignore_displacements = value
|
225
203
|
end
|
226
204
|
|
227
205
|
def render_id
|
@@ -234,13 +212,8 @@ module Applitools
|
|
234
212
|
end
|
235
213
|
|
236
214
|
def exact=(value)
|
237
|
-
|
238
|
-
|
239
|
-
current_value = exact || {}
|
240
|
-
%w(MinDiffIntensity MinDiffWidth MinDiffHeight MatchThreshold).each do |k|
|
241
|
-
current_value[k] = value[k]
|
242
|
-
end
|
243
|
-
current_data['Options']['ImageMatchSettings']['Exact'] = current_value
|
215
|
+
Applitools::ArgumentGuard.is_a?(value, 'value', Applitools::ImageMatchSettings::Exact)
|
216
|
+
default_image_match_settings.exact = value
|
244
217
|
end
|
245
218
|
|
246
219
|
def read_target(target, driver)
|
@@ -348,23 +321,20 @@ module Applitools
|
|
348
321
|
end
|
349
322
|
|
350
323
|
def ignore_caret=(value)
|
351
|
-
|
324
|
+
default_image_match_settings.ignore_caret = value
|
352
325
|
end
|
353
326
|
|
354
327
|
def accessibility_validation
|
355
|
-
|
328
|
+
default_image_match_settings.accessibility_level
|
356
329
|
end
|
357
330
|
|
358
331
|
def accessibility_validation=(value)
|
359
|
-
|
332
|
+
default_image_match_settings.accessibility_level = value
|
360
333
|
end
|
361
334
|
|
362
335
|
def convert_ignored_regions_coordinates
|
363
336
|
return unless @need_convert_ignored_regions_coordinates
|
364
337
|
self.ignored_regions = convert_regions_coordinates(@ignored_regions)
|
365
|
-
# self.ignored_regions = @ignored_regions.map do |r|
|
366
|
-
# self.class.convert_coordinates(r, app_output.screenshot)
|
367
|
-
# end unless app_output.screenshot.nil?
|
368
338
|
@need_convert_ignored_regions_coordinates = false
|
369
339
|
end
|
370
340
|
|
@@ -457,7 +427,9 @@ module Applitools
|
|
457
427
|
'You should convert coordinates for floating_regions!'
|
458
428
|
)
|
459
429
|
end
|
460
|
-
current_data.dup
|
430
|
+
result = current_data.dup
|
431
|
+
result['Options']['ImageMatchSettings'] = default_image_match_settings.json_data
|
432
|
+
result
|
461
433
|
end
|
462
434
|
|
463
435
|
def to_s
|
data/lib/applitools/version.rb
CHANGED
data/lib/eyes_core.rb
CHANGED
@@ -64,8 +64,8 @@ require_relative 'applitools/extensions'
|
|
64
64
|
require_relative 'applitools/version'
|
65
65
|
require_relative 'applitools/chunky_png_patch'
|
66
66
|
|
67
|
+
Applitools.require_dir 'utils'
|
67
68
|
Applitools.require_dir 'core'
|
68
69
|
Applitools.require_dir 'connectivity'
|
69
|
-
Applitools.require_dir 'utils'
|
70
70
|
|
71
71
|
require_relative 'applitools/eyes_logger'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eyes_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.16.
|
4
|
+
version: 3.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Applitools Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oily_png
|
@@ -282,6 +282,7 @@ files:
|
|
282
282
|
- lib/applitools/core/future.rb
|
283
283
|
- lib/applitools/core/hash_extension.rb
|
284
284
|
- lib/applitools/core/helpers.rb
|
285
|
+
- lib/applitools/core/image_match_settings.rb
|
285
286
|
- lib/applitools/core/jsonable.rb
|
286
287
|
- lib/applitools/core/location.rb
|
287
288
|
- lib/applitools/core/match_level.rb
|