Package org.testng.reporters
Class EmailableReporter2
- java.lang.Object
-
- org.testng.reporters.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classEmailableReporter2.ClassResultGroupsEmailableReporter2.MethodResults by class.protected static classEmailableReporter2.MethodResultGroups test results by method.protected static classEmailableReporter2.SuiteResultGroupsEmailableReporter2.TestResults by suite.protected static classEmailableReporter2.TestResultGroupsEmailableReporter2.ClassResults by test, type (configuration or test), and status.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringBuilderbufferprivate java.lang.StringfileNameprivate static LoggerLOGprotected java.util.List<EmailableReporter2.SuiteResult>suiteResultsprotected java.io.PrintWriterwriter
-
Constructor Summary
Constructors Constructor Description EmailableReporter2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.io.PrintWritercreateWriter(java.lang.String outdir)private booleandumpParametersInfo(java.lang.String prefix, java.lang.Object[] parameters)voidgenerateReport(java.util.List<XmlSuite> xmlSuites, java.util.List<ISuite> suites, java.lang.String outputDirectory)Generate a report for the given suites into the specified output directory.java.lang.StringgetFileName()voidsetFileName(java.lang.String fileName)protected voidwriteBody()protected voidwriteDocumentEnd()protected voidwriteDocumentStart()protected voidwriteHead()protected voidwriteReporterMessages(java.util.List<java.lang.String> reporterMessages)private voidwriteScenario(int scenarioIndex, java.lang.String label, ITestResult result)Writes the details for an individual test scenario.protected voidwriteScenarioDetails()Writes the details for all test scenarios.private intwriteScenarioDetails(java.util.List<EmailableReporter2.ClassResult> classResults, int startingScenarioIndex)Writes the scenario details for the results of a given state for a single test.protected voidwriteScenarioSummary()Writes a summary of all the test scenarios.private intwriteScenarioSummary(java.lang.String description, java.util.List<EmailableReporter2.ClassResult> classResults, java.lang.String cssClassPrefix, int startingScenarioIndex)Writes the scenario summary for the results of a given state for a single test.protected voidwriteStackTrace(java.lang.Throwable throwable)protected voidwriteStylesheet()protected voidwriteSuiteSummary()protected voidwriteTableData(java.lang.String html)Writes a TD element with the specified contents.protected voidwriteTableData(java.lang.String html, java.lang.String cssClasses)Writes a TD element with the specified contents and CSS class names.protected voidwriteTableHeader(java.lang.String html, java.lang.String cssClasses)Writes a TH element with the specified contents and CSS class names.protected voidwriteTag(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.
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
writer
protected java.io.PrintWriter writer
-
suiteResults
protected final java.util.List<EmailableReporter2.SuiteResult> suiteResults
-
buffer
private final java.lang.StringBuilder buffer
-
fileName
private java.lang.String fileName
-
-
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:IReporterGenerate a report for the given suites into the specified output directory.- Specified by:
generateReportin interfaceIReporter- Parameters:
xmlSuites- The list ofXmlSuitesuites- The list ofISuiteoutputDirectory- 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.
-
writeScenarioSummary
private int writeScenarioSummary(java.lang.String description, java.util.List<EmailableReporter2.ClassResult> classResults, java.lang.String cssClassPrefix, int startingScenarioIndex)Writes the scenario summary for the results of a given state for a single test.
-
writeScenarioDetails
protected void writeScenarioDetails()
Writes the details for all test scenarios.
-
writeScenarioDetails
private int writeScenarioDetails(java.util.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, java.lang.String label, ITestResult result)Writes the details for an individual test scenario.
-
dumpParametersInfo
private boolean dumpParametersInfo(java.lang.String prefix, java.lang.Object[] parameters)
-
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 contentscssClasses- 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 contentscssClasses- 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 namehtml- the HTML contentscssClasses- the space-delimited CSS classes or null if there are no classes to apply
-
-