我在RobotFramework中定义了2个测试用例
test1 测试2
是否只有在test1失败时才可以启动test2?
答案 0 :(得分:4)
实现此目标的一种方法是使用robotframework-dependencylibrary。
该库的摘录
声明测试之间的依赖关系。使测试自动失败 根据其他测试用例或测试套件的结果。
在下面的示例中,您可以使用“取决于测试”关键字,如下所示。
*** Settings ***
Library DependencyLibrary
*** Test cases ***
Passing Test
No operation
Failing Test
Fail This test is intentionally hardcoded to fail
This Test Depends on "Passing Test" Passing
Depends on test Passing Test
Log The rest of the keywords in this test will run as normal.
This Test Depends on "Failing Test" Failing
Depends on test failure Failing Test
Log The rest of the keywords in this test will run as normal.