Skipped tests will have fail status if suite teardown fails
See original GitHub issueRobot Framework 4.0.3 (Python 3.6.8 on win32)
*** Settings ***
Documentation ...
Library SeleniumLibrary
Suite Setup Suite Setup
Suite Teardown Suite Teardown
Force Tags example noncritical
*** Variables ***
*** Test cases ***
Test Cases
Wait Until Page Contains Element css:img[alt="Google"]
Page Should Contain Element css:img[alt="Gogle"] #non correct selector intentionally
*** Keywords ***
Suite Setup
Open Browser https://google.com chrome
Suite Teardown
No existed keyword #non correct keywordintentionally
Close All Browsers
command line: robot --skiponfailure noncritical example.robot
Expected result some thing like this:
Really:
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Test Suite TearDown Scenario - Google Groups
If the suite teardown fails, all test cases in the suite are marked failed, regardless of their original execution status. I dont see...
Read more >Suite Teardown stop on keyword error - Robot Framework
Hello, I'm facing an issue on Suite Teardown. ... But I just discover than, in case of keyword issue (not a test failure)...
Read more >robot framework stop teardown execution in failure
I use teardown in my test. It works as expected, if my test ends or fails, teardown starts the execution. My problem starts...
Read more >Test Fixtures and Test Listeners (Test Hooks) - Katalon Docs
Tear Down If Passed, This method is called after executing all steps of the test case, if all of those steps are marked...
Read more >std/unittest - Nim Programming Language
Tests can be nested, however failure of a nested test will not mark the parent test as failed. Setup and teardown are inherited....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Failing suite teardowns are such a special case that I don’t think handling them differently than now is worth the effort. Most importantly, it would be hard to come up with mechanism that would leave tests passed but would make it explicit for users that there is a problem to be fixed. Anyway, discussing about that doesn’t belong to this issue. If you think that behavior should be changed, submit a new issue or start discussion on our Slack.
If we’d leave tests passed after suite teardown failure, there would be no indication in report about that failure. This could mean that serious problems aren’t detected. We obviously could enhance report so that suite teardown failure is reported separately, but I don’t thing that’s worth the effort and all tests passing could nevertheless mean that the problem is ignored. For wider discussion see #2135.
As discussed in the aforementioned issue, you can wrap the teardown keyword with “Run Keyword And Ignore Error” or with “Run Keyword And Warn On Failure”. The latter was actually added partly with this use case in mind (#2294).