Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Apr 04, 2021 16:00

Perfecto Smart Reporting offers the following reports in PDF format:

  • Summary PDF report: Provides the full execution summary in PDF format, including a link to the Report Library to access the Single Test Reports that comprise the full execution (or multiple executions). This report is not available for download from the UI.

  • Full report: Provides a detailed report of a single test within the full test execution. This report is available for download from the UI.
  • Assertions report: Similar to the Full report, with the difference being that it only includes assertion commands. This is a valuable option if you only want to see if assertions were true or false. This report is available for download from the UI.

Demo video

The following video provides a quick overview of using formatted PDF reports.

On this page:

Summary PDF report

The Summary PDF report contains:

  • A header that presents a summary of the results of all tests in an execution. The header is repeated on each page of the report.
  • Execution metadata for the full execution: start time, end time, duration, and owner.
  • A link to the online Summary report.
  • A list of all single test units within the execution and a link to view the online STR for the specific test.

To obtain a URL to download this PDF:

  • Use the reportPdfUrl capability inside your test script. For example:

    String reportPdfUrl = (String)(driver.getCapabilities().getCapability("reportPdfUrl"));

You can use this URL in an API call to download the actual PDF file. For more information, see Smart Reporting Public API.

Download via API

Find a full code sample here.

Use the following HTTP GET command to retrieve the summary pdf report.

MethodAPI
GEThttps://<reporting-server>/export/api/v1/test-executions/pdf

Parameters

The following table lists some of the URL query parameters that can be added to the URL to filter the number of returned executions. All filter parameters are supported in formatted PDF reports and API requests. However, Perfecto only retrieves the first 1000 results, sorted by test start time.

Note:When transmitting URL parameters that include special characters, such as the bracket characters ('[', ']'), the URL should be URL-encoded. We suggest using tools that encode URL parameters, like those included in the Apache HTTP Client component.

NameValueDescription
externalId[0]<Driver execution id>Filters the data to show reports that match a specific driver execution
tags[0]<Reporting tag>Filters the data to show reports that match a specific tag
jobName[0]<CI Job Name>Filters the data to show reports that match a specific job name
jobNumber[0]<CI Job Number>Filters the data to show reports that match a specific job number

A request can combine any number of filter parameters (externalId, jobName, jobNumber) to achieve the filtered list.

Headers

Add the following header parameters to the request:

NameValue
PERFECTO-AUTHORIZATION

<Your personal security token>

Note: The Summary PDF report can contain a summary of up to 1000 reports.

Full report (STR) or Assertions report

The Full report contains all the details of a single test, as follows:

  • A header that includes the Test Label configured in the test script (for example the text associated with the test step), the status of the test execution (Passed, Failed, Blocked, or Unknown), and the start time of the execution.
  • The first page that details the following test metadata:
    • Execution details, including start time, end time, duration, owner
    • Device details, such as device type, id, OS, location
    • Test tags
    • Job and project information
  • Information on the execution of each script step and the commands in each step. This may spread over many pages.

The Assertion report contains only the assertion commands invoked in the automation script, along with information whether the asserted passed or failed.

To obtain the Full report or the Assertions report in PDF format:

Do one of the following:

  • In the Summary PDF report: Click the link to the right of the single test (see above).
  • In the Reporting Library:
    1. Click the test name.
    2. In the online STR, click the download icon  and select Full report or Assertions report.

Download via API

Find a full code sample here.

To download the single test report via API, you need to obtain a test ID via the public API, as described here.

The following set of HTTP commands is used to retrieve the Single Test PDF report:

Step 1 | Submit a request to generate the PDF report

MethodAPI
POSThttps://<reporting-server>/export/api/v2/test-executions/pdf/task

Parameters

NameValueDescription
testExecutionId<Test ID>Mandatory parameter. Smart Reporting test ID as returned via the public api as described here
assertionsOnlytrue|falseOptional parameter. Set to true for downloading the Assertions PDF report or to false to omit the parameter for the regular PDF report download.
_timeZoneOffsetMinutes
Optional parameter. Allows you to change the times in the report, for example to your local time zone. By default, all times are specified in UTC. For example, to set the times to Jerusalem time, which is GMT +3, set this value to 180.

The format of the response is a JSON structure with the following fields:

  • taskId
  • status: Either IN_PROGRESS or COMPLETE
  • url: The final URL to download the PDF when it is ready

Step 2 | Poll the task status by taskId until the PDF is ready and the API call returns the status COMPLETE

MethodAPI
POSThttps://<reporting-server>/export/api/v2/test-executions/pdf/task/<taskId>

Parameters

NameValueDescription
taskId
<Task ID>ID of the task that was returned by the initial API call

The format of the response is a JSON structure with the following fields:

  • taskId
  • status: Either IN_PROGRESS or COMPLETE
  • url: The final URL to download the PDF when it is ready

Step 3 | Download the PDF file from the URL specified in the URL field of the response

Headers

Add the following header parameters to all requests:

NameValue
PERFECTO-AUTHORIZATION

<Your personal security token>

Limitations

Exported PDF reports cannot include more than 200 screenshots.