lib/capybara/screenshot/diff/test_methods.rb in capybara-screenshot-diff-1.1.0 vs lib/capybara/screenshot/diff/test_methods.rb in capybara-screenshot-diff-1.2.0
- old
+ new
@@ -66,13 +66,14 @@
FileUtils.rm_rf screenshot_dir
end
# @return [Boolean] wether a screenshot was taken
- def screenshot(name, color_distance_limit: Diff.color_distance_limit,
- shift_distance_limit: Diff.shift_distance_limit, area_size_limit: Diff.area_size_limit,
- skip_area: Diff.skip_area)
+ def screenshot(name, area_size_limit: Diff.area_size_limit,
+ color_distance_limit: Diff.color_distance_limit,
+ shift_distance_limit: Diff.shift_distance_limit, skip_area: Diff.skip_area,
+ stability_time_limit: Screenshot.stability_time_limit)
return unless Screenshot.active?
return if window_size_is_wrong?
skip_area = skip_area&.flatten&.each_cons(4)&.to_a # Allow nil or single or multiple areas
@@ -90,10 +91,11 @@
skip_area: skip_area)
checkout_vcs(name, comparison)
take_stable_screenshot(comparison, color_distance_limit: color_distance_limit,
shift_distance_limit: shift_distance_limit,
area_size_limit: area_size_limit,
- skip_area: skip_area)
+ skip_area: skip_area,
+ stability_time_limit: stability_time_limit)
return unless comparison.old_file_exists?
(@test_screenshots ||= []) << [caller(1..1).first, name, comparison]
true
end