0

我正在使用单个 pycharm 项目为特定网站运行不同的测试文件。ex -: 我有带有测试用例的机器人文件,例如

loginTest.robot , purchasetest.robot , signinwith_facebook.robot

当我为每个机器人文件运行代码时,报告文件被覆盖。

如何在测试文件运行时为每个 .robot 文件生成单独的报告文件。

4

1 回答 1

0

您是否使用robot命令执行?如果是,您可以使用以下参数运行:

-d --outputdir dir    Where to create output files. The default is the
                      directory where tests are run from and the given path
                      is considered relative to that unless it is absolute.
-o --output file      XML output file. Given path, similarly as paths given
                      to --log, --report, --xunit, and --debugfile, is
                      relative to --outputdir unless given as an absolute
                      path. Other output files are created based on XML
                      output files after the test execution and XML outputs
                      can also be further processed with Rebot tool. Can be
                      disabled by giving a special value `NONE`.
                      Default: output.xml
-l --log file         HTML log file. Can be disabled by giving a special
                      value `NONE`. Default: log.html
                      Examples: `--log mylog.html`, `-l NONE`
-r --report file      HTML report file. Can be disabled with `NONE`
                      similarly as --log. Default: report.html

我建议使用-d参数。为每个执行的文件指示不同的目录.robot

robot -d test1 test1.robot

顺便说一句,你为什么不同时执行它们?您可以在一个文件中查看每个日志。

于 2021-10-28T07:19:42.220 回答