Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/capybara_screenshot_diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ module Capybara
module Screenshot
mattr_accessor :add_driver_path
mattr_accessor :add_os_path
mattr_accessor :blur_active_element
mattr_accessor(:blur_active_element) { true }
mattr_accessor :enabled
mattr_accessor :hide_caret
mattr_accessor(:hide_caret) { true }
mattr_reader(:root) { (defined?(Rails) && defined?(Rails.root) && Rails.root) || Pathname(".").expand_path }
mattr_accessor :stability_time_limit
mattr_accessor :window_size
Expand Down
8 changes: 7 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,19 @@ class ActiveSupport::TestCase
self.file_fixture_path = Pathname.new(File.expand_path("fixtures", __dir__))

setup do
# Tests create new screenshots — don't fail on missing baselines
@_orig_fail_if_new = Capybara::Screenshot::Diff.fail_if_new
@_orig_blur = Capybara::Screenshot.blur_active_element
@_orig_hide_caret = Capybara::Screenshot.hide_caret

Capybara::Screenshot::Diff.fail_if_new = false
Capybara::Screenshot.blur_active_element = false
Capybara::Screenshot.hide_caret = false
end

teardown do
Capybara::Screenshot::Diff.fail_if_new = @_orig_fail_if_new
Capybara::Screenshot.blur_active_element = @_orig_blur
Capybara::Screenshot.hide_caret = @_orig_hide_caret
CapybaraScreenshotDiff::SnapManager.cleanup! unless persist_comparisons?
end

Expand Down
Loading