Package org.testng.reporters
Class EmailableReporter2
java.lang.Object
org.testng.reporters.EmailableReporter2
- All Implemented Interfaces:
IReporter,ITestNGListener
Reporter that generates a single-page HTML report of the test results.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGroupsEmailableReporter2.MethodResults by class.protected static classGroups test results by method.protected static classGroupsEmailableReporter2.TestResults by suite.protected static classGroupsEmailableReporter2.ClassResults by test, type (configuration or test), and status. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringBuilderprivate Stringprivate static final Loggerprotected final List<EmailableReporter2.SuiteResult> protected PrintWriter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PrintWritercreateWriter(String outdir) private voiddumpAttributesInfo(String prefix, CustomAttribute[] attributes) private booleandumpParametersInfo(String prefix, Object[] parameters) voidGenerate a report for the given suites into the specified output directory.protected StringgetFormattedStartTime(long startTimeInMillisFromEpoch) voidsetFileName(String fileName) protected voidprotected voidprotected voidprotected voidprotected voidwriteReporterMessages(List<String> reporterMessages) private voidwriteScenario(int scenarioIndex, String label, ITestResult result) Writes the details for an individual test scenario.protected voidWrites the details for all test scenarios.private intwriteScenarioDetails(List<EmailableReporter2.ClassResult> classResults, int startingScenarioIndex) Writes the scenario details for the results of a given state for a single test.protected voidWrites a summary of all the test scenarios.private intwriteScenarioSummary(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.protected voidwriteStackTrace(Throwable throwable) protected voidprotected voidprotected voidwriteTableData(String html) Writes a TD element with the specified contents.protected voidwriteTableData(String html, String cssClasses) Writes a TD element with the specified contents and CSS class names.protected voidwriteTableHeader(String html, String cssClasses) Writes a TH element with the specified contents and CSS class names.protected voidWrites an arbitrary HTML element with the specified contents and CSS class names.
-
Field Details
-
LOG
-
writer
-
suiteResults
-
buffer
-
fileName
-
-
Constructor Details
-
EmailableReporter2
public EmailableReporter2()
-
-
Method Details
-
setFileName
-
getFileName
-
generateReport
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
- 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
-
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
Writes the details for an individual test scenario. -
dumpParametersInfo
-
dumpAttributesInfo
-
writeReporterMessages
-
writeStackTrace
-
writeTableHeader
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
Writes a TD element with the specified contents.- Parameters:
html- the HTML contents
-
writeTableData
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
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
-