Interface IReporter
Accesses the HTML Report.
Namespace: HP.LFT.Report
Assembly: HP.LFT.Report.dll
Syntax
public interface IReporter
Properties
ReportConfiguration
Returns the ReportConfiguration interface, which enables you to customize the report behavior.
Declaration
IReportConfiguration ReportConfiguration { get; }
Property Value
| Type | Description |
|---|---|
| IReportConfiguration |
ReportDescription
the report description. The description appears directly below the title in the report. By default, the description is empty.
Declaration
string ReportDescription { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ReportLevel
The report level used to generate the report.
Declaration
ReportLevel ReportLevel { get; set; }
Property Value
| Type | Description |
|---|---|
| ReportLevel |
ReportTitle
the report title. Default = Run Results.
Declaration
string ReportTitle { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
SnapshotCaptureLevel
The snapshot capture level used to generate the report.
Declaration
CaptureLevel SnapshotCaptureLevel { get; set; }
Property Value
| Type | Description |
|---|---|
| CaptureLevel | Possible values: CaptureLevel |
Status
The runtime status of the report.
Declaration
Status Status { get; }
Property Value
| Type | Description |
|---|---|
| Status | Possible values: Status |
Methods
AddRunInformation(string, string)
Adds a custom entry to the top section of the report.
Declaration
void AddRunInformation(string fieldName, string fieldValue)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fieldName | The entry name. |
| string | fieldValue | The entry value. |
EndReportingContext()
Ends the section in the report.
Declaration
void EndReportingContext()
EndTest(Status)
Ends the current test level and optionally sets the status for the test.
Declaration
void EndTest(Status status = Status.Passed)
Parameters
| Type | Name | Description |
|---|---|---|
| Status | status | Optional. The Status for the current test. Default = Passed. |
Remarks
Required only when using IReporter in a test class that does not inherit from UnitTestBase.
GenerateReport()
Generates the report.
Declaration
string GenerateReport()
Returns
| Type | Description |
|---|---|
| string | The path of the generated report folder. |
Remarks
Required only when using IReporter in a test class that does not inherit from UnitTestBase.
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.).
Declaration
Status GetCurrentExecutionContextStatus()
Returns
| Type | Description |
|---|---|
| Status | The status of the current execution context as a ReportLevel object. |
Init(ReportConfiguration)
Initializes the specified ReportConfiguration.
Declaration
void Init(ReportConfiguration configuration)
Parameters
| Type | Name | Description |
|---|---|---|
| ReportConfiguration | configuration | The configuration to use for the report. |
Remarks
Required only when using IReporter in a test class that does not inherit from UnitTestBase.
ReportEvent(string, ReportAdditionalInfo)
Adds a custom step to the report including the information about the step as a ReportAdditionalInfo object.
Declaration
void ReportEvent(string stepName, ReportAdditionalInfo reportAdditionalInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| string | stepName | |
| ReportAdditionalInfo | reportAdditionalInfo |
ReportEvent(string, string)
Adds a custom step to the report with default status "Passed".
Declaration
void ReportEvent(string stepName, string description)
Parameters
| Type | Name | Description |
|---|---|---|
| string | stepName | The name of the reported step. This name is the label of the step node in the report. |
| string | description | The description of the reported step. The description is displayed in the Details pane of the report. |
ReportEvent(string, string, Status, Image)
Adds a custom step to the report including the provided image object.
Declaration
void ReportEvent(string stepName, string description, Status status, Image image)
Parameters
| Type | Name | Description |
|---|---|---|
| string | stepName | The name of the reported step. This name is the label of the step node in the report. |
| string | description | The description of the reported step. The description is displayed in the Details pane of the report. |
| Status | status | The Status for the step. |
| Image | image | The Image to use for the step. |
ReportEvent(string, string, Status, Exception, Image)
Adds a custom step to the report including the provided exception and image object.
Declaration
void ReportEvent(string stepName, string description, Status status, Exception ex, Image image)
Parameters
| Type | Name | Description |
|---|---|---|
| string | stepName | The name of the reported step. This name is the label of the step node in the report. |
| string | description | The description of the reported step. The description is displayed in the Details pane of the report. |
| Status | status | The Status for the step. |
| Exception | ex | The exception that occurred. |
| Image | image | The Image to use for the step. |
ReportEvent(string, string, Status, Exception, string)
Adds a custom step to the report including exception details and the image from the specified path.
Declaration
void ReportEvent(string stepName, string description, Status status, Exception ex, string imagePath = "")
Parameters
| Type | Name | Description |
|---|---|---|
| string | stepName | The name of the reported step. This name is the label of the step node in the report. |
| string | description | The description of the reported step. The description is displayed in the Details pane of the report. |
| Status | status | The Status for the step. |
| Exception | ex | The exception that occurred. |
| string | imagePath | The full path of the image to display for the step. Supported image types: BMP, GIF, JPEG, PNG, TIFF |
ReportEvent(string, string, Status, string)
Adds a custom step to the report including the image from the specified path.
Declaration
void ReportEvent(string stepName, string description, Status status, string imagePath = "")
Parameters
| Type | Name | Description |
|---|---|---|
| string | stepName | The name of the reported step. This name is the label of the step node in the report. |
| string | description | The description of the reported step. The description is displayed in the Details pane of the report. |
| Status | status | The Status for the step. |
| string | imagePath | The full path of the image to display for the step. Supported image types: BMP, GIF, JPEG, PNG, TIFF |
ReportVerification(Status, VerificationData)
Adds a custom verification step to the report.
Declaration
void ReportVerification(Status reportStatus, VerificationData verificationData)
Parameters
| Type | Name | Description |
|---|---|---|
| Status | reportStatus | The Status for the verification. |
| VerificationData | verificationData | The VerificationData data. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
StartReportingContext(string, ReportContextInfo)
Starts a named section in the report.
Declaration
void StartReportingContext(string contextName, ReportContextInfo reportContextInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| string | contextName | The section name. |
| ReportContextInfo | reportContextInfo | The ReportAdditionalInfo object which contains the information to describe the section. |
StartReportingContext(string, string, IDictionary<string, object>)
Starts a named section in the report.
Declaration
void StartReportingContext(string contextName, string contextDescription = "", IDictionary<string, object> additionalData = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | contextName | The section name. |
| string | contextDescription | Optional. The section description. Blank by default. |
| IDictionary<string, object> | additionalData | Optional. The dictionary containing additional custom information. Blank by default. |
StartScreenRecording()
Starts a screen recording which will be saved to the report folder. Compression is ON. The recording file format is ".avi".
Declaration
void StartScreenRecording()
StartScreenRecording(bool)
Starts a screen recording which will be saved to the report folder. The recording file format is ".avi".
Declaration
void StartScreenRecording(bool useCompression)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | useCompression | if the recorded video represents a time lapse of the recorded scene, otherwise the full scene gets recorded
|
StartScreenRecording(bool, string)
Starts screen recording. The recording file format is ".avi".
Declaration
void StartScreenRecording(bool useCompression, string outputPath)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | useCompression | if the recorded video represents a time lapse of the recorded scene, otherwise the full scene gets recorded
|
| string | outputPath | target location for the recorded video |
StartScreenRecording(string)
Starts screen recording. Compression is ON. The recording file format is ".avi".
Declaration
void StartScreenRecording(string outputPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | outputPath | target location for the recorded video |
StartTest(string, string)
Starts a new test node in the report test flow tree.
Declaration
void StartTest(string testName, string testDescription = "")
Parameters
| Type | Name | Description |
|---|---|---|
| string | testName | The test name. |
| string | testDescription | Optional. The test description. Default = blank. |
Remarks
Required only when using IReporter in a class that does not inherit from UnitTestBase.
StopScreenRecording()
Stops screen recording.
Declaration
void StopScreenRecording()