9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/capybara-screenshot/minitest.rb', line 9
def before_teardown
super
if self.class.ancestors.map(&:to_s).include?('Capybara::DSL')
if Capybara::Screenshot.autosave_on_failure && !passed? && !skipped?
Capybara.using_session(Capybara::Screenshot.final_session_name) do
filename_prefix = Capybara::Screenshot.filename_prefix_for(:minitest, self)
saver = Capybara::Screenshot.new_saver(Capybara, Capybara.page, true, filename_prefix)
saver.save
saver.output_screenshot_path
end
end
end
end
|