Karate 我的目标文件夹中没有html报告

Karate 我的目标文件夹中没有html报告,karate,Karate,我已经创建了我的第一个功能,它运行得非常棒。然而,我并没有在我的目标文件夹中看到下面的html报告。你能帮我一下吗。https://github.com/intuit/karate/blob/master/karate-demo/src/test/resources/karate-maven-cucumber-reporting.png假设您正在查找cucumber报告 @CucumberOptions(features = {"src/test/java/features"},glue={"s

我已经创建了我的第一个功能,它运行得非常棒。然而,我并没有在我的目标文件夹中看到下面的html报告。你能帮我一下吗。
https://github.com/intuit/karate/blob/master/karate-demo/src/test/resources/karate-maven-cucumber-reporting.png

假设您正在查找cucumber报告

@CucumberOptions(features = {"src/test/java/features"},glue={"stepDef"},format={"pretty", "html:target/Destination"})

format={“pretty”,“html:target/Destination”}
指定要存储html报告的文件夹路径

我想我已经在另一个答案中要求您仔细阅读文档。无论如何,这里是链接:

将此添加到您的
pom.xml

<dependency>
    <groupId>net.masterthought</groupId>
    <artifactId>cucumber-reporting</artifactId>
    <version>3.8.0</version>
    <scope>test</scope>
</dependency>
有关更多详细信息,请参阅文档,但请使用并行流道:

@Test
public void testParallel() {
    String karateOutputPath = "target/surefire-reports";
    KarateStats stats = CucumberRunner.parallel(getClass(), 5, karateOutputPath);
    generateReport(karateOutputPath);
    assertTrue("there are scenario failures", stats.getFailCount() == 0);        
}

private static void generateReport(String karateOutputPath) {
    Collection<File> jsonFiles = FileUtils.listFiles(new File(karateOutputPath), new String[] {"json"}, true);
    List<String> jsonPaths = new ArrayList(jsonFiles.size());
    for (File file : jsonFiles) {
        jsonPaths.add(file.getAbsolutePath());
    }
    Configuration config = new Configuration(new File("target"), "your-project-name");
    ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
    reportBuilder.generateReports();    
}
@测试
公共void testParallel(){
字符串karateOutputPath=“目标/surefire报告”;
KarateStats=CucumberRunner.parallel(getClass(),5,karateOutputPath);
generateReport(karateOutputPath);
assertTrue(“存在场景失败”,stats.getFailCount()==0);
}
专用静态void生成器报告(字符串karateOutputPath){
Collection jsonFiles=FileUtils.listFiles(新文件(karateOutputPath),新字符串[]{“json”},true);
List jsonpath=newarraylist(jsonFiles.size());
for(文件:jsonFiles){
添加(file.getAbsolutePath());
}
配置配置=新配置(新文件(“目标”),“您的项目名称”);
ReportBuilder ReportBuilder=newreportbuilder(jsonpath,config);
reportBuilder.generateReports();
}

大家好,欢迎来到StackOverflow!请拿着这本书,读一读。我看过了你的文档,非常棒。非常感谢你的帮助。您能告诉我是否需要在pom.xml中添加以下依赖项和配置吗。1.org.springframework.boot2。公地io;3.include>demo/demoestparallel.java 4--插件junit:target/surefire reports/cucumber-junit.xml右键单击demoestparallel.java-->然后在overview-features.html文件中看到以下功能的结果。我的功能(jenkins.feature)未运行。您似乎试图重新使用我在另一条评论中提到的演示代码,这是一种错误的方法,将使您更加困惑。只要试着使用原型和JoeColantonio的教程从头开始创建一个项目。这里列出了更多教程:-或者请向了解Java的人寻求帮助。祝你一切顺利。我以前把一切都搞复杂了。我确实完全按照你说的做了,而且很有效。非常感谢你的帮助:)@arkadiyala真棒。很高兴听到:)我也把事情弄复杂了,而不是严格遵循空手道官方教程。我没有注意到
@RunWith(Karate.class)
应该被删除。它的实现非常简单,而且非常好。您可以隐藏或显示详细信息,“文档字符串”将被发现!!!我终于比其他人更喜欢空手道报告了。@Ashish Deshmukh我是空手道的开发者,我想指出这个答案是错误的。空手道不是黄瓜。
@Test
public void testParallel() {
    String karateOutputPath = "target/surefire-reports";
    KarateStats stats = CucumberRunner.parallel(getClass(), 5, karateOutputPath);
    generateReport(karateOutputPath);
    assertTrue("there are scenario failures", stats.getFailCount() == 0);        
}

private static void generateReport(String karateOutputPath) {
    Collection<File> jsonFiles = FileUtils.listFiles(new File(karateOutputPath), new String[] {"json"}, true);
    List<String> jsonPaths = new ArrayList(jsonFiles.size());
    for (File file : jsonFiles) {
        jsonPaths.add(file.getAbsolutePath());
    }
    Configuration config = new Configuration(new File("target"), "your-project-name");
    ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
    reportBuilder.generateReports();    
}