From 3719ed948d376b4b1b23d1d6b0ac75c188ce1acb Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Thu, 9 Jan 2025 12:09:40 +0300 Subject: [PATCH] Add more tests --- examples/rkie_keyword_error.robot | 19 ++++++++++++ tests/integration/test_remove_keywords.py | 36 +++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 examples/rkie_keyword_error.robot diff --git a/examples/rkie_keyword_error.robot b/examples/rkie_keyword_error.robot new file mode 100644 index 0000000..ba673a4 --- /dev/null +++ b/examples/rkie_keyword_error.robot @@ -0,0 +1,19 @@ +*** Settings *** +Documentation Example of 'Run Keyword And Ignore Error' keyword reporting + +*** Variables *** +${countval} 0 + +*** Test Cases *** +Rkie test + Run Keyword And Ignore Error Fail on first try + Fail on first try + +*** Keywords *** +Fail on first try + ${counter} Evaluate ${countval} + 1 + Set Suite Variable ${countval} ${counter} + IF ${countval} < 2 + Log To less executions error ERROR + Fail To less executions + END diff --git a/tests/integration/test_remove_keywords.py b/tests/integration/test_remove_keywords.py index 62ab6e0..6191da2 100644 --- a/tests/integration/test_remove_keywords.py +++ b/tests/integration/test_remove_keywords.py @@ -257,6 +257,15 @@ def test_remove_keyword_not_provided(mock_client_init): 0, "Content removed using the --remove-keywords option.", ), + ( + "examples/binary_file_log_as_image.robot", + "tag:bin*", + 0, + ["PASSED"] * 3, + 1, + 0, + "Content removed using the --remove-keywords option.", + ), ( "examples/binary_file_log_as_text.robot", "tag:binary", @@ -266,6 +275,33 @@ def test_remove_keyword_not_provided(mock_client_init): 2, 'Binary data of type "image/jpeg" logging skipped, as it was processed as text and hence corrupted.', ), + ( + "examples/rkie_keyword.robot", + "name: BuiltIn.Run Keyword And Ignore Error", + 0, + ["PASSED"] * 3 + ["SKIPPED"] * 2 + ["PASSED"] * 3, + 3, + 0, + "Content removed using the --remove-keywords option.", + ), + ( + "examples/rkie_keyword.robot", + "name: *.Run Keyword And Ignore Error", + 0, + ["PASSED"] * 3 + ["SKIPPED"] * 2 + ["PASSED"] * 3, + 3, + 0, + "Content removed using the --remove-keywords option.", + ), + ( + "examples/rkie_keyword_error.robot", + "name: BuiltIn.Run Keyword And Ignore Error", + 0, + ["PASSED"] * 3 + ["FAILED"] * 3 + ["PASSED"] * 3 + ["SKIPPED"] * 3 + ["PASSED"] * 3, + 6, + 2, + "To less executions error", + ), ], ) @mock.patch(REPORT_PORTAL_SERVICE)