Class EmailableReporter2

  • All Implemented Interfaces:
    IReporter, ITestNGListener

    public class EmailableReporter2
    extends java.lang.Object
    implements IReporter
    Reporter that generates a single-page HTML report of the test results.
    • Constructor Detail

      • EmailableReporter2

        public EmailableReporter2()
    • Method Detail

      • setFileName

        public void setFileName​(java.lang.String fileName)
      • getFileName

        public java.lang.String getFileName()
      • generateReport

        public void generateReport​(java.util.List<XmlSuite> xmlSuites,
                                   java.util.List<ISuite> suites,
                                   java.lang.String outputDirectory)
        Description copied from interface: IReporter
        Generate a report for the given suites into the specified output directory.
        Specified by:
        generateReport in interface IReporter
        Parameters:
        xmlSuites - The list of XmlSuite
        suites - The list of ISuite
        outputDirectory - The output directory
      • createWriter

        protected java.io.PrintWriter createWriter​(java.lang.String outdir)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • writeDocumentStart

        protected void writeDocumentStart()
      • writeHead

        protected void writeHead()
      • writeStylesheet

        protected void writeStylesheet()
      • writeBody

        protected void writeBody()
      • writeDocumentEnd

        protected void writeDocumentEnd()
      • writeSuiteSummary

        protected void writeSuiteSummary()
      • writeScenarioSummary

        protected void writeScenarioSummary()
        Writes a summary of all the test scenarios.
      • getFormattedStartTime

        protected java.lang.String getFormattedStartTime​(long startTimeInMillisFromEpoch)
      • writeScenarioDetails

        protected void writeScenarioDetails()
        Writes the details for all test scenarios.
      • writeReporterMessages

        protected void writeReporterMessages​(java.util.List<java.lang.String> reporterMessages)
      • writeStackTrace

        protected void writeStackTrace​(java.lang.Throwable throwable)
      • writeTableHeader

        protected void writeTableHeader​(java.lang.String html,
                                        java.lang.String cssClasses)
        Writes a TH element with the specified contents and CSS class names.
        Parameters:
        html - the HTML contents
        cssClasses - the space-delimited CSS classes or null if there are no classes to apply
      • writeTableData

        protected void writeTableData​(java.lang.String html)
        Writes a TD element with the specified contents.
        Parameters:
        html - the HTML contents
      • writeTableData

        protected void writeTableData​(java.lang.String html,
                                      java.lang.String cssClasses)
        Writes a TD element with the specified contents and CSS class names.
        Parameters:
        html - the HTML contents
        cssClasses - the space-delimited CSS classes or null if there are no classes to apply
      • writeTag

        protected void writeTag​(java.lang.String tag,
                                java.lang.String html,
                                java.lang.String cssClasses)
        Writes an arbitrary HTML element with the specified contents and CSS class names.
        Parameters:
        tag - the tag name
        html - the HTML contents
        cssClasses - the space-delimited CSS classes or null if there are no classes to apply