From bb1a74370ab0fd4047b74470fa679241ebf71307 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Fri, 27 Dec 2024 14:09:38 +0300 Subject: [PATCH] Fix remove ALL reporting for WUKS, add test --- robotframework_reportportal/listener.py | 5 ++++- tests/integration/test_remove_keywords.py | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/robotframework_reportportal/listener.py b/robotframework_reportportal/listener.py index 358cc87..c9e539f 100644 --- a/robotframework_reportportal/listener.py +++ b/robotframework_reportportal/listener.py @@ -252,7 +252,10 @@ def _log_message(self, message: LogMessage) -> None: current_item = self.current_item if current_item and not getattr(current_item, "posted", True) and message.level not in ["ERROR", "WARN"]: self.current_item.skipped_logs.append(message) - elif getattr(current_item, "matched_filter", None) is not WKUS_KEYWORD_MATCH: + elif ( + getattr(current_item, "matched_filter", None) is not WKUS_KEYWORD_MATCH + and not self._remove_keyword_content + ): # Post everything skipped by '--removekeywords' option self._post_skipped_keywords(current_item) self.__post_log_message(message) diff --git a/tests/integration/test_remove_keywords.py b/tests/integration/test_remove_keywords.py index 23a454c..892746a 100644 --- a/tests/integration/test_remove_keywords.py +++ b/tests/integration/test_remove_keywords.py @@ -77,6 +77,24 @@ 0, "Content removed using the --remove-keywords option.", ), + ( + "examples/wuks_keyword.robot", + "ALL", + 0, + ["PASSED"] * 3, + 1, + 0, + "Content removed using the --remove-keywords option.", + ), + ( + "examples/wuks_keyword_failed.robot", + "ALL", + 1, + ["FAILED"] * 3, + 1, + 0, + "Content removed using the --remove-keywords option.", + ), ], ) @mock.patch(REPORT_PORTAL_SERVICE)