I am currently using an HTML formatter to generate the Cucumber HTML report. The report is pretty, but I want the reports to be generated with all scenarios only with the title so that my report is not huge and easy to know which scenarios failed.
To clarify more, when cucumber HTML report is generated. I am seeing headers are divided into Steps (Passed, Failed, Skipped, Pending, Undefined), Scenarios(Passed, Failed, Skipped, Pending, Undefined), Feature. I just wanted to customize and print only Scenarios and remove steps section
public class HtmlFormatter extends CucumberJSONFormatter { private static final String TIMESTAMP_FORMAT = "d MMM yyyy HH:mm:ss:SSS z";
public HtmlFormatter(Appendable out) {
super(out);
}
@Override
public void done() {
super.done();
final List<String> jsonFiles = new ArrayList<>();
final ConfigReader configReader = new ConfigReader();
final File reportOutputDirectory = new File("reports/html");
final int numThreads = Integer.valueOf(configReader.getProperty("maxThreads", "4"));
//in case running from single feature file
if (Main.isFeatureFileExecution()) {
final String singleFeatureFileExecutionReportPath = "reports/"+configReader.getProperty( "repo","RepoNameNotFound" ) +"/json/report.json";
if (new File(singleFeatureFileExecutionReportPath).exists()) {
jsonFiles.add(singleFeatureFileExecutionReportPath);
}
}
String projectName = “X”;
boolean runWithJenkins = true;
boolean parallelTesting = true;
Configuration configuration = new Configuration(reportOutputDirectory, projectName);
configuration.setParallelTesting(parallelTesting);
configuration.setRunWithJenkins(runWithJenkins);
if (!jsonFiles.isEmpty()) {
ReportBuilder reportBuilder = new ReportBuilder(jsonFiles, configuration);
Reportable result = reportBuilder.generateReports();
}
}