Page tree

Versions Compared

Key

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

From a Test, it's possible to export the following Xray data: Preconditions, Test Sets, TestPlans, Test Executions, and Test Runs.

All fields listed here are available because the Test is a regular JIRA issue. In addition, you can export the following fields:

Code Block
titleSome mappings we can export from a Test
Cucumber Scenario: ${Cucumber Scenario}
Generic Test Definition: ${Generic Test Definition}
Test Type: ${TestType}
Test Status: ${TestStatus}
Test Steps Total: ${TestStepsCount}
Tests Count: ${TestsCount}

Exporting Test Steps from a Test

For each Test Step you can export the following fields:

FieldsDescription
Action

The step action content

Status
colourBlue
titleWiki

Data

The step data content

Status
colourBlue
titleWiki

Expected Result

The step expected result content 

Status
colourBlue
titleWiki

AttachmentsCountThe number of files attached to the step.
StepNumberThe number of the step.


Below you can find an example of how to iterate over the list of TestSteps associated with a Test.

Code Block
titleIterate over test steps
Total number of associated test steps: ${TestStepsCount}

// Iterating each test step
#{for teststeps}
	 Action: ${TestSteps[n].Action}
     Data: ${TestSteps[n].Data}
     Expected Result: ${TestSteps[n].ExpectedResult}
     Step Number: ${TestSteps[n].StepNumber}
     // Iterating over attachments for each test step
     #{for l=TestSteps[n].AttachmentsCount}
     	Id: ${TestSteps[n].Attachments[l].Id}
        Name: ${TestSteps[n].Attachments[l].Name}
		Attachment: ${TestSteps[n].Attachments[l].Attachment}
		FileURL: ${TestSteps[n].Attachments[l].FileURL}
     #{end}
#{end}

Exporting Preconditions from a Test

Below you can find an example of how to iterate over the list of Preconditions associated with a Test.

Code Block
titleIterate over preconditions
Total number of associated preconditions: ${PreConditionsCount}

// Iterating each precondition
#{for preconditions}
	Key: ${PreConditions[n].Key}
	Type: ${PreConditions[n].PreCondition.Type}
	Definition: ${PreConditions[n].PreCondition.Definition}
#{end}
 
or
 
// Iterating each precondition
#{for j=PreConditionsCount}
	Summary: ${PreConditions[j].Summary}
	Type: ${PreConditions[j].PreCondition.Type}
	Definition: ${PreConditions[j].PreCondition.Definition}
#{end}
Info

For more detailed information on how to export Pre-conditions and its information please check the documentation.

Exporting Test Sets from a Test

Below you can find an example of how to iterate over the list of TestSets associated with a Test.

Code Block
titleIterate over test sets
Total number of associated test sets: ${TestSetsCount}

// Iterating each test set
#{for testSets}
	Description: ${TestSets[n].Description}
#{end}
 
or
 
// Iterating each test set
#{for j=TestSetsCount}
	Summary: ${TestSets[j].Summary}
#{end}
Info

For more detailed information on how to export Test Sets and its information please check the documentation.

Exporting Test Plans from a Test

Below you can find an example of how to iterate over the list of TestPlans associated with a Test.

Code Block
titleIterate over test plans
Total number of associated test plans: ${TestPlansCount}

// Iterating each test plan
#{for testPlans}
	Summary: ${TestPlans[n].Summary}
#{end}
 
or
 
// Iterating each test plan
#{for j=TestPlansCount}
	Description: ${TestPlans[j].Description}
#{end}
Info

For more detailed information on how to export Test Plans and its information please check the documentation.

Exporting Test Executions from a Test

Below you can find an example of how to iterate over the list of TestExecutions associated with a Test.

Code Block
titleIterate over test executions
Total number of associated test executions: ${TestExecutionsCount}

// Iterating each test execution
#{for testExecutions}
	Key: ${TestExecutions[n].Key}
	Test Environments: ${TestExecutions[n].TestEnvironments}
#{end}
 
or
 
// Iterating each test execution
#{for j=TestExecutionsCount}
	Summary: ${TestExecutions[j].Summary}
	Test Environments: ${TestExecutions[j].TestEnvironments}
#{end}
Info

For more detailed information on how to export Test Executions and its information please check the documentation.

Exporting Test Runs from a Test

All fields listed here are available and will refer to the test associated. In addition, you can export the following fields:

FieldsDescription
AssigneeId

The test execution's assignee.

Comment

The test execution's comment.

Generic Test Definition

The generic test definition of the test run. 

Status
colourBlue
titleWiki

Cucumber ScenarioThe cucumber definition of the test run
Executed ByThe user's ID that executed the test execution.
Execution StatusThe status of the test execution.
Started OnThe started date of the test execution.
Finished OnThe end date of the test execution.
ExecutionEvidencesCountThe number of execution evidences.
ExecutionDefectsCountThe number of execution defects.
TestStepsCountThe test execution's steps count.
TestTypeThe test execution's test type.
TestStepsDefectsCountThe number of defects for all test steps.
Code Block
titleIterate over test runs
Total number of associated test runs: ${TestRunsCount}

// Iterating each test run
#{for testruns}
    Assignee Id: ${TestRuns[n].AssigneeId}
    Key: ${TestRuns[n].Key}
    Summary: ${TestRuns[n].Summary}
    Comment: ${TestRuns[n].Comment}
    Generic Test Definition: ${wiki:TestRuns[n].Generic Test Definition}
    Cucumber Scenario: ${TestRuns[n].Cucumber Scenario}
    Executed by: ${TestRuns[n].Executed By}
    Execution Status: ${TestRuns[n].Execution Status}
    Started on: ${TestRuns[n].Started On}
    Finished on: ${TestRuns[n].Finished On}
	Test Type: ${TestRuns[n].TestType}

    // Iterating over execution evidences for each test run
    Execution Evidences Total: ${TestRuns[n].ExecutionEvidencesCount}
    #{for m=TestRuns[n].ExecutionEvidencesCount}
        Id: ${TestRuns[n].ExecutionEvidences[m].Id}
        Name: ${TestRuns[n].ExecutionEvidences[m].Name}
		Evidence Image: ${TestRuns[n].ExecutionEvidences[m].Evidence}
    #{end}

    // Iterating over execution defects for each test run
    Execution Defects Total: ${TestRuns[n].ExecutionDefectsCount}
    #{for m=TestRuns[n].ExecutionDefectsCount}
        Id: ${TestRuns[n].ExecutionDefects[m].Id}
        Description: ${TestRuns[n].ExecutionDefects[m].Description}
        Key: ${TestRuns[n].ExecutionDefects[m].Key}
        Summary: ${TestRuns[n].ExecutionDefects[m].Summary}
    #{end}

    // Iterating over test steps for each test run
    Test Steps Total: ${TestRuns[n].TestStepsCount}
    #{for m=TestRuns[n].TestStepsCount}
        Action: ${wiki:TestRuns[n].TestSteps[m].Action}
        Comment: ${TestRuns[n].TestSteps[m].Comment}
        Data: ${wiki:TestRuns[n].TestSteps[m].Data}
        Expected Result: ${wiki:TestRuns[n].TestSteps[m].ExpectedResult}
		Actual Result: ${wiki:TestRuns[n].TestSteps[m].ActualResult}
        Status: ${TestRuns[n].TestSteps[m].Status}
        Step Number: ${TestRuns[n].TestSteps[m].StepNumber}

        // Iterating over attachments for each test step
		Test Steps Attachments Count: ${TestRuns[n].TestSteps[m].AttachmentsCount}
        #{for l=TestRuns[n].TestSteps[m].AttachmentsCount}
            Id: ${TestRuns[n].TestSteps[m].Attachments[l].Id}
            Name: ${TestRuns[n].TestSteps[m].Attachments[l].Name}
			Attachment Image: ${TestRuns[n].TestSteps[m].Attachments[l].Attachment}
        #{end}

        // Iterating over evidences for each test step
		Test Steps Evidences Count: ${TestRuns[n].TestSteps[m].EvidencesCount}
        #{for l=TestRuns[n].TestSteps[m].EvidencesCount}
            Id: ${TestRuns[n].TestSteps[m].Evidences[l].Id}
            Name: ${TestRuns[n].TestSteps[m].Evidences[l].Name}
			Evidence Image: ${TestRuns[n].ExecutionEvidences[m].Evidence}
        #{end}

        // Iterating over defects for each test step
		Test Steps Evidences Count: ${TestRuns[n].TestSteps[m].DefectsCount}
        #{for l=TestRuns[n].TestSteps[m].DefectsCount}
            Description: ${TestRuns[n].TestSteps[m].Defects[l].Description}
            Id: ${TestRuns[n].TestSteps[m].Defects[l].Id}
            Key: ${TestRuns[n].TestSteps[m].Defects[l].Key}
            Summary: ${TestRuns[n].TestSteps[m].Defects[l].Summary}
        #{end}
    #{end}
#{end}

The word document below shows an example with all the mappings available to export from a Test:

Xray_Tests.docx


Info

Status
colourBlue
titleWiki
indicates that the field supports wiki format. More about here.