In my automated tests using Ruby / Capybara / Cucumber / Selenium, it is necessary that when some step of my test fails, the following steps will be performed: - Take a browser screenshot - Image of Stacktrace Taking Out - Perform the next scenario.
Know how to help me with this question?
Today the system takes a screenshot as evidence of the success of the scenario, but now I would like to take a failure screenshot without disturbing the execution of all my tests, following the execution of the next step or scenario.
Example code currently used as a hook for take screenshot:
After do | scenario |
screenshot = "log / screenshots / # {scenario.name} .png"
page.save_screenshot (screenshot)
embed (screenshot, 'image / png', 'Screen_Evidence')
end