diff --git a/allure-behave/src/utils.py b/allure-behave/src/utils.py index 8b129a87..956c84f3 100644 --- a/allure-behave/src/utils.py +++ b/allure-behave/src/utils.py @@ -64,7 +64,7 @@ def scenario_status(scenario): def scenario_status_details(scenario): for step in scenario.all_steps: - if step_status(step) != 'passed': + if step.exception or step.error_message or step_status(step) == 'undefined': return step_status_details(step) @@ -120,11 +120,14 @@ def step_status_details(result): result.exc_traceback) return StatusDetails(message=format_exception(type(result.exception), result.exception), trace=trace) - elif result.status == 'undefined': + if result.status == 'undefined': message = '\nYou can implement step definitions for undefined steps with these snippets:\n\n' message += make_undefined_step_snippet(result) return StatusDetails(message=message) + if result.error_message: + return StatusDetails(message=result.error_message) + def step_table(step): table = [','.join(step.table.headings)]