org.testng.reporters
Class EmailableReporter2

java.lang.Object
  extended by 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.

Based on an earlier implementation by Paul Mendelson.

Author:
Abraham Lin

Nested Class Summary
protected static class EmailableReporter2.ClassResult
          Groups EmailableReporter2.MethodResults by class.
protected static class EmailableReporter2.MethodResult
          Groups test results by method.
protected static class EmailableReporter2.SuiteResult
          Groups EmailableReporter2.TestResults by suite.
protected static class EmailableReporter2.TestResult
          Groups EmailableReporter2.ClassResults by test, type (configuration or test), and status.
 
Field Summary
protected  List<EmailableReporter2.SuiteResult> suiteResults
           
protected  PrintWriter writer
           
 
Constructor Summary
EmailableReporter2()
           
 
Method Summary
protected  PrintWriter createWriter(String outdir)
           
 void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory)
          Generate a report for the given suites into the specified output directory.
protected  void writeBody()
           
protected  void writeDocumentEnd()
           
protected  void writeDocumentStart()
           
protected  void writeHead()
           
protected  void writeReporterMessages(List<String> reporterMessages)
           
protected  void writeScenarioDetails()
          Writes the details for all test scenarios.
protected  void writeScenarioSummary()
          Writes a summary of all the test scenarios.
protected  void writeStackTrace(Throwable throwable)
           
protected  void writeStylesheet()
           
protected  void writeSuiteSummary()
           
protected  void writeTableData(String html)
          Writes a TD element with the specified contents.
protected  void writeTableData(String html, String cssClasses)
          Writes a TD element with the specified contents and CSS class names.
protected  void writeTableHeader(String html, String cssClasses)
          Writes a TH element with the specified contents and CSS class names.
protected  void writeTag(String tag, String html, String cssClasses)
          Writes an arbitrary HTML element with the specified contents and CSS class names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writer

protected PrintWriter writer

suiteResults

protected List<EmailableReporter2.SuiteResult> suiteResults
Constructor Detail

EmailableReporter2

public EmailableReporter2()
Method Detail

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

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.


writeScenarioDetails

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


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


Copyright © 2015. All Rights Reserved.