PyCharm IDE和run.bat文件运行所有测试,而不是指定的数字

2024-06-26 18:06:29 发布

您现在位置:Python中文网/ 问答频道 /正文

问题:PyCharm IDE和run.bat文件运行所有测试,而不是指定的数字

下面是我用来运行测试的命令

pabot--进程1--输出目录结果--报告AutoReport.html TestCases*.robot

enter image description here


Tags: 文件run命令目录进程html报告robot
1条回答
网友
1楼 · 发布于 2024-06-26 18:06:29

您可以使用[Tags]指定要运行的测试。 检查此项以了解更多信息https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#tagging-test-cases

然后可以通过添加-i <tags>来运行

假设您有这个测试用例

Test Case1
    [Tags]  test1
    Do something ...

Test Case2
    [Tags]  test2
    Do something ...

Test Case3
    [Tags]  test3
    Do something ...

要执行特定的测试用例,您可以在pabot中使用它

pabot -i test1 -i test2 -i test3  processes 1  outputdir Results  report AutoReport.html TestCases

相关问题 更多 >