Giter VIP home page Giter VIP logo

testrailtotestflo's Introduction

Introduction

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.

How to use

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"

Requirements

System

  • python 3.5 (most probably python > 3 will work as well)
  • Python JIRA - pip3 install jira

JIRA

  • jira project with TestFLO configured / enabled
  • user account with admin rights to target project (TestFLO project)

JIRA project configuration

Basically you need some special configuration of the project besides having TestFLO.

Following extra configurations are required:

  1. Issue types:
    • Test Case Template
    • Test Case
    • Test Plan
    • Epic - especially if -e parameter used
  2. 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"
                               }
                           ]
                       }
      
  3. 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)

Data

  • input file from testReail
    • example in the repo - example.csv

Supported test case types (Test Rail Template)

  • Test Case (Steps)
  • Test Case (Text)
  • Exploratory Session

Mapping

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 - skipped
  • Section - skipped
  • Section 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
  • Steps - skipped
  • Steps (Expected Result) - mapped to Expected result of Steps
  • Steps (Step) - mapped to Action of Steps
  • Suite - skipped
  • Suite 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 - skipped
  • Updated On - skipped
  • When - in case of Test Case (Text) mapped to Steps with "Given", "When", "Then" headers, When filed

Known limitations

  • 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 []

testrailtotestflo's People

Contributors

michalsoltysiak avatar

Watchers

Szymon Sobociński avatar

testrailtotestflo's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.