我一直试图整合masterthought maven - 黄瓜报告,所以我可以像詹姆斯一样广告报道。我按照各个站点的配置说明,包括……
问题排序:在pom.xml,exec-maven-plugin中,我需要 json的插件参数:$ {project.build.directory} / somewhere / for / reports
蓬松的Jenkins报告需要json文件。还需要确保Jenkins Cucumber报告配置中指定的目录与pom.xml文件中指定的目录一致。
不需要net.masterthought插件。
我也得到了同样的错误。然后我使用下面的代码而不是使用pom.xml'net.masterthought'插件。它工作并生成了报告。 但是,我正在使用TestNG。因此,您必须使用@After注释检查它是否与JUnit一起使用。
@AfterSuite public void generateReport() { File reportOutputDirectory = new File("target"); // List<String> jsonFiles = new ArrayList<String>(); jsonFiles.add("target/cucumber.json"); String projectName = "Your Sample Project Name"; String buildNumber = "1.0"; Configuration configuration = new Configuration(reportOutputDirectory, projectName); configuration.setRunWithJenkins(true); configuration.setBuildNumber(buildNumber); ReportBuilder reportBuilder = new ReportBuilder(jsonFiles, configuration); reportBuilder.generateReports(); }