117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
# File 'lib/applitools/universal_sdk/universal_check_settings.rb', line 117
def from_original_target(target, eyes)
return from_eyes_images(target, eyes) if eyes.class.name === 'Applitools::Images::Eyes'
self.accessibility_settings = eyes.accessibility_validation
self.disable_browser_fetching = eyes.dont_fetch_resources
self.screenshot_mode = eyes.screenshot_mode
self.accessibility_regions = target.accessibility_regions
self.content_regions = target.content_regions
self.floating_regions = target.floating_regions
if target.respond_to?(:frames)
self.frames = target.frames.map do |f|
f = f.call(eyes.driver) if f.is_a?(Proc)
normalize_element_selector(f)
end
end
self.fully = target.options[:stitch_content]
self.hooks = target.options[:script_hooks]
self.ignore_regions = target.ignored_regions.map do |ir|
ir.is_a?(Proc) ? normalize_element_selector(ir.call(eyes.driver)) : ir
end
self.layout_regions = target.layout_regions.map do |lr|
lr.is_a?(Proc) ? normalize_element_selector(lr.call(eyes.driver)) : lr
end
if target.region_to_check.is_a?(Hash)
self.region = target.region_to_check
elsif target.region_to_check.is_a?(String)
self.region = target.region_to_check
elsif target.region_to_check.is_a?(Proc)
el = target.region_to_check.call(eyes.driver)
self.region = normalize_element_selector(el) unless el.respond_to?(:empty?) && el.empty?
end
self.strict_regions = target.strict_regions
self.timeout = target.options[:timeout]
self.variation_group_id = target.options[:variation_group_id]
self.wait_before_capture = target.options[:wait_before_capture]
self.lazy_load = target.options[:lazy_load]
self.webview = target.options[:webview]
self.page_id = target.options[:page_id]
self.scroll_root_element = target.options[:scroll_root_element] || eyes.scroll_root_element
self.layout_breakpoints = target.options[:layout_breakpoints] || eyes.layout_breakpoints
self.exact = (target.options[:exact] && target.options[:exact].to_hash) || (eyes.exact && eyes.exact.to_hash)
self.enable_patterns = from_target_options_or_eyes(:enable_patterns, target.options, eyes)
self.ignore_caret = from_target_options_or_eyes(:ignore_caret, target.options, eyes)
self.ignore_displacements = from_target_options_or_eyes(:ignore_displacements, target.options, eyes)
self.match_level = from_target_options_or_eyes(:match_level, target.options, eyes)
self.send_dom = from_target_options_or_eyes(:send_dom, target.options, eyes)
self.use_dom = from_target_options_or_eyes(:use_dom, target.options, eyes)
self.visual_grid_options = from_target_options_or_eyes(:visual_grid_options, target.options, eyes)
self.ufg_options = self.visual_grid_options
self.user_command_id = self.variation_group_id
self.image = target.image if target.respond_to?(:image)
end
|