我正在为这个-s --suite选择而挣扎。当我运行我的所有测试用例文件时,如下所示:robot .,一切都很好(即告诉机器人运行当前文件夹中的所有测试用例文件.)。或者,如果我想运行特定的测试用例文件,比如说robot mytest.robot,也可以正常工作。
然而,最近我创建了一个初始化文件。那个是在运行时执行的robot .(因为它存储在该目录中),但在运行时自然不会执行robot mytest.robot。到目前为止一切都清楚了。
我认为简单的解决方案是运行robot -s mytest.robot .
但是,我收到一个错误:Suite 'BDD' contains no tests in suite 'mytest.robot'.
这是不对的,因为正如我上面提到的,robot mytest.robot从同一个目录运行它可以正常工作,该文件中的测试用例已被处理。此外,即使我运行robot -s non_existent_test_case_file.robot .>>> ,我也得到同样的Suite 'BDD' contains no tests in suite 'non_existent_test_case_file.robot'.结果,这也应该证明问题不在于我的 mytest.robot 没有指定测试=错误消息根本就是错误的。
使用:Robot Framework 3.1 (Python 3.6.6 on linux)
有什么提示吗?
添加更多信息
我创建了新文件夹“temp”,将我的文件__init__.robot和mytest.robot文件移到了其中。我对它们进行了编辑,使它们尽可能基本。
__init__.robot:
*** Settings ***
Suite Setup RobotSetup
Suite …Run Code Online (Sandbox Code Playgroud)