Module: CapybaraInlineScreenshot::Rspec

Extended by:
Capybara::Screenshot::RSpec::BaseReporter
Defined in:
lib/capybara-inline-screenshot/rspec.rb

Instance Method Summary collapse

Instance Method Details

#example_failed_with_screenshot(notification) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/capybara-inline-screenshot/rspec.rb', line 10

def example_failed_with_screenshot(notification)
  example_failed_without_screenshot(notification)

  if screenshot = notification.example.[:screenshot]
    output.puts CapybaraScreenshot::Helpers.yellow("HTML screenshot: file://#{screenshot[:html]}") if screenshot[:html]
    output.puts CapybaraScreenshot::Helpers.yellow("Image screenshot: file://#{screenshot[:image]}") if screenshot[:image]
    output.puts CapybaraInlineScreenshot.escape_code_for_image(screenshot[:image]) if screenshot[:image]
  end
end