在Robot Framework测试用例中,我们可以创建 Teardown 阶段进行清理活动。
Teardown
| *Test Case* | | testcase1 | | | [Setup] | Setup Actions | | | Do Something | Args | | | Do Something | Args | | | [Teardown] | Teardown Actions | | *Keyword* | | Teardown Actions | | | Do Something | Args | | | Do Something | Args |
在 撕裂(Teardown) 阶段,我们如何检查当前测试用例是通过还是失败?
撕裂(Teardown)
我想在测试用例通过时做一些事情,在测试用例失败时做一些其他事情。
有一个变量叫做 ${TEST_STATUS} 你可以在拆卸时使用。这记录在章节中 Automatic Variables 在用户指南中。
${TEST_STATUS}
您还可以使用以下关键字 Run keyword if test passed 和 Run keyword if test failed ,也只能在拆卸时使用。