Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  
  package sirius.utils.retriever;
  
  import java.io.File;
  import java.util.List;
  import java.util.Locale;
 
 
Generates Cucumber HTML detailed report based on execution results

Author(s):
Myk Kolisnyk
Goal:
cucumber
Phase:
site
 
 public class CucumberReportingPlugin extends AbstractMavenReport {
     public final String fs      = System.getProperty("file.separator");

    
Directory where reports will go.

Parameter:
expression="${project.reporting.outputDirectory}"
Required:
Readonly:
 
     private String outputDirectory;
 
    

Parameter:
default-value="${project}"
Required:
Readonly:
 
     private MavenProject project;

    

Component:
Required:
Readonly:
 
     private Renderer siteRenderer;
    
    

Parameter:
expression="${project.cucumber.jsonfile}"
Required:
Readonly:
 
     private String jsonFile;
    
    

Parameter:
Readonly:
 
     private boolean skippedFails = false;

    

Parameter:
Readonly:
 
     private boolean undefinedFails = false;
    
    

Parameter:
Readonly:
 
     private boolean flashCharts = false;
    
    

Parameter:
Readonly:
 
     private boolean runWithJenkins = false;
     
     private boolean artifactsEnabled = false;
     
     private boolean highCharts = false;
     
     /* (non-Javadoc)
      * @see org.apache.maven.reporting.MavenReport#getDescription(java.util.Locale)
      */
     public String getDescription(Locale arg0) {
         // TODO Auto-generated method stub
         return "HTML formatted Cucumber test results report";
     }
 
     /* (non-Javadoc)
      * @see org.apache.maven.reporting.MavenReport#getName(java.util.Locale)
      */
     public String getName(Locale arg0) {
         // TODO Auto-generated method stub
         return "Test Execution Report";
     }
    /* (non-Javadoc)
     * @see org.apache.maven.reporting.MavenReport#getOutputName()
     */
    public String getOutputName() {
        // TODO Auto-generated method stub
        return "cucumber-test-report";
    }

    

Returns:
the jsonFile
    public String getJsonFile() {
        return ;
    }

    

Parameters:
jsonFile the jsonFile to set
    public void setJsonFile(String jsonFile) {
        this. = jsonFile;
    }

    

Returns:
the skippedFails
    public boolean isSkippedFails() {
        return ;
    }

    

Parameters:
skippedFails the skippedFails to set
    public void setSkippedFails(boolean skippedFails) {
        this. = skippedFails;
    }

    

Returns:
the undefinedFails
    public boolean isUndefinedFails() {
        return ;
    }

    

Parameters:
undefinedFails the undefinedFails to set
    public void setUndefinedFails(boolean undefinedFails) {
        this. = undefinedFails;
    }

    

Returns:
the flashCharts
    public boolean isFlashCharts() {
        return ;
    }

    

Parameters:
flashCharts the flashCharts to set
    public void setFlashCharts(boolean flashCharts) {
        this. = flashCharts;
    }

    

Returns:
the runWithJenkins
    public boolean isRunWithJenkins() {
        return ;
    }

    

Parameters:
runWithJenkins the runWithJenkins to set
    public void setRunWithJenkins(boolean runWithJenkins) {
        this. = runWithJenkins;
    }

    

Parameters:
outputDirectory the outputDirectory to set
    public void setOutputDirectory(String outputDirectory) {
        this. = outputDirectory;
    }

    

Parameters:
project the project to set
    public void setProject(MavenProject project) {
        this. = project;
    }

    

Parameters:
siteRenderer the siteRenderer to set
    public void setSiteRenderer(Renderer siteRenderer) {
        this. = siteRenderer;
    }
    /* (non-Javadoc)
     * @see org.apache.maven.reporting.AbstractMavenReport#executeReport(java.util.Locale)
     */
    @Override
    protected void executeReport(Locale arg0throws MavenReportException {
        File reportOutputDirectory = new File( +  + "cucumber" );
        List<StringjsonReportFiles = new ArrayList<String>();
        jsonReportFiles.add(this.);
        ReportBuilder reportBuilder;
        try {
            reportBuilder = 
                    new ReportBuilder(
                            jsonReportFiles
                            reportOutputDirectory
                            ""
                            .getVersion(), 
                            .getName(), 
                            
                            
                            
                            
                            
                            ""
                            );            
            reportBuilder.generateReports();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
        Sink sink = getSink();
        sink.head();
        sink.title();
        sink.text("Cucumber Test Results Report");
        sink.title_();
        sink.head_();
     
        sink.body();
        sink.section1();
        sink.sectionTitle1();
        sink.text("Features Overview");
        sink.sectionTitle1_();
        sink.paragraph();
        sink.text("Features overview report shows test results distributed by each specific feature with detailed information about tests included");
        sink.link("cucumber/feature-overview.html");
        sink.text("View Report");
        sink.link_();
        sink.paragraph_();
        sink.section1_();
        
        sink.section1();
        sink.sectionTitle1();
        sink.text("Tags Overview");
        sink.sectionTitle1_();
        sink.paragraph();
        sink.text("Tags overview report shows test results distributed by tag with detailed information about tests included");
        sink.link("cucumber/tag-overview.html");
        sink.text("View Report");
        sink.link_();
        sink.paragraph_();
        sink.section1_();
        sink.body_();
        sink.flush();
        sink.close();
    }
    /* (non-Javadoc)
     * @see org.apache.maven.reporting.AbstractMavenReport#getOutputDirectory()
     */
    @Override
    protected String getOutputDirectory() {
        // TODO Auto-generated method stub
        return ;
    }
    /* (non-Javadoc)
     * @see org.apache.maven.reporting.AbstractMavenReport#getProject()
     */
    @Override
    protected MavenProject getProject() {
        // TODO Auto-generated method stub
        return ;
    }
    /* (non-Javadoc)
     * @see org.apache.maven.reporting.AbstractMavenReport#getSiteRenderer()
     */
    @Override
    protected Renderer getSiteRenderer() {
        // TODO Auto-generated method stub
        return ;
    }
New to GrepCode? Check out our FAQ X