---
title: "Document Generator Template: Test Report"
canonical: "https://docs.getxray.app/space/XRAYCLOUD/44578494/Document%20Generator%20Template%3A%20Test%20Report"
format: markdown
---
> Macro (ui-expand)
> 
> > Macro (toc)

# Introduction

The Test Report enables you to extract the detailed specifications of [Tests](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565156) so that you can generate a document that contains a snapshot of the latest specifications. This can be used for revision/approval, or even to share it with someone else that hasn't access to Jira and wishes to pursue testing.

Possible usage scenarios:

- See the detailed specification of the Test(s), including the [Test Steps](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565316) of manually scripted Test Cases and the [Gherkin](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565320) of [BDD Test Scenarios](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44577261).
- See all [Preconditions](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565159) required by the Test(s).
- See all the Requirements covered by Test(s).
- See all [Test Sets](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565163) where the Test(s) are included.
- See all [Test Plans](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565153) where the Test(s) are included.

## Output Example(s)

Figure 1, 2, 3, and 4 show an example of the sections you can find in this report.

![Figure 1 - Report](media://0fb3e18d-ce8f-4267-acbe-469bb2bb3fc1)

![Figure 2 - Report](media://58d76ac0-e562-4897-b228-8e125637f288)

![Figure 3 - Report](media://33f74fc5-3270-43dc-aca7-e136834a5559)

![Figure 4 - Report](media://2885275d-bf95-4ca2-80e8-c888b44e6d0f)

# Operations

## Using the Report

### Access

#### From the Issue Search/Navigator Screen

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> 
> > Macro (legacy-content)

### From the [Document Generator Template: Test Report](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44578494)/[Test Plan Board](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44578494)

> Macro (rw-ui-steps-macro)
> 
> > Macro (rw-step)
> 
> Go to your project and access the Testing Board by clicking *More* (Figure 8 - 1) and then *Testing Board* (Figure 8 - 2).
> 
> ![Figure 8 - Testing Board](media://724382b9-691f-428b-a832-6ec45613e0d6)
> 
> > Macro (rw-step)
> 
> Click the navigation drawer icon (Figure 9 - 1).
> 
> ![Figure 9 - Testing board](media://bbb459d9-5ea3-4e8e-8658-9f8d88059063)
> 
> > Macro (rw-step)
> 
> Click *Test Repository* (Figure 10 - 1).
> 
> ![Figure 10 - Test repository](media://fe01fc2e-7daf-4786-8faf-0c3e745e0754)
> 
> > Macro (rw-step)
> 
> On the Test Repository (Figure 11), select the Test/s required for the exportation by selecting a folder, sub-folder, or selecting the Tests in the list (Figure 11 - 1). A box with options will appear: select *Document Generator* (Figure 11 - 2).
> 
> A modal will open (Figure 12).
> 
> ![Figure 11 - Tests](media://62572986-9743-4dc4-9aac-c599fa30aded)
> 
> > Macro (rw-step)
> 
> In the modal (Figure 12), select *Test Report* in the *Template* field (Figure 12 - 1), and the *Output Format* (Figure 12 - 2).
> 
> When you're finished, click *Export* (Figure 12 - 3).
> 
> ![Figure 12 - Export.png](media://c6ddbe7e-3ccf-441e-9f41-6ba4e12fbcdf)
> 
> > Macro (rw-step)
> 
> The export operation will start (Figure 13). Once it's finished, click the *Download* button (Figure 13 - 1). You will get the file immediately on your machine.
> 
> ![Figure 13 - Download](media://e7ce4173-1ab5-49e1-9c33-67e562e82530)
> 
> > ℹ️ The process is the same for exporting Test Plans. To access Test Plans, on the *Test Boarding* (Figure 14), select *Test Plans* (Figure 14 - 1).
> > ℹ️ 
> > ℹ️ ![Figure 14 - Test plans](media://95239acc-2fa4-4170-a2ba-adade7894da7)


> ℹ️ **Learn More**
> ℹ️ 
> ℹ️ General information about all the existing places available to export from, and how to perform it, is available on the [Exporting](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565173) page.

### Source Data

This report is applicable to one or more Test Issues.

### Output Format

The standard output format is DOCX, so you can open it in Microsoft Word, Google Docs, and other tools compatible with this format.

You can also export it to PDF.

### Report Assumptions

The report has a set of assumptions that you have to make sure your Jira/Xray environment complies with:

- Issue types having these names: "Test", "Test Set", "Test Plan".
- Tests use the "Tests" Issue link type to cover Issues (e.g., Story)

If any of these assumptions are not met, you need to update the report accordingly.

### Usage Examples

#### Exporting the Test Specification of all Tests Having the "HCP Login" Component, or by Other Criteria Based on the Test Issue Fields

> Macro (rw-ui-steps-macro)
> 
> > Macro (rw-step)
> 
> Go to the *Filters* (Figure 15 - 1) and select *View all issues* (Figure 15 - 2). 
> 
> Click *Create filter* (Figure 15 - 3).
> 
> ![Figure 15 - Filters](media://043ae61a-41da-4fc4-99c6-84c199b0efd5)
> 
> > Macro (rw-step)
> 
> Click *More filters* (Figure 16 - 1) and then search for and select *Components* (Figure 16 - 2).
> 
> ![Figure 16 - Components.png](media://d0b415f2-7cee-4b22-9cfb-017ccd189305)
> 
> > Macro (rw-step)
> 
> Select "HCP Login" (Figure 14 - 2), or search by other criteria based on the Test Issue's fields.
> 
> Enter the Issue (Figure 17 - 2).
> 
> ![Figure 17 - HCP](media://ff88fef6-6153-4fd0-a947-ec1759bb3a99)
> 
> > Macro (rw-step)
> 
> On the Issue, click the ellipsis button (Figure 18 - 1) and select *Xray - Document Generator* (Figure 18 - 2).
> 
> A modal will open (Figure 19).
> 
> ![Figure 18 - Issue](media://59ca954b-5540-4cfa-ba4e-4dd23730908c)
> 
> > Macro (rw-step)
> 
> In the modal (Figure 19), select *Test Report* in the *Template* field (Figure 19 - 1), and the *Output Format* (Figure 19 - 2).
> 
> When you're finished, click *Export* (Figure 19 - 3).
> 
> ![Figure 19 - Modal](media://003473b4-da38-4775-8bcf-4f17831c0ded)
> 
> > Macro (rw-step)
> 
> The export operation will start (Figure 18). Once it's finished, click the *Download* button (Figure 18 - 1). You will get the file immediately on your machine.
> 
> ![Figure 20 - Download](media://2580f49d-be38-4914-94d4-7d0d57ccdcc7)


#### Exporting the Test Specification for all Tests Contained in a Test Repository Folder (Excluding Sub-Folders)

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)

#### Exporting the Test Specification for all Tests Contained in a Test Repository Folder (Including Sub-Folders)

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)

#### Exporting the Test Specification for all Tests Contained in a Test Plan Folder (Excluding/Including Sub-Folders)

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)

#### Export the Test Specification for all Tests Contained in a Test Plan or One of its Folders (Including Sub-Folders)

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)

## Understanding the Report

The Test Report shows detailed information about the Tests, focused on their specification (e.g., manual Steps, Gherkin, Test charter).

### Layout

The report is composed of several sections. Two major sections are available: *Introduction* and *[Test Executions](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565117)* details.

By default, and to avoid overload/redundancy of information, only the "Introduction" section will be rendered; you can change this behavior on the template (more info ahead).

#### Introduction Section

This section is divided into three sub-sections:

1. Document overview.
2. Total Tests.
3. Requirements covered by these Tests.

Each of these sections is explained below.

##### Document Overview

Brief description of what you will find in this report and how it was generated.

##### Total Tests

In this section, the total Tests are grouped by their Test Type, and a count is shown.

| **Test Type** | **Number of Tests** |
| --- | --- |
| Manual | The number of Tests that are Step/script-based; usually these are known as "manual" (even though "manual" is a rough simplification) |
| Gherkin | The number of Gherkin-based Tests; usually these correspond to Cucumber Test scenarios, with the Test Type Cucumber; but it may also refer to other Gherkin-based frameworks |
| Unstructured | The number of tests that are neither scripted nor Gherkin-based; usually, these correspond to unstructured Tests; this includes the tests having Test Type "Generic", "Exploratory", etc. |

> ℹ️ If you wish to count Tests by custom Test Types, you can do so. See more information ahead on how to customize this report.

The output will have the following information (Figure 36).

![Figure 36 - Output](media://797654fc-8a32-4f2a-aff1-326697b13c9b)

##### Requirements Covered by These Tests

In this section, there's an overview of all the requirements that are covered by the Tests in this report.

| **Field** | **Description** | **Code** |
| --- | --- | --- |
| Key | Key of the requirement (in this case, we are adding it as a link) | @{title=${Links[j].Key}|href=${BaseURL}/browse/${Links[j].Key}} |
| Summary | Summary of the requirement | ${Links[j].Summary} |
| Version | Project version assigned to the requirement | ${Links[j].FixVersions} |
| Workflow Status | Workflow Status of the requirement | ${Links[j].Status} |


The Requirements are listed in a table as follows (Figure 37).

![Figure 37 - Table](media://251e2d53-91f2-42f0-9205-7f1a22247d8b)


#### Test Execution Details

This section will gather all the information related to each Test, focused on its specification.

It is composed of several sub-sections that will be filled with information if it is available, or be filled with a message showing that no information is available.

##### Test Summary

This section has a table with information regarding each Test in this report (and will repeat these sections for each Test).

The information is presented as a table with the following fields:

| **Field** | **Description** | **Code** |
| --- | --- | --- |
| *Test Type* | Test Type | *${TestType}* |
| *Label(s)* | Labels assigned to the Test Issue | *${Labels}* |
| *Component(s)* | Components assigned to the Test Issue | *${Components}* |
| *Priority* | Priority assigned to the Test Issue | *${Priority}* |


The resulting table will look like the one below (Figure 38).

![Figure 38 - Table](media://bdb4844d-4d0c-4502-aad2-2b5af4185721)

##### Test Description

The description of the Test (*${wiki:Description}*) (Figure 39).

![Figure 39 - Description](media://1599af81-96f4-4e71-8842-b0fd588d2bd6)

##### Test Issue Attachments

This section only appears if you have any attachments associated with the Test.

| **Key** | **Description** |
| --- | --- |
| File Name | File Name of the Attachment |
| Author | The Author of the attachment |
| File Size | File Size of the attachments in bytes. |


This appears in the document in a table form (Figure 40). A thumbnail is shown for images.

![Figure 36 - Table](media://e00c7ff5-34a4-4474-85f0-d2477534e7af)

#### Status of the Last Execution

This section shows the last execution status for the Test (Figure 41).

![Figure 41 - Execution](media://058fced2-8b0a-4b69-9eca-7f90735b1b3e)

#### Requirements

In this section, there's an overview of all the Requirements covered by the Test.

| **Field** | **Description** | **Code** |
| --- | --- | --- |
| Key | Key of the requirement (in this case, we are adding it as a link) | *@{title=${Links[j].key}|href=${BaseURL}/browse/${Links[j].Key}}* |
| Summary | Summary of the requirement | *${Links[j].Summary}* |
| Version | Project version assigned to the requirement | *${Links[j].FixVersions}* |
| Workflow Status | Workflow Status of the requirement | *${Links[j].Status}* |


The Requirements are listed in a table as follows (Figure 42).

![Figure 42 - Table](media://c575fed0-d654-4a8c-ad10-644c2e1037c4)

##### Preconditions

If the Test requires any Preconditions, they will be shown in the report.

| **Key** | **Description** | **Code** |
| --- | --- | --- |
| *Key* | Jira Key of the Precondition in the form of a link | *@{title=${PreConditions[n].Key}|href=${BaseURL}/browse/${PreConditions[n].Key}}* |
| *Summary* | Summary of the Precondition | *${PreConditions[n].Summary}* |
| *Condition* | Condition | *${wiki:PreConditions[n].Definition}* |


The Preconditions are listed in a table as follows (Figure 43).

![Figure 43 - Preconditions](media://3969dedd-73d2-47a0-a030-424f7676739a)

##### Test Details

This section shows the Test details; for that, we are considering the different possible Test Types we can have in Xray. For each Type, we will fetch different information.

| **Type** | **Key** | **Description** | **Code** | **Output** |
| --- | --- | --- | --- | --- |
| Unstructured<br>(e.g., "Generic") | Test Type | Test Type field | *${TestType}* | ![Output](media://7a876e42-f887-4891-b92e-7d8089518acb) |
| Specification | Definition of the Generic test | ${Generic Test Definition} |
| Gherkin<br>(e.g., "Cucumber") | Test Type | Test Type field | *${TestType}* | ![Output2](media://05172ee6-ec6a-44a1-9b70-d107930544c1) |
| Gherkin Specification | Gherkin specification of the Test | *${Cucumber* Scenario} |
| Structured<br>(e.g., "Manual") | (Step) | Step Number | *${TestSteps[m].StepNumber}* | ![Output3](media://2022a4ab-1355-4a72-b0db-f7ceba449688) |
| Action | Action of the Test Step | *${TestSteps[m].Action}* |
| Step Custom Fields | Step Custom Fields | *${TestSteps[m].StepCustomFieldXX}*<br>Note: needs to be explicitly defined on the template; by default, no step custom fields will be shown. |
| Data | Data of the Test Step | *${TestSteps[m].Data}* |
| Expected Result | Expected Result of the Test Step | *${TestSteps[m].ExpectedResult}* |
| Attachments | Attachment of the Test Step; images will be rendered | *@{title=${TestSteps[m].Attachments[sa].Name}|href=${TestSteps[m].Attachments[sa].FileURL}}*<br>*!{${TestSteps[m].Attachments[sa].Attachment}|maxwidth=100}* |

> ℹ️ **Called Tests**
> ℹ️ 
> ℹ️ If a Step calls another Test passing its [Parameters](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44565547), then the called Test key is mentioned and a table is shown with the parameters for the called Test.

| **Field** | **Description** | **Code** |
| --- | --- | --- |
| Parameter | Parameter name | *${TestSteps[m].CalledParameters[p].Name}* |
| Value | Value of the Parameter | *${TestSteps[m].CalledParameters[p].Value}* |

##### Test Sets

If the Test is part of Test Sets, they will be shown.

| **Key** | **Description** | **Code** |
| --- | --- | --- |
| *Key* | Key of the Test Set in the form of a link | *@{title=${TestSets[x].Key}|href=${BaseURL}/browse/${TestSets[x].Key}}* |
| *Summary* | Summary of the Test Set | *${TestSets[x].Summary}* |
| *Version* | Project version assigned to the Test Set | *${TestSets[x].FixVersions}* |

The Test Sets are listed in a table as follows (Figure 44).

![Figure 44 - Test sets](media://2247126e-4596-474d-83bf-a531dacc4af5)

##### Test Plans

If the Test is part of Test Plans, they will be shown in the report.

| **Key** | **Description** | **Code** |
| --- | --- | --- |
| *Key* | Key of the Test Plan in the form of a link | *@{title=${TestPlans[x].Key}|href=${BaseURL}/browse/${TestPlans[x].Key}}* |
| *Summary* | Summary of the Test Plan | *${TestPlans[x].Summary}* |
| *Version* | Project version assigned to the Test Plan | *${TestPlans[x].FixVersions}* |

The Test Plans are listed in a table as follows (Figure 45).

![Figure 45 - Table](media://9af05eea-cac1-46ca-9d0c-c0d47b3006c2)

### Appendix A: Approval

This section (Figure 45) is added for the cases where you need to have a signature validating the document.

## Customizing the Report

### <span style="color: #000000">Adding or Removing Information to/from the Report</span>

<span style="color: #000000">To add additional information, usually we're thinking of adding:</span>

- <span style="color: #000000">Test step custom fields.</span>
- <span style="color: #000000">fields of the Preconditions, Requirements, Test Sets, or of the Test Plans associated with the Test.</span>

#### <span style="color: #000000">Adding a Field from the Related Requirement Issue </span>

<span style="color: #000000">Let's say you have a </span><span style="color: #000000">*Severity*</span><span style="color: #000000"> field on the Requirement (i.e., covered Issue) that is linked to the Test, and that you want to show it on the report.</span>

<span style="color: #000000">You can copy the column </span><span style="color: #000000">*Summary*</span><span style="color: #000000"> from the </span><span style="color: #000000">*Requirements*</span><span style="color: #000000"> section and adapt it:</span>

1. <span style="color: #000000">In the </span><span style="color: #000000">*Requirements*</span><span style="color: #000000"> section:</span>
  1. <span style="color: #000000">Copy </span><span style="color: #000000">*Summary*</span><span style="color: #000000"> (i.e., insert a column next to it and copy the values from the existing </span><span style="color: #000000">*Summary*</span><span style="color: #000000"> column).</span>
  2. <span style="color: #000000">Bhange the contents to: </span>`${Links[j].Severity}`

#### <span style="color: #000000">Showing a Test Step Custom Field on the Test Details</span>

<span style="color: #000000"> Let's say you have a </span><span style="color: #000000">*StepField1*</span><span style="color: #000000"> Test Step custom filed configured for your project and that it might be used in some Test Steps of some Tests.</span>

1. <span style="color: #000000">Go to the </span><span style="color: #000000">*Test Details*</span><span style="color: #000000"> section.</span>
2. <span style="color: #000000">Add the </span><span style="color: #000000">*Step Custom Fields*</span><span style="color: #000000"> column to the table.</span>
3. <span style="color: #000000">Add the name of the Test Step custom field along with the value in the content cell: </span>`StepField1: ${wiki:TestSteps[n].StepField1}`

> ℹ️ You cannot easily iterate through all such custom fields with one statement; you need to target each one individually by name.

## Performance

Performance can be impacted by the information that is rendered and by how that information is collected/processed.

> ℹ️ **Tips**
> ℹ️ 
> ℹ️ - Remove rendering of images for Test Issue attachments and for Test Step's attachments.
> ℹ️ - Limit the number of input Issues.

## Limitations

In the base version of the Template, modular Tests support only up to two levels of hierarchy (i.e. base Test calling Test A, then Test A calling Test B). You will see detailed regular Steps for level 1, but only the note about using callTest for level 2. You can expand the number of levels by repeating the loop.


<details>
<summary>Support/Troubleshooting</summary>

If you have questions or technical issues, please [contact the Support team via the Customer Portal (Jira service management)](https://jira.getxray.app/servicedesk/customer/portal/2/user/login?destination=portal%2F2%2Fcreate%2F28) or [send us a message using the in-app chat](https://getxraydocs.atlassian.net/wiki/spaces/XRAYCLOUD/pages/44577312).
</details>