eyes_core 3.16.1 → 3.16.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0613722ca2baf28172990b0e9dad28e60506110fc8d0c3447be31a07df1a95b8
4
- data.tar.gz: 4b584d7e1fffdde21233ec56a7e6cb690c59debcf0ee07a85b377fa5887b50df
3
+ metadata.gz: 72c04d816c39ee12a767a8fa6e0511f759d67bd5eeaeb81259bf4cafcbbf75db
4
+ data.tar.gz: a95cf25bf88d074a1f4a929d1a65ff2a695d0f471115ebc5d4b7f6a30c5b1d72
5
5
  SHA512:
6
- metadata.gz: 80ebd10fb88cc9fe08d6c222124df8e300b9dbf2ab718ce88bc009df49a8a9215357adb93dba801c1adf84974c934f29549f238fb1d8b2febad9f7b8c4c09c5c
7
- data.tar.gz: 2f1e3d1fcd9b14d47bbf8f21578389227e6ae6ca2b29dfb458fd561301d93b1e5053a56cceaa46d812da945c615c7aaa79253e7dc623932158ce65cd396a71cc
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
- match_level: Applitools::MatchLevel::STRICT,
24
- scale: 0,
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
- string_field :match_level
110
- object_field :exact, Hash
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 match_level=(value)
126
- return config_hash[:match_level] = value if Applitools::MatchLevel.enum_values.include?(value)
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 set_default_match_settings(value, exact_options = {})
133
- (self.match_level, self.exact) = match_level_with_exact(value, exact_options)
127
+ def custom_setter_for_match_level(value)
128
+ default_match_settings.match_level = value
134
129
  end
135
130
 
136
- def default_match_settings=(value)
137
- Applitools::ArgumentGuard.is_a? value, 'value', Hash
138
- extra_keys = value.keys - match_level_keys
139
- unless extra_keys.empty?
140
- raise Applitools::EyesIllegalArgument.new(
141
- "Pasiing extra keys is prohibited! Passed extra keys: #{extra_keys}"
142
- )
143
- end
144
- result = default_match_settings.merge!(value)
145
- (self.match_level, self.exact) = match_level_with_exact(result[:match_level], result[:exact])
146
- self.scale = result[:scale]
147
- self.remainder = result[:remainder]
148
- result
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 default_match_settings
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 match_level_keys
161
- %w(match_level exact scale remainder).map(&:to_sym)
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 true if config_hash[field_name]
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
- return config_hash[field_name.to_sym] = value if value.is_a? Integer
90
- return config_hash[field_name.to_sym] = value.to_i if value.respond_to? :to_i
91
- raise Applitools::EyesIllegalArgument, "Expected #{field_name} to be an Integer"
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
@@ -49,6 +49,6 @@ module Applitools::MatchLevelSetter
49
49
  allowed_keys.each do |k|
50
50
  result[EXACT_KEYS[k]] = options[k] unless options[k].nil?
51
51
  end
52
- result
52
+ Applitools::ImageMatchSettings::Exact.from_exact_options(result)
53
53
  end
54
54
  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
- current_data['Options']['ImageMatchSettings']['Floating'] << r.to_hash
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
- current_data['Options']['ImageMatchSettings']['Layout'] << r.to_hash if self.class.valid_region(r)
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
- current_data['Options']['ImageMatchSettings']['Strict'] << r.to_hash if self.class.valid_region(r)
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
- current_data['Options']['ImageMatchSettings']['Content'] << r.to_hash if self.class.valid_region(r)
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
- current_data['Options']['ImageMatchSettings']['Accessibility'] << r.to_hash if self.class.valid_region(r)
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
- current_data['Options']['ImageMatchSettings']['MatchLevel'] = value
154
+ default_image_match_settings.match_level = value
177
155
  end
178
156
 
179
157
  def match_level
180
- current_data['Options']['ImageMatchSettings']['MatchLevel']
158
+ default_image_match_settings.match_level
181
159
  end
182
160
 
183
161
  def scale=(value)
184
- current_data['Options']['ImageMatchSettings']['scale'] = value
162
+ default_image_match_settings.scale = value
185
163
  end
186
164
 
187
165
  def scale
188
- current_data['Options']['ImageMatchSettings']['scale']
166
+ default_image_match_settings.scale
189
167
  end
190
168
 
191
169
  def remainder=(value)
192
- current_data['Options']['ImageMatchSettings']['remainder'] = value
170
+ default_image_match_settings.remainder = value
193
171
  end
194
172
 
195
173
  def remainder
196
- current_data['Options']['ImageMatchSettings']['remainder']
174
+ default_image_match_settings.remainder
197
175
  end
198
176
 
199
177
  def exact
200
- current_data['Options']['ImageMatchSettings']['Exact']
178
+ default_image_match_settings.exact
201
179
  end
202
180
 
203
181
  def use_dom
204
- current_data['Options']['ImageMatchSettings']['UseDom']
182
+ default_image_match_settings.use_dom
205
183
  end
206
184
 
207
185
  def use_dom=(value)
208
- current_data['Options']['ImageMatchSettings']['UseDom'] = value
186
+ default_image_match_settings.use_dom = value
209
187
  end
210
188
 
211
189
  def enable_patterns
212
- current_data['Options']['ImageMatchSettings']['EnablePatterns']
190
+ default_image_match_settings.enable_patterns
213
191
  end
214
192
 
215
193
  def enable_patterns=(value)
216
- current_data['Options']['ImageMatchSettings']['EnablePatterns'] = value
194
+ default_image_match_settings.enable_patterns = value
217
195
  end
218
196
 
219
197
  def ignore_displacements
220
- current_data['Options']['ImageMatchSettings']['IgnoreDisplacements']
198
+ default_image_match_settings.ignore_displacements
221
199
  end
222
200
 
223
201
  def ignore_displacements=(value)
224
- current_data['Options']['ImageMatchSettings']['IgnoreDisplacements'] = value
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
- raise Applitools::EyesError.new('You should pass a hash as a value!') unless value.nil? || value.is_a?(Hash)
238
- return current_data['Options']['ImageMatchSettings']['Exact'] = nil if value.nil?
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
- current_data['Options']['ImageMatchSettings']['IgnoreCaret'] = value
324
+ default_image_match_settings.ignore_caret = value
352
325
  end
353
326
 
354
327
  def accessibility_validation
355
- current_data['Options']['ImageMatchSettings']['AccessibilityLevel']
328
+ default_image_match_settings.accessibility_level
356
329
  end
357
330
 
358
331
  def accessibility_validation=(value)
359
- current_data['Options']['ImageMatchSettings']['AccessibilityLevel'] = value
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Applitools
2
4
  class RenderingInfo
3
5
  attr_accessor :response
@@ -23,4 +25,4 @@ module Applitools
23
25
  response['accessToken']
24
26
  end
25
27
  end
26
- end
28
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Applitools
4
- VERSION = '3.16.1'.freeze
4
+ VERSION = '3.16.2'.freeze
5
5
  end
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.1
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-01-29 00:00:00.000000000 Z
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