Class ReportCreator
java.lang.Object
de.qytera.qtaf.htmlreport.creator.ReportCreator
- All Implemented Interfaces:
IReportCreator
- Direct Known Subclasses:
FeatureReportCreator,ScenarioReportCreator
Class for creating HTML reports
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancreateReport(de.qytera.qtaf.core.log.model.collection.TestSuiteLogCollection logCollection) Create report and save it to the diskprotected com.mitchellbosecke.pebble.template.PebbleTemplateLoad the Pebble TemplategetRenderedTemplate(de.qytera.qtaf.core.log.model.collection.TestSuiteLogCollection logCollection) Get rendered templategetReportPath(de.qytera.qtaf.core.log.model.collection.TestSuiteLogCollection logCollection) Build report pathprotected StringGet root template pathgetTemplateContext(de.qytera.qtaf.core.log.model.collection.TestSuiteLogCollection logCollection) Get template contextprotected StringpersistRenderedTemplate(de.qytera.qtaf.core.log.model.collection.TestSuiteLogCollection logCollection, Writer writer) Persist rendered templatebooleanrenderTemplate(com.mitchellbosecke.pebble.template.PebbleTemplate compiledTemplate, Map<String, Object> context, Writer writer) Render the template
-
Field Details
-
rootTemplate
Root template -
reportPath
Path where reports are stored -
filename
Filename of the rendered template -
dateFormat
Date format
-
-
Constructor Details
-
ReportCreator
public ReportCreator()
-
-
Method Details
-
createReport
public boolean createReport(de.qytera.qtaf.core.log.model.collection.TestSuiteLogCollection logCollection) Create report and save it to the disk- Specified by:
createReportin interfaceIReportCreator- Parameters:
logCollection- Log collection- Returns:
- true on success
-
getRenderedTemplate
public Writer getRenderedTemplate(de.qytera.qtaf.core.log.model.collection.TestSuiteLogCollection logCollection) Get rendered template- Parameters:
logCollection- Log collection- Returns:
- Writer object that contains rendered template
-
persistRenderedTemplate
protected String persistRenderedTemplate(de.qytera.qtaf.core.log.model.collection.TestSuiteLogCollection logCollection, Writer writer) Persist rendered template- Parameters:
logCollection- Log collectionwriter- Writer object- Returns:
- Path to rendered template
-
renderTemplate
public boolean renderTemplate(com.mitchellbosecke.pebble.template.PebbleTemplate compiledTemplate, Map<String, Object> context, Writer writer) Render the template- Parameters:
compiledTemplate- Pebble template objectcontext- Template contextwriter- Writer- Returns:
- true on success, false otherwise
-
getTemplateContext
protected Map<String,Object> getTemplateContext(de.qytera.qtaf.core.log.model.collection.TestSuiteLogCollection logCollection) Get template context- Parameters:
logCollection- Logs- Returns:
- Template context
-
getPebbleTemplate
protected com.mitchellbosecke.pebble.template.PebbleTemplate getPebbleTemplate()Load the Pebble Template- Returns:
- Pebble template object
-
getRootTemplate
Get root template path- Returns:
- root template path
-
getReportPath
public String getReportPath(de.qytera.qtaf.core.log.model.collection.TestSuiteLogCollection logCollection) Build report path- Returns:
- report path
-