1
votes

I am trying to get a work around for the 'Teardown Suite' failing all tests in the suite on fail. I would like to run Teardown with the following code:

Run Keyword and Ignore Error  |  My Teardown

Ideally, the Teardown test case should only be visible once - and not in every single test suite. It should just be a single failed test case in the suite.

The output is integrated with Jenkins and it would be nice to see only singular failures to not skew results with a heap of tests failed by the unstable suite teardown.

I have been looking thought the Robot Results Package but have not made much head way.

2

2 Answers

2
votes

There is definitely workaround for your first part of the question, ignoring errors.

You can go a level deeper to get it done:

Suite Teardown   TeardownFunction

*** Keywords ***
TeardownFunction
    Run Keyword and Ignore Error   My Teardown

By this even if your tear down fails your tests will never be marked as tear down failed..

Regarding the 2nd part of the question, Since it is executed once before every suite the behavior of the tear down might well be different in each case (even though code is same) so it always good to have logs for every execution.

Just a thought though!

0
votes

Another option could be to use "Run Keyword And Continue On Failure". This way you can see the failure of your test based on the Teardown failing, but it will still allow you to continue to the next test. Run Keyword And Continue On Failure | MY Teardown

I would always suggest checking the built in page: http://robotframework.org/robotframework/latest/libraries/BuiltIn.html