def after_all(context):
    session.clear_cookies_if_required(session.Stage.lifetime, context)
    # Very last thing to run.
    context.browser.quit()
def after_scenario(context, scenario):
    session.clear_cookies_if_required(session.Stage.scenario, context)
    # Runs after each scenario
    if scenario.status == "failed":
        screenshot.capture_failure(context, scenario)
def after_feature(context, feature):
    session.clear_cookies_if_required(session.Stage.feature, context)
    # Runs after each feature
    pass
def after_step(context, step):
    session.clear_cookies_if_required(session.Stage.step, context)
    # Runs after each step.
    if step.status == "failed":
        print("step failed")