I use Bahave
and there is a next condition for after_scenario
in environment.py
def after_scenario(context, scenario):
if scenario.status == "failed":
time_now = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
context.browser.save_screenshot("failed_scenarios_screenshots/%s_%s_failed.png" % (scenario.name, time_now))
How can I add a made screenshot into json or html report?