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 class
GroupsEmailableReporter2.MethodResult
s by class.protected static class
Groups test results by method.protected static class
GroupsEmailableReporter2.TestResult
s by suite.protected static class
GroupsEmailableReporter2.ClassResult
s by test, type (configuration or test), and status. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringBuilder
private String
private static final Logger
protected final List<EmailableReporter2.SuiteResult>
protected PrintWriter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PrintWriter
createWriter
(String outdir) private boolean
dumpParametersInfo
(String prefix, Object[] parameters) void
Generate a report for the given suites into the specified output directory.protected String
getFormattedStartTime
(long startTimeInMillisFromEpoch) void
setFileName
(String fileName) protected void
protected void
protected void
protected void
protected void
writeReporterMessages
(List<String> reporterMessages) private void
writeScenario
(int scenarioIndex, String label, ITestResult result) Writes the details for an individual test scenario.protected void
Writes the details for all test scenarios.private int
writeScenarioDetails
(List<EmailableReporter2.ClassResult> classResults, int startingScenarioIndex) Writes the scenario details for the results of a given state for a single test.protected void
Writes a summary of all the test scenarios.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.protected void
writeStackTrace
(Throwable throwable) protected void
protected void
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
Writes 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:IReporter
Generate a report for the given suites into the specified output directory.- Specified by:
generateReport
in interfaceIReporter
- Parameters:
xmlSuites
- The list ofXmlSuite
suites
- The list ofISuite
outputDirectory
- 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
-
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
-