lib/capybara/screenshot/diff/stabilization.rb in capybara-screenshot-diff-0.12.2 vs lib/capybara/screenshot/diff/stabilization.rb in capybara-screenshot-diff-0.13.0
- old
+ new
@@ -18,11 +18,11 @@
}()
JS
def take_stable_screenshot(comparison, color_distance_limit:, shift_distance_limit:,
area_size_limit:)
- input = prepare_page_for_screenshot
+ blurred_input = prepare_page_for_screenshot
previous_file_name = comparison.old_file_name
screenshot_started_at = last_image_change_at = Time.now
loop.with_index do |_x, i|
take_right_size_screenshot(comparison)
@@ -55,11 +55,11 @@
previous_file_name = "#{comparison.new_file_name.chomp('.png')}_x#{format('%02i', i)}.png~"
FileUtils.mv comparison.new_file_name, previous_file_name
end
ensure
- input.click if input
+ blurred_input.click if blurred_input
end
private
def reduce_retina_image_size(file_name)
@@ -96,12 +96,15 @@
ae.blur();
return ae;
}
return null;
JS
- input = page.driver.send :unwrap_script_result, active_element
+ blurred_input = page.driver.send :unwrap_script_result, active_element
end
- input
+ if Capybara::Screenshot.hide_caret
+ execute_script("$('*').css('caret-color','transparent !important')")
+ end
+ blurred_input
end
def take_right_size_screenshot(comparison)
save_screenshot(comparison.new_file_name)