Method: Minitest::Reporters::ScreenshotReporter#record

Defined in:
lib/minitest/reporters/screenshot_reporter.rb

#record(test) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/minitest/reporters/screenshot_reporter.rb', line 15

def record(test)
  super
  if test.failure
    test_name = "#{test.class.name}-#{test.name}"
    screenshot_name = test.error? ? "ERROR-#{test_name}.png" : "FAILURE-#{test_name}.png"
    save_screenshot File.join('test/screenshots', "#{self.class.count}-#{screenshot_name}")
    self.class.count += 1
  end
end