Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

...

n is the index of Test Step, starting from 0. The field TestStepsCount was created in order to give the total number of Test Steps. The fields available for Test Steps are:

  • StepNumber
  • Action
  • Data
  • ExpectedResult


Code Block
titleExpand to see the example on sample code
collapsetrue
#{for teststeps}
    ${TestSteps[n].StepNumber}
    ${TestSteps[n].Action}
    ${TestSteps[n].Data

...

}
    ${TestSteps[n].ExpectedResult}
#{end}

Modular Test Steps

You can check if a Step is a Call Test with the mapping IsCalledTest.

Call Steps have the following fields available:

  • IsCalledTest (which will be true if the step is a called step; false if it's a normal step)
  • IsDeletedCalledTest (which will indicate if the called step issue was deleted)

  • IsInvalidIssueTypeCalledTest (which will indicate if the called step issue type has changed)

  • CalledTestParameters (the Called Test Dataset Parameters in Json format)
  • CalledTest.Field (The issue called. You can export its information)


Example:

Code Block
titleExpand to see the example on sample code
collapsetrue
#{for teststeps}
	#{if (%{${TestSteps[n].IsCalledTest}})}
		#{if (%{${TestSteps[n].IsDeletedCalledTest}})}
			Called test issue not found.
		#{end}
		#{if (%{${TestSteps[n].IsInvalidIssueTypeCalledTest}})}
			Called test issue type is invalid.
		#{end}
    	#{if (%{!${TestSteps[n].IsDeletedCalledTest} && !${TestSteps[n].IsInvalidIssueTypeCalledTest}})}
			${TestSteps[n].CalledTestParameters}
			${TestSteps[n].CalledTest.Key}
			${TestSteps[n].CalledTest.Summary}
		#{end}
	#{end}
#{end}

Modular Test Steps Parameters

You can iterate over the Test Call Parameters:

Code Block
titleExpand to see the example on sample code
collapsetrue
#{for teststeps}
    $    #{if (%{${TestSteps[n].StepNumberIsCalledTest}})}
    ${		#{for p=TestSteps[n].ActionCalledTestParametersCount}
    $			${TestSteps[n].CalledTestParameters[p].DataName}
    $			${TestSteps[n].ExpectedResult].CalledTestParameters[p].Value}
		#{end}
	#{end}
#{end}


Manual Test Steps Attachments

Document Generator allows rendering all Attachments of Manual Test Steps of a Test.

...

Code Block
titleSome mappings we can export from Test Run Iterations
// Iterating each test run
#{for testruns}
    IsDataDriven: ${TestRuns[n].IsDataDriven}  
     
    // Iterations Overall Execution Status (percentage + total of testes per status)
    List of Statuses: ${TestRuns[n].Iterations Overall Execution Status}
    TO DO: ${TestRuns[n].Iterations Overall Execution Status.TODO}% - ${TestRuns[n].Iterations Overall Execution Status.TODO.Count}
    EXECUTING: ${TestRuns[n].Iterations Overall Execution Status.EXECUTING}% - ${TestRuns[n].Iterations Overall Execution Status.EXECUTING.Count}
    PASSED: ${TestRuns[n].Iterations Overall Execution Status.PASS}% - ${TestRuns[n].Iterations Overall Execution Status.PASS.Count}
    FAILED: ${TestRuns[n].Iterations Overall Execution Status.FAIL}% - ${TestRuns[n].Iterations Overall Execution Status.FAIL.Count}
    ABORTED: ${TestRuns[n].Iterations Overall Execution Status.ABORTED}% - ${TestRuns[n].Iterations Overall Execution Status.ABORTED.Count}
 
    // Iterating over test runs iterations
    Total of Iterations from a Test Run: ${TestRuns[n].IterationsCount}
    #{for m=TestRuns[n].IterationsCount}
        Name: ${TestRuns[n].Iterations[m].Name}
        Status: ${TestRuns[n].Iterations[m].Status}
        Parameters: ${TestRuns[n].Iterations[m].Parameters}
 
        // Iterating over parameters for each test run iteration
        Parameters Total: ${TestRuns[n].Iterations[m].ParametersCount}
        #{for l=TestRuns[n].Iterations[m].ParametersCount}
            Key: ${TestRuns[n].Iterations[m].Parameters[l].Key}
            Value: ${TestRuns[n].Iterations[m].Parameters[l].Value}
        #{end}
 
        // Iterating over preconditions for each test run iteration
        Preconditions Total: ${TestRuns[n].Iterations[m].PreConditionsCount}
        #{for l=TestRuns[n].Iterations[m].PreConditionsCount}
			Key: ${TestRuns[n].Iterations[m].PreConditions[l].Key}
			Summary: ${TestRuns[n].Iterations[m].PreConditions[l].Summary}
            Definition: ${TestRuns[n].Iterations[m].PreConditions[l].Conditions}
            Type: ${TestRuns[n].Iterations[m].PreConditions[l].Pre-Condition Type}
        #{end}
 
        //Iterating over test steps for each test run iteration
        #{for i=TestRuns[n].Iterations[m].TestStepsCount}
            Step Number: ${TestRuns[n].Iterations[m].TestSteps[i].StepNumber}
            Action: ${TestRuns[n].Iterations[m].TestSteps[i].Action}
            Data: ${TestRuns[n].Iterations[m].TestSteps[i].Data}
            Expected Result: ${TestRuns[n].Iterations[m].TestSteps[i].ExpectedResult}
            Status: ${TestRuns[n].Iterations[m].TestSteps[i].Status}
            Comment: ${TestRuns[n].Iterations[m].TestSteps[i].Comment}
            Actual Result: ${TestRuns[n].Iterations[m].TestSteps[i].ActualResultActual Result}
            // Replace the placeholder text to export any custom field associated with the test step.
            Step Custom Field:${TestRuns[n].Iterations[m].TestSteps[i].<Step Custom Field>}
             
            // Iteration Test Step Attachments
            #{for l=TestRuns[n].Iterations[m].TestSteps[i].AttachmentsCount}
                Id: ${TestRuns[n].Iterations[m].TestSteps[i].Attachments[l].Id}
                Name: ${TestRuns[n].Iterations[m].TestSteps[i].Attachments[l].Name}
                Image: ${TestRuns[n].Iterations[m].TestSteps[i].Attachments[l].Attachment}
                FileURL: ${TestRuns[n].Iterations[m].TestSteps[i].Attachments[l].FileURL}
            #{end}
            // Iteration Test Step Evidences
            #{for l=TestRuns[n].Iterations[m].TestSteps[i].EvidencesCount}
                Id: ${TestRuns[n].Iterations[m].TestSteps[i].Evidences[l].Id}
                Name: ${TestRuns[n].Iterations[m].TestSteps[i].Evidences[l].Name}
                Evidence: ${TestRuns[n].Iterations[m].TestSteps[i].Evidences[l].Evidence}
            #{end}
            // Iteration Test Step Defects
            #{for l=TestRuns[n].Iterations[m].TestSteps[i].DefectsCount}
                Description: ${TestRuns[n].Iterations[m].TestSteps[i].Defects[l].Description}
                Id: ${TestRuns[n].Iterations[m].TestSteps[i].Defects[l].Id}
                Key: ${TestRuns[n].Iterations[m].TestSteps[i].Defects[l].Key}
                Summary: ${TestRuns[n].Iterations[m].TestSteps[i].Defects[l].Summary}
            #{end}
        #{end}
    #{end}
#{end}