Module: CapybaraScreenshotDiff::Minitest::Assertions
- Includes:
- DSL
- Defined in:
- lib/capybara_screenshot_diff/minitest.rb
Instance Attribute Summary
#test_screenshots
Class Method Summary
collapse
Instance Method Summary
collapse
#assert_image_not_changed, #build_full_name, #group_parts, #initialize, #schedule_match_job, #screenshot_dir, #screenshot_group, #screenshot_section, #verify_screenshots!
Class Method Details
.included(klass) ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/capybara_screenshot_diff/minitest.rb', line 30
def self.included(klass)
klass.setup do
if ::Capybara::Screenshot.window_size
::Capybara::Screenshot::BrowserHelpers.resize_to(::Capybara::Screenshot.window_size)
end
end
klass.teardown do
errors = verify_screenshots!(@test_screenshots)
if errors.present?
assertion = ::Minitest::Assertion.new(errors.join("\n\n"))
assertion.set_backtrace []
failures << assertion
end
end
end
|
Instance Method Details
#screenshot(*args, skip_stack_frames: 0, **opts) ⇒ Object
Also known as:
assert_matches_screenshot
22
23
24
25
26
|
# File 'lib/capybara_screenshot_diff/minitest.rb', line 22
def screenshot(*args, skip_stack_frames: 0, **opts)
assert_nothing_raised do
super(*args, skip_stack_frames: skip_stack_frames + 3, **opts)
end
end
|