Class EmailableReporter2

java.lang.Object
org.testng.reporters.EmailableReporter2
All Implemented Interfaces:
IReporter, ITestNGListener

public class EmailableReporter2 extends Object implements IReporter
Reporter that generates a single-page HTML report of the test results.
  • Field Details

  • Constructor Details

    • EmailableReporter2

      public EmailableReporter2()
  • Method Details

    • setFileName

      public void setFileName(String fileName)
    • getFileName

      public String getFileName()
    • generateReport

      public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, 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 PrintWriter createWriter(String outdir) throws IOException
      Throws:
      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.
    • writeScenarioSummary

      private int writeScenarioSummary(String description, List<EmailableReporter2.ClassResult> classResults, String cssClassPrefix, int startingScenarioIndex)
      Writes the scenario summary for the results of a given state for a single test.
    • getFormattedStartTime

      protected String getFormattedStartTime(long startTimeInMillisFromEpoch)
    • writeScenarioDetails

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

      private int writeScenarioDetails(List<EmailableReporter2.ClassResult> classResults, int startingScenarioIndex)
      Writes the scenario details for the results of a given state for a single test.
    • writeScenario

      private void writeScenario(int scenarioIndex, String label, ITestResult result)
      Writes the details for an individual test scenario.
    • dumpParametersInfo

      private boolean dumpParametersInfo(String prefix, Object[] parameters)
    • writeReporterMessages

      protected void writeReporterMessages(List<String> reporterMessages)
    • writeStackTrace

      protected void writeStackTrace(Throwable throwable)
    • writeTableHeader

      protected void writeTableHeader(String html, 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(String html)
      Writes a TD element with the specified contents.
      Parameters:
      html - the HTML contents
    • writeTableData

      protected void writeTableData(String html, 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(String tag, String html, 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