From 78fc95fb34a88b24aa7d82a66b5bf1437bc6b227 Mon Sep 17 00:00:00 2001 From: Sergey Khomutinin <31664571+skhomuti@users.noreply.github.com> Date: Thu, 15 Sep 2022 20:43:37 +0500 Subject: [PATCH] fix robot step status on not executed steps (fixes #678, via #687) --- allure-robotframework/examples/status/status.rst | 4 ++++ allure-robotframework/src/listener/types.py | 2 ++ allure-robotframework/src/listener/utils.py | 2 +- allure-robotframework/test/status/status.robot | 7 +++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/allure-robotframework/examples/status/status.rst b/allure-robotframework/examples/status/status.rst index 1d4b4db1..416446dc 100644 --- a/allure-robotframework/examples/status/status.rst +++ b/allure-robotframework/examples/status/status.rst @@ -15,3 +15,7 @@ Failed Test Case With Python Traceback Set Log Level DEBUG Fail With Traceback Fail message + + Failed Test Case With Not Executed Step + Fail + Log This step should be skipped diff --git a/allure-robotframework/src/listener/types.py b/allure-robotframework/src/listener/types.py index 716783e7..d8719712 100644 --- a/allure-robotframework/src/listener/types.py +++ b/allure-robotframework/src/listener/types.py @@ -2,6 +2,8 @@ class RobotStatus(object): FAILED = 'FAIL' PASSED = 'PASS' SKIPPED = 'SKIP' + NOT_RUN = 'NOT RUN' + NOT_SET = 'NOT SET' class RobotKeywordType(object): diff --git a/allure-robotframework/src/listener/utils.py b/allure-robotframework/src/listener/utils.py index 8060de07..52dfb824 100644 --- a/allure-robotframework/src/listener/utils.py +++ b/allure-robotframework/src/listener/utils.py @@ -9,7 +9,7 @@ def get_allure_status(status): if status == RobotStatus.PASSED: return Status.PASSED - elif status == RobotStatus.SKIPPED: + elif status in (RobotStatus.SKIPPED, RobotStatus.NOT_RUN, RobotStatus.NOT_SET): return Status.SKIPPED else: return Status.FAILED diff --git a/allure-robotframework/test/status/status.robot b/allure-robotframework/test/status/status.robot index 92db0ef1..273a8d9d 100644 --- a/allure-robotframework/test/status/status.robot +++ b/allure-robotframework/test/status/status.robot @@ -28,3 +28,10 @@ Failed Test Case With Python Traceback Should Has Status Detail With Traceback ${test_case} fail_with_traceback\n${SPACE * 4}BuiltIn().fail(traceback_message) ${step} Should Has Step ${test_case} status_library.Fail With Traceback Should Has Status ${step} failed + +Failed Test Case With Not Executed Step + ${allure_report} Run Robot With Allure examples/status/status.rst + ${test_case} Should Has Test Case ${allure_report} Failed Test Case With Not Executed Step + Should Has Status ${test_case} failed + ${step} Should Has Step ${test_case} BuiltIn.Log + Should Has Status ${step} skipped