Skip to content

Java API to merge Cucumber JSON reports and build HTML Test Report

License

Notifications You must be signed in to change notification settings

rajatthareja/ReportBuilderJava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReportBuilderJava

Build status Maven Central

Java API to merge Cucumber JSON reports and build HTML Test Report

Sample Reports

View Sample Report

Include Report Builder in your project

Maven dependency for Report Builder:

<dependency>
    <groupId>com.rajatthareja</groupId>
    <artifactId>reportbuilder</artifactId>
    <version>1.0.3</version>
</dependency>

Build your test report

import com.rajatthareja.reportbuilder.ReportBuilder;
import com.rajatthareja.reportbuilder.Color;
import org.json.JSONObject;

import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

class MyClass {
    
    public static void main(String ... args) throws Exception{
        // Create ReportBuilder Object
        ReportBuilder reportBuilder = new ReportBuilder();
        
        // Set output Report Dir 
        reportBuilder.setReportDirectory("output/");
        
        // Set output report file name
        reportBuilder.setReportFileName("test_results");
        
        // Set Report Title
        reportBuilder.setReportTitle("My Test Report");
        
        // Set Report Color for more visit http://materializecss.com/color.html
        reportBuilder.setReportColor(Color.PURPLE);
        
        // Enable voice control for report
        reportBuilder.enableVoiceControl();
        
        // Add additional info for Report
        reportBuilder.setAdditionalInfo("Environment", "My Environment");

        // Create list or report Files or Directories or URLs or JSONObject or JSONString
        List<Object> cucumberJsonReports = new ArrayList<>();
        cucumberJsonReports.add(new File("my/report/path/report.json"));
        cucumberJsonReports.add(new File("myReportDir/"));
        cucumberJsonReports.add(new URL("http://myReportUrl/report.json"));
        cucumberJsonReports.add(new JSONObject("report Json String"));
        
        // Build your report
        reportBuilder.build(cucumberJsonReports);
    }
}

Note: Java > 8 is required.

View Java Docs for more details.

Voice Control Report

Use voice commands for easy navigation and search

  • show ( overview, features, summary, errors )
  • search { Keywords }

Report Builder Ruby Gem

Report Builder

Contributing

We're open to any contribution. It has to be tested properly though.

License

Copyright (c) 2018 MIT LICENSE