Package org.testng.reporters
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
EmailableReporter2.ClassResult
GroupsEmailableReporter2.MethodResult
s by class.protected static class
EmailableReporter2.MethodResult
Groups test results by method.protected static class
EmailableReporter2.SuiteResult
GroupsEmailableReporter2.TestResult
s by suite.protected static class
EmailableReporter2.TestResult
GroupsEmailableReporter2.ClassResult
s by test, type (configuration or test), and status.
-
Field Summary
Fields Modifier and Type Field Description protected List<EmailableReporter2.SuiteResult>
suiteResults
protected PrintWriter
writer
-
Constructor Summary
Constructors Constructor Description EmailableReporter2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.String
getFileName()
void
setFileName(String fileName)
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.
-
-
-
Field Detail
-
writer
protected PrintWriter writer
-
suiteResults
protected final List<EmailableReporter2.SuiteResult> suiteResults
-
-
Method Detail
-
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 interfaceIReporter
-
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.
-
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 contentscssClasses
- 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 contentscssClasses
- 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 namehtml
- the HTML contentscssClasses
- the space-delimited CSS classes or null if there are no classes to apply
-
-