testRailToTestFlo is a simple tool written in python (3.5+) which is created to help with importing test case definitions from Test Rail to JIRA TestFLO.
In general the tool is command line tool.
Type python importer.py -h
for help.
usage: importer.py [-h] -s server-url -k PROJECTKEY -u username -i
input_file.csv [-l [label [label ...]]]
[-c [component [component ...]]] [-e] [-t test_level]
Transfers TestRail test cases from csv file to specified TestFLO project in
Jira.
optional arguments:
-h, --help show this help message and exit
-s server-url, --server server-url
url of your jira server, including http(s)://
-k PROJECTKEY, --key PROJECTKEY
project KEY, not name, not id, the KEY
-u username, --user username
your jira user name
-i input_file.csv, --ifile input_file.csv
path to source file (csv)
-l [label [label ...]], --labels [label [label ...]]
space delimited list of label to be assigned to
imported issues
-c [component [component ...]], --components [component [component ...]]
space delimited list of components to be assigned to
imported issues
-e add if you want to enable automatic creation of epics
based on section hierarchy
-t test_level, --level test_level
Test level to be set for each of imported issues, one
of: Unit, Integration, "Component Interface", System,
"Operational Acceptance"
- python 3.5 (most probably python > 3 will work as well)
- Python JIRA -
pip3 install jira
- jira project with TestFLO configured / enabled
- user account with admin rights to target project (TestFLO project)
Basically you need some special configuration of the project besides having TestFLO.
Following extra configurations are required:
- Issue types:
- Test Case Template
- Test Case
- Test Plan
- Epic - especially if
-e
parameter used
- Additional (custom) fields in Jira
- Test Level - schema as follows
"customfield_13292": { "required": false, "schema": { "type": "option", "custom": "com.atlassian.jira.plugin.system.customfieldtypes:select", }, "name": "Test Level", "hasDefaultValue": false, "operations": [ "set" ], "allowedValues": [ { "value": "Unit" }, { "value": "Integration" }, { "value": "Component Interface" }, { "value": "System" }, { "value": "Operational Acceptance" } ] }
- Test Type - schema as follows:
"customfield_13291": { "required": false, "schema": { "type": "array", "items": "option", "custom": "com.atlassian.jira.plugin.system.customfieldtypes:multiselect" }, "name": "Test Type", "hasDefaultValue": false, "operations": [ "add", "set", "remove" ], "allowedValues": [ { "value": "Acceptance" }, { "value": "Smoke" }, { "value": "Regression" }, { "value": "Performance" }, { "value": "Development" }, { "value": "Security" }, { "value": "Installation" }, { "value": "Destructive" } ] }
- Test Case Group - schema:
"customfield_13293": { "required": false, "schema": { "type": "array", "items": "string", "custom": "com.atlassian.jira.plugin.system.customfieldtypes:labels", "customId": 13293 }, "name": "Test Case Group", "hasDefaultValue": false, "operations": [ "add", "set", "remove" ] }
- Test Case Subgroup - schema:
"customfield_13294": { "required": false, "schema": { "type": "array", "items": "string", "custom": "com.atlassian.jira.plugin.system.customfieldtypes:labels", }, "name": "Test Case Subgroup", "hasDefaultValue": false, "operations": [ "add", "set", "remove" ] }
- Epic Link - schema:
"customfield_10691": { "required": false, "schema": { "type": "any", "custom": "com.pyxis.greenhopper.jira:gh-epic-link", "customId": 10691 }, "name": "Epic Link", "hasDefaultValue": false, "operations": [ "set" ] }
- Pre-conditions - schema:
"customfield_11590": { "required": false, "schema": { "type": "string", "custom": "com.atlassian.jira.plugin.system.customfieldtypes:textarea", "customId": 11590 }, "name": "Pre-conditions", "hasDefaultValue": true, "operations": [ "set" ] }
- Automated - schema:
"customfield_11792": { "required": false, "schema": { "type": "option", "custom": "com.atlassian.jira.plugin.system.customfieldtypes:select", }, "name": "Automated", "hasDefaultValue": true, "operations": [ "set" ], "allowedValues": [ { "value": "Yes" }, { "value": "No" } ] }
- Test Level - schema as follows
- All above mentioned fields have to be added to Create issue Screen and Edit Issue Screen, otherwise you will see error msg from JIRA.
- additionally would be nice to have them in screens where you read the issue content (default screen or View Issue Screen)
- input file from testReail
- example in the repo -
example.csv
- example in the repo -
- Test Case (Steps)
- Test Case (Text)
- Exploratory Session
The script(s) maps Test Rails issues to TestFLO issues in a following way:
- ID - added at the end of Summary in square braces
- Title - mapped to Summary
- Created By - added as a part of Description
- Created On - added as a part of Description
- Estimate - added as a part of Description
Forecast- skipped- Given
- in case of Test Case (Text) mapped to Steps with "Given", "When", "Then" headers, Given filed
- in case of Test Case (Steps) mapped to Pre-condition with "Given", "When", "Then" headers
- Goals
- only exists in Exploratory Session, mapped to Steps with "Goal", "Mission", "Free text" headers
- Mission
- only exists in Exploratory Session, mapped to Steps with "Goal", "Mission", "Free text" headers
- Priority - JIRA Priority
References- skippedSection- skippedSection Depth- skipped- Section Description - when using Epics (
-e
) used as Description of issue type Epic - Section Hierarchy (format looks like follows: section > subsection > subsubsection > ....)
- 1st level is mapped to Test Case Group and (with
-e
) to Epic Name and Summary of Epic issue (parent of test case template) - 2nd is mapped to Test Case Subgroup and (with
-e
) to second part of Epic Name (with / in between) and Summary of Epic issue (parent of test case template) - even if exist, third and further levels are skipped
- 1st level is mapped to Test Case Group and (with
Steps- skipped- Steps (Expected Result) - mapped to Expected result of Steps
- Steps (Step) - mapped to Action of Steps
Suite- skippedSuite ID- skipped- Template - used to recognize way of mapping (Given/When/Then, Action/Expected result, Mission/Goal)
- Then - in case of Test Case (Text) mapped to Steps with "Given", "When", "Then" headers, Then filed
- Type - mapped to Test Type
Updated By- skippedUpdated On- skipped- When - in case of Test Case (Text) mapped to Steps with "Given", "When", "Then" headers, When filed
- there is not much of error handling, so if anything in Jira is not configured as expected the exception will be thrown
- tool only check duplicates of Epics and components, does not check for duplicates of Test Cases Template issues
- so if you run it second time with the seme input params you will have all issues duplicated
- Original Test Rail's ID is added to issue summary with square braces []