From 0d559410fccbc6dff704346b39be884e2832ab0f Mon Sep 17 00:00:00 2001 From: Joel Whitney Date: Mon, 7 Feb 2022 15:07:54 -0500 Subject: [PATCH 1/2] use error message for status details for other statuses --- allure-behave/src/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/allure-behave/src/utils.py b/allure-behave/src/utils.py index 8b129a87..3e5e774c 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 == '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)] From 1e99822a50b36c17227ede5ed5937ff33a2fe4ba Mon Sep 17 00:00:00 2001 From: Joel Whitney Date: Mon, 7 Feb 2022 15:11:10 -0500 Subject: [PATCH 2/2] use step_status --- allure-behave/src/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/allure-behave/src/utils.py b/allure-behave/src/utils.py index 3e5e774c..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.exception or step.error_message or step.status == 'undefined': + if step.exception or step.error_message or step_status(step) == 'undefined': return step_status_details(step)