简体   繁体   English

在Maven中设置cucumber-jvm格式选项以附加所有测试执行结果

[英]Setting cucumber-jvm format options in Maven to append all test execution results

The question is regarding the cucumber format option in maven: 问题是关于maven中的黄瓜格式选项:

In every Junit I have something like: 在每一个Junit我有类似的东西:

@Cucumber.Options(format = { "pretty", "html:target/cucumber-html-report/foo" })

I added the following option to the pom file: 我在pom文件中添加了以下选项:

  <properties>
    <cucumber.options> --format html:target/cucumber-html-report/allFoos</cucumber.options>     
  </properties>

The generated report only have the last execution. 生成的报告仅具有上次执行。

Is there a way to do an "append"? 有没有办法做“追加”?

Your issue is that when cucumber runs a junit runner file it opens or creates the specified html report file you reference in the runner file. 您的问题是,当cucumber运行junit runner文件时,它会打开或创建您在runner文件中引用的指定html报告文件。 Since cucumber has no idea what each and every test runner plans on writing to when it runs, it overwrites the file if it is used by multiple test runners. 由于黄瓜不知道每个测试运行器在运行时计划写什么,如果多个测试运行器使用它,它会覆盖该文件。 There is no append that you could add to have all of your test runs write to a single file. 没有可添加的附加项以使所有测试运行写入单个文件。 Your best option (and best practice) is to have each junit test runner write to an individual file, with a name that is descriptive of what the test suite is testing. 您最好的选择(和最佳实践)是让每个junit测试运行器写入单个文件,其名称描述测试套件正在测试的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM