damianszczepanik / cucumber-reporting

HTML reports for Cucumber
GNU Lesser General Public License v2.1
548 stars 403 forks source link

Not able to get the total feature file count #859

Closed KumarKola closed 5 years ago

KumarKola commented 5 years ago

Hi @damianszczepanik I am using 4.8 cucumber-reporting version and I am merging multiple Json files to generate a single over-view html report. I am able to generate it but the Total count of features are not showing up. Could you please take a look. Thank you.

image

net.masterthought cucumber-reporting 4.8.0
damianszczepanik commented 5 years ago

Have you tried with https://github.com/damianszczepanik/cucumber-reporting/blob/master/src/main/java/net/masterthought/cucumber/reducers/ReducingMethod.java#L14 ?

KumarKola commented 5 years ago

Have you tried with https://github.com/damianszczepanik/cucumber-reporting/blob/master/src/main/java/net/masterthought/cucumber/reducers/ReducingMethod.java#L14 ?

@damianszczepanik I have tried with merging the Json files.. pls find the below code that I used

public File reportOutputDirectory; public List list;

public HtmlReporter() {
    this.reportOutputDirectory = new File(System.getProperty("user.dir") + FileLocations.OUTPUT_DIRECTORY);
    this.list = new ArrayList();
}

public void listFilesForFolder(File folder) {
    File[] var2 = folder.listFiles();
    int var3 = var2.length;

    for(int var4 = 0; var4 < var3; ++var4) {
        File fileEntry = var2[var4];
        if (fileEntry.isDirectory()) {
            this.listFilesForFolder(fileEntry);
        } else if (fileEntry.getName().endsWith(".json")) {
            System.out.println("*******" + fileEntry.getName());
            this.list.add(this.reportOutputDirectory + "/reports/" + fileEntry.getName());
        }
    }

}

public void generateReports() throws VelocityException, IOException {
    this.listFilesForFolder(new File(System.getProperty("user.dir") + FileLocations.OUTPUT_DIRECTORY+ "/reports"));
    String jenkinsBasePath = "";
    String buildNumber = "1";
    String projectName = "cucumber-jvm";
    boolean runWithJenkins = false;
    boolean parallelTesting = false;
    Configuration configuration = new Configuration(this.reportOutputDirectory, projectName);

// configuration.setParallelTesting(parallelTesting); // configuration.setRunWithJenkins(runWithJenkins); configuration.addPresentationModes(PresentationMode.RUN_WITH_JENKINS); configuration.setBuildNumber(buildNumber); ReportBuilder reportBuilder = new ReportBuilder(this.list, configuration); reportBuilder.generateReports(); }

damianszczepanik commented 5 years ago

Check readme file and use above flag to merge features oroperly

Saptha-Clans commented 2 years ago

Hi Damian, Any directions for cucumber reporting for gradle project? Appreciate your help.