Package com.hp.lft.report
Interface ReportProvider
public interface ReportProvider
Accesses the OpenText Functional Testing for Developers Report Module.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRunInformation
(String fieldName, String fieldValue) Adds a custom entry to the top section of the report.void
void
void
void
void
void
Ends the section in the report.void
endTest()
Ends the current test level and sets the test status as passed.void
Ends the current test level and sets the specified status for the test.Generates the report.Returns the status of the current execution context.Returns theReportConfiguration
interface, which enables you to customize the report behavior.Returns the description of the run results report.Returns the report level used to generate the report.Returns the run results report title.Returns the runtime status of the report.Returns the snapshot capture level used to generate the report.void
init()
Initializes the report with the default configuration, as defined in the report section of the leanft.properties file.void
init
(ReportConfiguration configuration) Initializes the report with provided the report configuration.void
reportCucumberBackground
(String stepName, String description) void
reportCucumberExample
(String stepName, String description) void
reportCucumberFeature
(String stepName, String description) void
reportCucumberScenario
(String stepName, String description) void
reportCucumberStep
(String stepName, String description) Starts a Cucumber step section in the run results report with default status "Passed".void
reportEvent
(String stepName, String description) Adds a custom step to the run results report with default status "Passed".void
reportEvent
(String stepName, String description, Status status) Adds a custom step to the report.void
reportEvent
(String stepName, String description, Status status, RenderedImage image) Adds a custom step to the report including the provided image object.void
reportEvent
(String stepName, String description, Status status, String imagePath) Adds a custom step to the report including the image from the specified path.void
reportEvent
(String stepName, String description, Status status, Throwable e) Adds a custom step to the run results report including the provided exception.void
reportEvent
(String stepName, String description, Status status, Throwable e, RenderedImage image) Adds a custom step to the run results report including the provided exception and image object.void
Adds a custom step to the run results report including exception details and the image from the specified path.void
reportEventWithInfo
(String stepName, ReportAdditionalInfo reportAdditionalInfo) Adds a custom step to the run results report including the information about the step as aReportAdditionalInfo
object.void
reportRuntimeError
(Throwable throwable) A Runtime error node will be added to the report with the suppliedThrowable
as the reason.void
reportVerification
(Status status, VerificationData verificationData) Adds a custom verification step to the report.void
setReportDescription
(String reportDescription) Sets the report description.void
setReportLevel
(ReportLevel reportLevel) Sets the report level used to generate the report.void
setReportTitle
(String reportTitle) Sets the report title.void
setSnapshotCaptureLevel
(CaptureLevel snapshotCaptureLevel) Sets the snapshot capture level used to generate the report.void
startReportingContext
(String contextName) Starts a named section in the report.void
startReportingContext
(String contextName, ReportContextInfo reportContextInfo) Starts a named section in the report.void
startReportingContext
(String contextName, String contextDescription) Starts a named section in the report.void
startReportingContext
(String contextName, String contextDescription, Map<String, Object> additionalInfo) Starts a named section in the report.void
startScreenRecording
(boolean useCompression, String outputPath) void
Starts a new test node in the report test flow tree.void
Starts a new test node in the report test flow tree.void
void
updateCucumberScenario
(String description) void
updateCucumberStep
(String description, Status status) Updates a Cucumber step section in the run results report.
-
Method Details
-
getReportConfiguration
ReportConfiguration getReportConfiguration()Returns theReportConfiguration
interface, which enables you to customize the report behavior.- Returns:
- Report Configuration.
-
reportEvent
Adds a custom step to the report.- Parameters:
stepName
- the name of the reported step. This name is the label of the step node in the report.description
- the description of the reported step. The description is displayed in the Details pane of the report.status
- theStatus
for the step.- Throws:
ReportException
- if error occurs in the report
-
reportEvent
void reportEvent(String stepName, String description, Status status, String imagePath) throws ReportException Adds a custom step to the report including the image from the specified path.- Parameters:
stepName
- the name of the reported step. This name is the label of the step node in the report.description
- the description of the reported step. The description is displayed in the Details pane of the report.status
- theStatus
for the step.imagePath
- the full path of the image to display for the step. Supported image types: BMP, GIF, JPEG, PNG, TIFF- Throws:
ReportException
- if error occurs in the report
-
reportEvent
void reportEvent(String stepName, String description, Status status, Throwable e) throws ReportException Adds a custom step to the run results report including the provided exception.- Parameters:
stepName
- the name of the reported step. This name is the label of the step node in the report.description
- the description of the reported step. The description is displayed in the Details pane of the report.status
- theStatus
for the step.e
- the error that occurred.- Throws:
ReportException
- if error occurs in the report
-
reportEvent
void reportEvent(String stepName, String description, Status status, Throwable e, String imagePath) throws ReportException Adds a custom step to the run results report including exception details and the image from the specified path.- Parameters:
stepName
- the name of the reported step. This name is the label of the step node in the report.description
- the description of the reported step. The description is displayed in the Details pane of the report.status
- theStatus
for the step.e
- the error that occurred.imagePath
- the full path of the image to display for the step. Supported image types: BMP, GIF, JPEG, PNG, TIFF- Throws:
ReportException
- if error occurs in the report
-
reportEvent
Adds a custom step to the run results report with default status "Passed".- Parameters:
stepName
- the name of the reported step. This name is the label of the step node in the report.description
- the description of the reported step. The description is displayed in the Details pane of the report.- Throws:
ReportException
- if error occurs in the report
-
reportEvent
void reportEvent(String stepName, String description, Status status, RenderedImage image) throws ReportException Adds a custom step to the report including the provided image object.- Parameters:
stepName
- the name of the reported step. This name is the label of the step node in the report.description
- the description of the reported step. The description is displayed in the Details pane of the report.status
- theStatus
for the step.image
- the RenderedImage object to use for the step.- Throws:
ReportException
- if error occurs in the report
-
reportEvent
void reportEvent(String stepName, String description, Status status, Throwable e, RenderedImage image) throws ReportException Adds a custom step to the run results report including the provided exception and image object.- Parameters:
stepName
- the name of the reported step. This name is the label of the step node in the report.description
- the description of the reported step. The description is displayed in the Details pane of the report.status
- theStatus
for the step.e
- the error that occurred.image
- the RenderedImage object to use for the step.- Throws:
ReportException
- if error occurs in the report
-
reportEventWithInfo
void reportEventWithInfo(String stepName, ReportAdditionalInfo reportAdditionalInfo) throws ReportException Adds a custom step to the run results report including the information about the step as aReportAdditionalInfo
object.- Parameters:
stepName
-reportAdditionalInfo
-- Throws:
ReportException
-
addRunInformation
Adds a custom entry to the top section of the report.- Parameters:
fieldName
- the entry name.fieldValue
- the entry value
-
startReportingContext
Starts a named section in the report.- Parameters:
contextName
- the section name.- Throws:
ReportException
- if error occurs in the report
-
startReportingContext
Starts a named section in the report.- Parameters:
contextName
- the section name.contextDescription
- the section description.- Throws:
ReportException
- if error occurs in the report
-
startReportingContext
void startReportingContext(String contextName, String contextDescription, Map<String, Object> additionalInfo) throws ReportExceptionStarts a named section in the report.- Parameters:
contextName
- the section name.contextDescription
- the section description.additionalInfo
- the map containing additional custom information- Throws:
ReportException
- if error occurs in the report
-
startReportingContext
void startReportingContext(String contextName, ReportContextInfo reportContextInfo) throws ReportException Starts a named section in the report.- Parameters:
contextName
- the section name.reportContextInfo
-ReportContextInfo
object which contain the information to describe the section.- Throws:
ReportException
- if error occurs in the report
-
endReportingContext
Ends the section in the report.- Throws:
ReportException
- if error occurs in the report
-
startTest
Starts a new test node in the report test flow tree. Required only when using Reporter in a class that does not inherit from UnitTestBase.- Parameters:
testName
- name of the test.- Throws:
ReportException
- if error occurs in the report
-
startTest
Starts a new test node in the report test flow tree.- Parameters:
testName
- the test name.testDescription
- the test description.- Throws:
ReportException
- if error occurs in the report
-
endTest
Ends the current test level and sets the test status as passed.- Throws:
ReportException
- if error occurs in the report
-
endTest
Ends the current test level and sets the specified status for the test.- Parameters:
status
- theStatus
for the current test.- Throws:
ReportException
- if error occurs in the report
-
init
Initializes the report with provided the report configuration.- Parameters:
configuration
- theReportConfiguration
to use.- Throws:
ReportException
- if error occurs in the report
-
init
Initializes the report with the default configuration, as defined in the report section of the leanft.properties file.- Throws:
ReportException
- if error occurs in the report
-
generateReport
Generates the report.- Returns:
- the XML file path on which the report is based.
- Throws:
ReportException
- if error occurs in the report
-
getReportDescription
String getReportDescription()Returns the description of the run results report. The description appears directly below the title in the report. By default, the description is empty.- Returns:
- report the report description.
-
setReportDescription
Sets the report description. The description appears directly below the title in the report.- Parameters:
reportDescription
- The description to use for the report.
-
getReportTitle
String getReportTitle()Returns the run results report title. Default = Run Results.- Returns:
- the report title.
-
setReportTitle
Sets the report title.- Parameters:
reportTitle
- the report description to use.
-
getReportLevel
ReportLevel getReportLevel()Returns the report level used to generate the report.- Returns:
- the
ReportLevel
.
-
setReportLevel
Sets the report level used to generate the report.- Parameters:
reportLevel
- the report level to use. Possible values:ReportLevel
-
getSnapshotCaptureLevel
CaptureLevel getSnapshotCaptureLevel()Returns the snapshot capture level used to generate the report.- Returns:
- the
CaptureLevel
.
-
setSnapshotCaptureLevel
Sets the snapshot capture level used to generate the report.- Parameters:
snapshotCaptureLevel
- theCaptureLevel
to use.
-
getRuntimeStatus
Status getRuntimeStatus()Returns the runtime status of the report.- Returns:
- the
Status
.
-
reportVerification
Adds a custom verification step to the report.- Parameters:
status
- Specify the status of the verification.verificationData
- The report verification data.- Throws:
ReportException
- if error occurs in the report
-
reportCucumberStep
Starts a Cucumber step section in the run results report with default status "Passed".- Parameters:
stepName
- the name of the reported step. This name is the label of the step node in the report.description
- the description of the reported step. The description is displayed in the Details pane of the report.- Throws:
ReportException
- if error occurs in the report
-
updateCucumberStep
Updates a Cucumber step section in the run results report.- Parameters:
description
- the description of the reported step. The description is displayed in the Details pane of the report.status
- theStatus
for the step.- Throws:
ReportException
- if error occurs in the report
-
endCucumberStep
- Throws:
ReportException
-
reportCucumberFeature
- Throws:
ReportException
-
endCucumberFeature
- Throws:
ReportException
-
reportCucumberScenario
- Throws:
ReportException
-
updateCucumberScenario
- Throws:
ReportException
-
endCucumberScenario
- Throws:
ReportException
-
reportCucumberBackground
- Throws:
ReportException
-
endCucumberBackground
- Throws:
ReportException
-
reportCucumberExample
- Throws:
ReportException
-
endCucumberExample
- Throws:
ReportException
-
reportRuntimeError
A Runtime error node will be added to the report with the suppliedThrowable
as the reason. The report status will be set to failed.- Parameters:
throwable
- the reason for the report failure.
-
getCurrentExecutionContextStatus
Status getCurrentExecutionContextStatus()Returns the status of the current execution context. The execution context is equivalent to any superior structure that contains operations (e.g.: test method, reporting context, etc.).- Returns:
- The status of the current execution context as a
Status
object.
-
startScreenRecording
- Throws:
ReportException
-
stopScreenRecording
- Throws:
ReportException
-