【问题标题】:How to set custom filename for pabot result (html)如何为 pabot 结果设置自定义文件名 (html)
【发布时间】:2021-12-29 05:29:04
【问题描述】:

我为我的应用程序实现了测试用例,并决定每天运行它。问题是之前的测试结果将被最新的测试结果覆盖。我需要同时保留它们,因此我想出了一个解决方案,例如,在报告名称中包含测试日期和时间; report-202111181704.html(使用 24 小时格式的时间)。

我在互联网上进行了搜索,但尚未找到任何解决方案。这里有人知道解决方案吗?或者任何替代解决方案都可以。

【问题讨论】:

    标签: automated-tests appium robotframework


    【解决方案1】:

    这取决于您执行测试的位置。从命令行,您可以将日期保存到变量。然后使用此变量更改生成的输出的名称。例如

    date=$(date '+%Y-%m-%d_%H:%M:%S')
    robot --output ${date}output.xml --log ${date}log.html --report ${date}report.html test.robot 
    

    【讨论】:

      【解决方案2】:

      我找到了解决方案。我没有设置 .html 文件名,而是创建了一个文件夹并将结果放在那里。

      为此,请在 pabot 命令中添加 --outputdir,使其看起来像这样

      pabot --pabotlibport $PABOT_PORT --pabotlib --resourcefile ./DeviceSet.dat --processes $thread --verbose --outputdir ./result/$OUTPUT_DIR $ENV

      在哪里 $OUTPUT_DIR=`日期 + "%Y%m%d-%H%M"`

      输出文件夹会像./result/20220301-2052

      【讨论】:

        猜你喜欢
        • 2020-06-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多