Robot Framework considers a test case with test template a single test
case even if it would contain multiple steps. Thus the teardown is
executed only after the whole test case is executed. This is intended
and in my opinion very useful behavior, and has worked the same way
since test template functionality was introduced in RF 2.5.
There is, however, separate keyword teardown functionality that was
introduced in RF 2.6 and works great in this case. I have modified the
example you sent in a separate mail to use both test and keyword
teardowns:
*** Test Cases ***
DD
[Template] DD
1
2
3
[Teardown] log THIS IS TEST TEARDOWN WARN
*** Keywords ***
DD
[Arguments] ${arg}
Run Keyword If ${arg} == 2 FAIL THIS TEST FAILS
LOG This test didn't fail INFO
[Teardown] log THIS IS KEYWORD TEARDOWN WARN
Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org
|
Template Keyword |
[Arguments] |
${path} |
|
|
|
[Setup] |
Log |
enter case |
|
|
Directory Should Exist |
${path} |
|
|
|
[TearDown] |
Log |
leave case |