Document Generator allows you to get following data from the Xray Test Plan:

Overall Execution Status

Export the Overall Execution Status with name and percentage for each Test Plan Status

${Overall Execution Status}

You can print the status of the Test Execution by using the following notation:

% per StatusNumber of Tests per Status
${Overall Execution Status.NameOfStatus}${Overall Execution Status.NameOfStatus.Count}

See the real example:

Expand to see the examples on sample code of a Test Execution details
Todo: ${Overall Execution Status.TODO}% (Overall Execution Status.TODO.Count})
Fail: ${Overall Execution Status.FAIL}% (Overall Execution Status.FAIL.Count})
Pass: ${Overall Execution Status.PASS}% (Overall Execution Status.PASS.Count})
Executing: ${Overall Execution Status.EXECUTING}% (Overall Execution Status.EXECUTING.Count})
Aborted: ${Overall Execution Status.ABORTED}% (Overall Execution Status.ABORTED.Count})

Iterating over Tests

As it is not known in advance how many Tests exist in a Test Plan, there is a notation that allows iterating a section over all the Tests of a Test Plan. The notation is:

Expand to see the examples on sample code
#{for tests}
	Content and Test Mappings.	Example: ${Tests[n].Key}
#{end}
 
or
 
#{for j=TestsCount}
	Content and Test Mappings.	Example: ${Tests[j].Summary}
#{end}

n is the index of Test, starting from 0. The field TestsCount was created in order to give the total number of Tests.

Here you can print Jira native data or print Xray specific data such as the Steps of the test. Learn more.

Iterating over Test Execution

As it is not known in advance how many Tests exist in a Test Plan, there is a notation that allows iterating a section over all the Tests of a Test Plan. The notation is:

Expand to see the examples on sample code
#{for testExecutions}
	Content and Test Mappings.	Example: ${Tests[n].Key}
#{end}
 
or
 
#{for j=TestExecutionsCount}
	Content and Test Mappings.	Example: ${Tests[j].Summary}
#{end}

n is the index of Test, starting from 0. The field TestExecutionsCount was created in order to give the total number of Tests.

Here you can print Jira native data or print Xray specific data such as the list of the Test executed inside of the Test Runs and their status. Learn more.

  • No labels