空手道0.9.1没有生成用于黄瓜报告的cumul.json [英] Karate 0.9.1 is not generating cucumber.json which is used for cucumber reports
问题描述
与黄瓜一起使用空手道0.6.1 时.它将在代码中指定的路径中生成测试结果输出到 cucumber.json 文件.
When using Karate 0.6.1 with cucumber. It is generating test result outputs to cucumber.json file in the path specified in the code.
然后使用Masterthought将其用于生成黄瓜报告.
It is then used for generating the cucumber reports using Masterthought.
@RunWith(Karate.class)
@CucumberOptions(monochrome = true, features = "SampleFeature.feature",
plugin = {"pretty", "html:target/site/cucumber-pretty",
"json:target/cucumber-html-reports/cucumber.json" })
但是当我们迁移到空手道0.9.1 以便从csv文件读取输入时.现在,它无法生成Cucumber.json,因此报告由于FileNotFoundException而失败.
But when we migrated to Karate 0.9.1 to read inputs from csv file. Now, it is failing to generate cucumber.json so the reports are failing with FileNotFoundException.
在pom.xml中附加了masterthought插件
Attached the plugin for masterthought in pom.xml
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>3.15.0</version>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<!-- optional, per documentation set this to "true" to bypass
generation of Cucumber
Reports entirely, defaults to false if not specified -->
<skip>false</skip>
<!-- output
directory for the generated report -->
<outputDirectory>${project.build.directory}</outputDirectory>
<!-- optional, defaults to outputDirectory if not specified -->
<inputDirectory>${project.build.directory}/surefire-reports</inputDirectory>
<jsonFiles>
<!-- supports wildcard or name pattern -->
<param>target/cucumber-html-reports/cucumber-json-report.json</param>
</jsonFiles>
<cucumberOutput>${project.build.directory}/cucumber-html-reports/cucumber.json</cucumberOutput>
<!-- optional, defaults to outputDirectory if not specified -->
<classificationDirectory>${project.build.directory}/classifications</classificationDirectory>
<classificationFiles>
supports wildcard or name pattern
<param>sample.properties</param>
<param>other.properties</param>
</classificationFiles>
<parallelTesting>false</parallelTesting>
</configuration>
</execution>
</executions>
</plugin>
谁能建议从0.6.1更改为0.9.1的内容?
Can anyone suggests what is changed from 0.6.1 to 0.9.1?
我应该怎么做才能生成cummon.json文件?
And what should i be doing to generate cucumber.json file?
推荐答案
从Karate 0.9.0开始,注释上支持的唯一参数是features
和tags
,仅此而已.空手道是不再基于黄瓜了.
In Karate 0.9.0 onwards, the only parameters on the annotation supported are features
and tags
, nothing else. Karate is not based on Cucumber any more.
默认情况下,并行运行器将在target/surefire-reports
中生成您期望的JSON.请仔细阅读文档的这一部分: https://github.com/intuit/karate#parallel -执行
The parallel runner, will generate the JSON you are expecting in target/surefire-reports
by default. Please read this section of the docs carefully: https://github.com/intuit/karate#parallel-execution
因此,您必须执行以下操作:
So you have to do the following:
- 不要使用
@RunWith(Karate.class)
- 使用
@KarateOptions(features = "SampleFeature.feature")
- 使用
Runner.parallel()
- 请勿将
maven-cucumber-reporting
用作plugin
,而应将其用作dependency
,请参考以下内容:
- don't use
@RunWith(Karate.class)
- use
@KarateOptions(features = "SampleFeature.feature")
- use the
Runner.parallel()
- don't use the
maven-cucumber-reporting
as aplugin
, use it as adependency
instead, refer this: https://github.com/intuit/karate/tree/master/karate-demo#example-report - write (a few lines of) code to use the JSON generated as described in the above link
这篇关于空手道0.9.1没有生成用于黄瓜报告的cumul.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!