lib/capybara/screenshot/diff/stabilization.rb in capybara-screenshot-diff-1.1.0 vs lib/capybara/screenshot/diff/stabilization.rb in capybara-screenshot-diff-1.2.0
- old
+ new
@@ -19,18 +19,18 @@
return false;
}()
JS
def take_stable_screenshot(comparison, color_distance_limit:, shift_distance_limit:,
- area_size_limit:, skip_area:)
+ area_size_limit:, skip_area:, stability_time_limit:)
blurred_input = prepare_page_for_screenshot
previous_file_name = comparison.old_file_name
screenshot_started_at = last_image_change_at = Time.now
1.step do |i|
take_right_size_screenshot(comparison)
- break unless Capybara::Screenshot.stability_time_limit
+ break unless stability_time_limit
if comparison.quick_equal?
clean_stabilization_images(comparison.new_file_name)
break
end
@@ -40,10 +40,10 @@
stabilization_comparison =
ImageCompare.new(comparison.new_file_name, previous_file_name,
color_distance_limit: color_distance_limit, shift_distance_limit: shift_distance_limit,
area_size_limit: area_size_limit, skip_area: skip_area)
if stabilization_comparison.quick_equal?
- if (Time.now - last_image_change_at) > Capybara::Screenshot.stability_time_limit
+ if (Time.now - last_image_change_at) > stability_time_limit
clean_stabilization_images(comparison.new_file_name)
break
end
next
else