mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
16 lines
556 B
Ruby
16 lines
556 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.configure do |config|
|
|
config.after(:each, type: :feature) do
|
|
example_filename = RSpec.current_example.full_description
|
|
example_filename = example_filename.tr(' ', '_')
|
|
example_filename += '.html'
|
|
example_filename = File.expand_path(example_filename, Capybara.save_path)
|
|
if RSpec.current_example.exception.present?
|
|
save_page(example_filename)
|
|
# remove the file if the test starts working again
|
|
elsif File.exist?(example_filename)
|
|
File.unlink(example_filename)
|
|
end
|
|
end
|
|
end
|