Open topic with navigation

com.hp.lft.report

## Interface ReportProvider

-     public interface ReportProvider

  Accesses the LeanFT Report Module.

- - ### Method Summary

    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRunInformation(java.lang.String fieldName, java.lang.String fieldValue)` Adds a custom entry to the top section of the LeanFT report.
    `void` | `endCucumberBackground()`
    `void` | `endCucumberExample()`
    `void` | `endCucumberFeature()`
    `void` | `endCucumberScenario()`
    `void` | `endCucumberStep()`
    `void` | `endReportingContext()` Ends the section in the LeanFT report.
    `void` | `endTest()` Ends the current test level and sets the test status as passed.
    `void` | `endTest(Status status)` Ends the current test level and sets the specified status for the test.
    `java.lang.String` | `generateReport()` Generates the LeanFT report.
    `ReportConfiguration` | `getReportConfiguration()` Returns the `ReportConfiguration` interface, which enables you to customize the LeanFT report behavior.
    `java.lang.String` | `getReportDescription()` Returns the LeanFT report description.
    `ReportLevel` | `getReportLevel()` Returns the report level used to generate the LeanFT report.
    `java.lang.String` | `getReportTitle()` Returns the LeanFT report title.
    `Status` | `getRuntimeStatus()` Returns the runtime status of the LeanFT report.
    `CaptureLevel` | `getSnapshotCaptureLevel()` Returns the snapshot capture level used to generate the LeanFT 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(java.lang.String stepName, java.lang.String description)`
    `void` | `reportCucumberExample(java.lang.String stepName, java.lang.String description)`
    `void` | `reportCucumberFeature(java.lang.String stepName, java.lang.String description)`
    `void` | `reportCucumberScenario(java.lang.String stepName, java.lang.String description)`
    `void` | `reportCucumberStep(java.lang.String stepName, java.lang.String description)` Starts a Cucumber step section in the LeanFT with default status "Passed".
    `void` | `reportEvent(java.lang.String stepName, java.lang.String description)` Adds a custom step to the LeanFT with default status "Passed".
    `void` | `reportEvent(java.lang.String stepName, java.lang.String description, Status status)` Adds a custom step to the LeanFT report.
    `void` | `reportEvent(java.lang.String stepName, java.lang.String description, Status status, java.awt.image.RenderedImage image)` Adds a custom step to the LeanFT report including the provided image object.
    `void` | `reportEvent(java.lang.String stepName, java.lang.String description, Status status, java.lang.String imagePath)` Adds a custom step to the LeanFT report including the image from the specified path.
    `void` | `reportEvent(java.lang.String stepName, java.lang.String description, Status status, java.lang.Throwable e)` Adds a custom step to the LeanFT including the provided exception.
    `void` | `reportEvent(java.lang.String stepName, java.lang.String description, Status status, java.lang.Throwable e, java.awt.image.RenderedImage image)` Adds a custom step to the LeanFT including the provided exception and image object.
    `void` | `reportEvent(java.lang.String stepName, java.lang.String description, Status status, java.lang.Throwable e, java.lang.String imagePath)` Adds a custom step to the LeanFT including exception details and the image from the specified path.
    `void` | `reportRuntimeError(java.lang.Throwable throwable)` A Runtime error node will be added to the report with the supplied `Throwable` as the reason.
    `void` | `reportVerification(Status status, VerificationData verificationData)` Adds a custom verification step to the LeanFT report.
    `void` | `setReportDescription(java.lang.String reportDescription)` Sets the LeanFT report description.
    `void` | `setReportLevel(ReportLevel reportLevel)` Sets the report level used to generate the LeanFT report.
    `void` | `setReportTitle(java.lang.String reportTitle)` Sets the report title.
    `void` | `setSnapshotCaptureLevel(CaptureLevel snapshotCaptureLevel)` Sets the snapshot capture level used to generate the LeanFT report.
    `void` | `startReportingContext(java.lang.String contextName)` Starts a named section in the LeanFT report.
    `void` | `startReportingContext(java.lang.String contextName, java.lang.String contextDescription)` Starts a named section in the LeanFT report.
    `void` | `startTest(java.lang.String testName)` Starts a new test node in the LeanFT report test flow tree.
    `void` | `startTest(java.lang.String testName, java.lang.String testDescription)` Starts a new test node in the LeanFT report test flow tree.
    `void` | `updateCucumberScenario(java.lang.String description)`
    `void` | `updateCucumberStep(java.lang.String description, Status status)` Updates a Cucumber step section in the LeanFT.

- - ### Method Detail

    - #### getReportConfiguration

          ReportConfiguration getReportConfiguration()

      Returns the `ReportConfiguration` interface, which enables you to customize the LeanFT report behavior.
      Returns:
        Report Configuration.

    - #### reportEvent

          void reportEvent(java.lang.String stepName,
                           java.lang.String description,
                           Status status)
                    throws ReportException

      Adds a custom step to the LeanFT 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` - the `Status` for the step.
      Throws:
        `ReportException` - if error occurs in the report

    - #### reportEvent

          void reportEvent(java.lang.String stepName,
                           java.lang.String description,
                           Status status,
                           java.lang.String imagePath)
                    throws ReportException

      Adds a custom step to the LeanFT 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` - the `Status`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(java.lang.String stepName,
                           java.lang.String description,
                           Status status,
                           java.lang.Throwable e)
                    throws ReportException

      Adds a custom step to the LeanFT 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` - the `Status` for the step.
        `e` - the error that occurred.
      Throws:
        `ReportException` - if error occurs in the report

    - #### reportEvent

          void reportEvent(java.lang.String stepName,
                           java.lang.String description,
                           Status status,
                           java.lang.Throwable e,
                           java.lang.String imagePath)
                    throws ReportException

      Adds a custom step to the LeanFT 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` - the `Status` 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

          void reportEvent(java.lang.String stepName,
                           java.lang.String description)
                    throws ReportException

      Adds a custom step to the LeanFT 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(java.lang.String stepName,
                           java.lang.String description,
                           Status status,
                           java.awt.image.RenderedImage image)
                    throws ReportException

      Adds a custom step to the LeanFT 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` - the `Status` for the step.
        `image` - the RenderedImage object to use for the step.
      Throws:
        `ReportException` - if error occurs in the report

    - #### reportEvent

          void reportEvent(java.lang.String stepName,
                           java.lang.String description,
                           Status status,
                           java.lang.Throwable e,
                           java.awt.image.RenderedImage image)
                    throws ReportException

      Adds a custom step to the LeanFT 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` - the `Status` 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

    - #### addRunInformation

          void addRunInformation(java.lang.String fieldName,
                                 java.lang.String fieldValue)

      Adds a custom entry to the top section of the LeanFT report.
      Parameters:
        `fieldName` - the entry name.
        `fieldValue` - the entry value

    - #### startReportingContext

          void startReportingContext(java.lang.String contextName)
                              throws ReportException

      Starts a named section in the LeanFT report.
      Parameters:
        `contextName` - the section name.
      Throws:
        `ReportException` - if error occurs in the report

    - #### startReportingContext

          void startReportingContext(java.lang.String contextName,
                                     java.lang.String contextDescription)
                              throws ReportException

      Starts a named section in the LeanFT report.
      Parameters:
        `contextName` - the section name.
        `contextDescription` - the section description.
      Throws:
        `ReportException` - if error occurs in the report

    - #### endReportingContext

          void endReportingContext()
                            throws ReportException

      Ends the section in the LeanFT report.
      Throws:
        `ReportException` - if error occurs in the report

    - #### startTest

          void startTest(java.lang.String testName)
                  throws ReportException

      Starts a new test node in the LeanFT 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

          void startTest(java.lang.String testName,
                         java.lang.String testDescription)
                  throws ReportException

      Starts a new test node in the LeanFT report test flow tree.
      Parameters:
        `testName` - the test name.
        `testDescription` - the test description.
      Throws:
        `ReportException` - if error occurs in the report

    - #### endTest

          void endTest()
                throws ReportException

      Ends the current test level and sets the test status as passed.
      Throws:
        `ReportException` - if error occurs in the report

    - #### endTest

          void endTest(Status status)
                throws ReportException

      Ends the current test level and sets the specified status for the test.
      Parameters:
        `status` - the `Status` for the current test.
      Throws:
        `ReportException` - if error occurs in the report

    - #### init

          void init(ReportConfiguration configuration)
             throws ReportException

      Initializes the report with provided the report configuration.
      Parameters:
        `configuration` - the `ReportConfiguration` to use.
      Throws:
        `ReportException` - if error occurs in the report

    - #### init

          void init()
             throws ReportException

      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

          java.lang.String generateReport()
                                   throws ReportException

      Generates the LeanFT report.
      Returns:
        the XML file path on which the LeanFT report is based.
      Throws:
        `ReportException` - if error occurs in the report

    - #### getReportDescription

          java.lang.String getReportDescription()

      Returns the LeanFT report description. The description appears directly below the title in the LeanFT report. By default, the description is empty.
      Returns:
        report the LeanFT report description.

    - #### setReportDescription

          void setReportDescription(java.lang.String reportDescription)

      Sets the LeanFT report description. The description appears directly below the title in the LeanFT report.
      Parameters:
        `reportDescription` - The description to use for the report.

    - #### getReportTitle

          java.lang.String getReportTitle()

      Returns the LeanFT report title. Default = Run Results.
      Returns:
        the LeanFT report title.

    - #### setReportTitle

          void setReportTitle(java.lang.String reportTitle)

      Sets the report title.
      Parameters:
        `reportTitle` - the report description to use.

    - #### getReportLevel

          ReportLevel getReportLevel()

      Returns the report level used to generate the LeanFT report.
      Returns:
        the `ReportLevel`.

    - #### setReportLevel

          void setReportLevel(ReportLevel reportLevel)

      Sets the report level used to generate the LeanFT report.
      Parameters:
        `reportLevel` - the report level to use. Possible values: `ReportLevel`

    - #### getSnapshotCaptureLevel

          CaptureLevel getSnapshotCaptureLevel()

      Returns the snapshot capture level used to generate the LeanFT report.
      Returns:
        the `CaptureLevel`.

    - #### setSnapshotCaptureLevel

          void setSnapshotCaptureLevel(CaptureLevel snapshotCaptureLevel)

      Sets the snapshot capture level used to generate the LeanFT report.
      Parameters:
        `snapshotCaptureLevel` - the `CaptureLevel` to use.

    - #### getRuntimeStatus

          Status getRuntimeStatus()

      Returns the runtime status of the LeanFT report.
      Returns:
        the `Status`.

    - #### reportVerification

          void reportVerification(Status status,
                                  VerificationData verificationData)
                           throws ReportException

      Adds a custom verification step to the LeanFT report.
      Parameters:
        `status` - Specify the status of the verification.
        `verificationData` - The report verification data.
      Throws:
        `ReportException` - if error occurs in the report

    - #### reportCucumberStep

          void reportCucumberStep(java.lang.String stepName,
                                  java.lang.String description)
                           throws ReportException

      Starts a Cucumber step section in the LeanFT 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

          void updateCucumberStep(java.lang.String description,
                                  Status status)
                           throws ReportException

      Updates a Cucumber step section in the LeanFT.
      Parameters:
        `description` - the description of the reported step. The description is displayed in the Details pane of the report.
        `status` - the `Status` for the step.
      Throws:
        `ReportException` - if error occurs in the report

    - #### endCucumberStep

          void endCucumberStep()
                        throws ReportException

      Throws:
        `ReportException`

    - #### reportCucumberFeature

          void reportCucumberFeature(java.lang.String stepName,
                                     java.lang.String description)
                              throws ReportException

      Throws:
        `ReportException`

    - #### endCucumberFeature

          void endCucumberFeature()
                           throws ReportException

      Throws:
        `ReportException`

    - #### reportCucumberScenario

          void reportCucumberScenario(java.lang.String stepName,
                                      java.lang.String description)
                               throws ReportException

      Throws:
        `ReportException`

    - #### updateCucumberScenario

          void updateCucumberScenario(java.lang.String description)
                               throws ReportException

      Throws:
        `ReportException`

    - #### endCucumberScenario

          void endCucumberScenario()
                            throws ReportException

      Throws:
        `ReportException`

    - #### reportCucumberBackground

          void reportCucumberBackground(java.lang.String stepName,
                                        java.lang.String description)
                                 throws ReportException

      Throws:
        `ReportException`

    - #### endCucumberBackground

          void endCucumberBackground()
                              throws ReportException

      Throws:
        `ReportException`

    - #### reportCucumberExample

          void reportCucumberExample(java.lang.String stepName,
                                     java.lang.String description)
                              throws ReportException

      Throws:
        `ReportException`

    - #### endCucumberExample

          void endCucumberExample()
                           throws ReportException

      Throws:
        `ReportException`

    - #### reportRuntimeError

          void reportRuntimeError(java.lang.Throwable throwable)

      A Runtime error node will be added to the report with the supplied `Throwable` as the reason. The report status will be set to failed.
      Parameters:
        `throwable` - the reason for the report failure.