What you'll learn

  • How to export test cases from Qase
  • Use a script to convert the exported CSV test cases to an Xray compatible CSV file
  • Import different test cases (with different fields and options)
  • Validate that the test cases were imported to Xray

Source-code for this tutorial

  • All examples are available on GitHub

Overview

This tutorial explains how to export test cases from Qase and import them into Xray.

Qase is a web test management tool. In this tutorial, you will learn how to export the test cases from Qase in an CSV format, how to use a script (available in GitHub) to convert the CSV file into a compatible CSV so that it can be imported into Xray using the Test Case Importer.

This tutorial will provide different examples of exporting and importing test cases from Qase into Xray. 

Features and Limitations

Below is a list of the support features and current limitations.

Migration from Qase is limited to the information we can export from Qase and how it can be mapped to Xray entities.

Most of the test case information will be migrated seamlessly, but please check the following table for more details.

Supported FeaturesUnsupported
  • Test and Test steps
  • Preconditions
  • Test Suites
  • Test case attachments
  • Test Runs
  • Test Plans
  • Defects and Requirements


How it works

Qase allows users to create different test projects. The user can specify and organize those tests into test suites. Each test project can have multiple test suites.

Qase allows you to create tests with different information depending on the purpose of the test. We have the possibility to define the type of test, the layer (E2E, API or Unit), the behaviour (Positive or Negative) and the Automation Status (Manual or Automated). We can define preconditions and postconditions through two text fields present in the test form. On the test case steps we can choose if we want the classic way, describing the steps with action, data and expected result, or we can define the steps using Gherkin.

Qase also have Test Plans that once the tests are associated to it can provide an overall view over their execution.

In Qase, to execute tests, you need to associate them to a test run.

Qase uses different entities to describe tests and the flow, so we have synthesized into the next table the existing mappings between Qase and Xray.

QaseXrayComments
Test CaseTest

Qase does not support data sets; only manual/automated test steps.

In Qase when you choose to export using CSV format we can choose to export a suite or everything. 

Precondition

(Field in Test Case entity)

Precondition

(independent entity)

In Qase, the precondition is one field in the test case.

In Xray, a Precondition is a different entity and one Test Case can be linked to several Preconditions.

The precondition field from Qase is converted into a Precondition issue in Xray and linked back to the Test.

Test SuiteTest Repository

The test suites and sub-suites of Qase are mapped into Xray Test Repository folders.  




Prerequisites


For these examples we will use the Test Case Importer tool, which is present when you install Xray in your Jira instance.

 We will need:

  • Access to Qase instance to export test cases in CSV format
  • Access and usage of scripts to convert Qase CSV test cases to CSV Xray import files
  • Access to a Jira instance with Xray installed
  • Only users that have the Make Bulk Changes permission will have this option available. Additionally, the user will only be able to import data into projects where he has the Create Issues permission.




Examples

In each example, we will show how we obtained the CSV file from Qase, a copy to them in GitHub, how to use the scripts to convert the original CSV files into compatible Xray CSV files, and finally, how to import the CSV files into Xray.

We will showcase different possibilities when exporting test cases from Qase, using a combination of fields and possibilities that should cover most usages.

All of the examples in this tutorial have an CSV file exported from Qase, a CSV file with the definition of the test cases to import, and a configuration file that will configure all associations and fields for the importation to be successful.


Export to CSV from Qase and Import into Xray

In Qase, when you choose to export using CSV format, it will give a choice to export a suite, a filtered selection or everything. For this example we will export everything.

To export from Qase, we are using the Export data option in the Test Project repository upper menu entry.

We choose the CSV format and click "Export".

Looking into more detail on what we have in Qase, we can see that we have defined 3 suites:

  • Detail (with one sub-section)
    • Promotions
  • Login
  • Listing


The file generated by Qase has the following content:

qase_export.csv
v2.id,title,description,preconditions,postconditions,tags,priority,severity,type,behavior,automation,status,is_flaky,layer,steps_type,steps_actions,steps_result,steps_data,milestone_id,milestone,suite_id,suite_parent_id,suite,suite_without_cases,parameters
,,,,,,,,,,,,,,,,,,,,1,,Login,1
,,,,,,,,,,,,,,,,,,,,2,,Listing,1
,,,,,,,,,,,,,,,,,,,,3,,Detail,1
,,,,,,,,,,,,,,,,,,,,4,3,Promotions,1
5,"Performance test","Performance test spamming 100 users simultaneously",,,,high,critical,performance,undefined,automated,actual,no,unit,classic,,,,,,,,,,
1,"My manual test title",,"Pre conditions
**Bold**
*Italic*

Bullets:

1. one
2. two 
3. three","Post Conditions",Login,undefined,normal,functional,positive,is-not-automated,actual,no,e2e,classic,"1. ""Click on the login button""
2. ""click on the username field""
3. ""```\nInsert Username in the username field\n```""
4. ""Insert the Password in the password field""
5. ""Click on the Login button""
6. ""Last step\n\n**Bold**\n\n*Italic*\n\nTable:\n\n| Header 1 | Header2 |\n| -------- | ------- |\n| Cell1 | Cell2 |""
","1. ""The login page appear""
2. ""The username field is selected""
3. ""The Username appear in the field""
4. ""The Password appear in the password field""
5. ""The page reloads and the user is now in the logged in state.""
6. ""Last Result\n**Bold**\n\n*Italic*\n\nTable:\n\n| Header 1 | Header2 |\n| -------- | ------- |\n| Cell1 | Cell2 |""
","1. ""Data 1""
2. ""Data 2""
3. ""$Username""
4. """"
5. """"
6. ""Last data dd""
",,,1,,Login,,"Username:John
Username:Barbara
Username:Peter
Password:password
Password:123456"
3,"Invalid login",,"Gherkin pre condition",,Login,high,critical,functional,negative,is-not-automated,actual,no,e2e,gherkin,"1. Given I access the application page
2. When I click the login button
3. And I insert ""failed"" in the username field
4. And I insert ""failed"" in the password field
5. And I click the login button
6. Then An error message stating that an error occurred in the login operation
","1. """"
2. """"
3. """"
4. """"
5. """"
6. """"
","1. """"
2. """"
3. """"
4. """"
5. """"
6. """"
",,,1,,Login,,
2,"Validate listing page","Test to validate the listing page.

**Bold**

*Italic*

Table:

| Header1 | Header2 |
| ------- | ------- |
| Cell1 | Cell2 |


Bullets:

* One
* two
* three",,,Listing,high,critical,regression,positive,is-not-automated,actual,no,e2e,classic,"1. ""Click on the login button""
2. ""Click on the username field""
3. ""Insert UserName in the field""
4. ""Insert the Password in the password field""
5. ""Click on the Login button""
6. ""Click on the \""new arrivals\"" icon""
","1. ""The login page appear""
2. ""The username field is selected""
3. ""The UserName appear in the field""
4. ""The Password appear in the field""
5. ""The page reloads and the user is now in the logged in state""
6. ""1. The \""New Arrivals\"" listing page is loaded.\n2. Each product has one thumbnail, product description, the price and availability.""
","1. """"
2. """"
3. """"
4. """"
5. """"
6. """"
",,,2,,Listing,,
4,"Detail page","Validate the detail page of each product behaves as expected",,,Detail,low,normal,integration,undefined,is-not-automated,actual,no,unknown,classic,"1. ""Click on the login button""
2. ""Click on the username field""
3. ""Insert UserName in the field""
4. ""Insert the Password in the password field""
5. ""Click on the Login button""
6. ""Click over one product""
7. ""Click on the image of the product""
","1. ""The login page appear""
2. ""The username field is selected""
3. ""The UserName appear in the field""
4. ""The Password appear in the field""
5. ""The page reloads and the user is now in the logged in state""
6. ""We are taken to the detail page of the product""
7. ""A pop-up appear with a carrousel of images of the product""
","1. """"
2. """"
3. """"
4. """"
5. """"
6. """"
7. """"
",,,3,,Detail,,
6,"Validate promotions","Validate detail page - promotions",,,,medium,normal,other,undefined,is-not-automated,actual,no,unknown,classic,"1. ""Step one""
2. ""Step two""
","1. ""Expected result one""
2. ""Expected result two""
","1. ""Data one""
2. ""Data two""
",,,4,3,Promotions,,
7,"Validate promotions - authenticated",,,,,undefined,normal,other,undefined,is-not-automated,actual,no,unknown,classic,,,,,,4,3,Promotions,,



To import into Xray, we created one script to convert this CSV file into a CSV-compatible file to be imported into Xray.

The script will parse the CSV file and create a CSV file that can be imported into Xray. To execute the script, use the following command:

python3 qase2Xray.py -i qase_export.csv -o qase_xray_results.csv


The output file has all the test steps and, if you have used a precondition in Qase, it will create a precondition in Xray and link it to the test.

qase_xray_results.csv
Issue ID,Issue Key,Test Type,Test Summary,Test Priority,Action,Data,Result,Issue Type,Precondition,Precondition Type,Description,Unstructured Definition,Gherkin Definition,Test Repo
1,,,Pre conditions,,,,,precondition,,Manual,"Pre conditions
**Bold**
*Italic*

Bullets:

1. one
2. two 
3. three",,,
2,,Manual,My manual test title,3," ""Click on the login button"""," ""Data 1"""," ""The login page appear""",Test,1,,,,,Login
2,,Manual,,3," ""click on the username field"""," ""Data 2"""," ""The username field is selected""",Test,,,,,,
2,,Manual,,3," ""```\nInsert Username in the username field\n```"""," ""$Username"""," ""The Username appear in the field""",Test,,,,,,
2,,Manual,,3," ""Insert the Password in the password field"""," """""," ""The Password appear in the password field""",Test,,,,,,
2,,Manual,,3," ""Click on the Login button"""," """""," ""The page reloads and the user is now in the logged in state.""",Test,,,,,,
2,,Manual,,3," ""Last step\n\n**Bold**\n\n*Italic*\n\nTable:\n\n| Header 1 | Header2 |\n| -------- | ------- |\n| Cell1 | Cell2 |"""," ""Last data dd"""," ""Last Result\n**Bold**\n\n*Italic*\n\nTable:\n\n| Header 1 | Header2 |\n| -------- | ------- |\n| Cell1 | Cell2 |""",Test,,,,,,
3,,,Gherkin pre condition,,,,,precondition,,Cucumber,Gherkin pre condition,,,
4,,Cucumber,Invalid login,3,,,,Test,3,,,," Given I access the application page
 When I click the login button
 And I insert ""failed"" in the username field
 And I insert ""failed"" in the password field
 And I click the login button
 Then An error message stating that an error occurred in the login operation
",Login
5,,Manual,Validate listing page,3," ""Click on the login button"""," """""," ""The login page appear""",Test,,,"Test to validate the listing page.

**Bold**

*Italic*

Table:

| Header1 | Header2 |
| ------- | ------- |
| Cell1 | Cell2 |


Bullets:

* One
* two
* three",,,Listing
5,,Manual,,3," ""Click on the username field"""," """""," ""The username field is selected""",Test,,,,,,
5,,Manual,,3," ""Insert UserName in the field"""," """""," ""The UserName appear in the field""",Test,,,,,,
5,,Manual,,3," ""Insert the Password in the password field"""," """""," ""The Password appear in the field""",Test,,,,,,
5,,Manual,,3," ""Click on the Login button"""," """""," ""The page reloads and the user is now in the logged in state""",Test,,,,,,
5,,Manual,,3," ""Click on the \""new arrivals\"" icon"""," """""," "" The \""New Arrivals\"" listing page is loaded.\n Each product has one thumbnail, product description, the price and availability.""",Test,,,,,,
6,,Manual,Detail page,3," ""Click on the login button"""," """""," ""The login page appear""",Test,,,Validate the detail page of each product behaves as expected,,,Detail
6,,Manual,,3," ""Click on the username field"""," """""," ""The username field is selected""",Test,,,,,,
6,,Manual,,3," ""Insert UserName in the field"""," """""," ""The UserName appear in the field""",Test,,,,,,
6,,Manual,,3," ""Insert the Password in the password field"""," """""," ""The Password appear in the field""",Test,,,,,,
6,,Manual,,3," ""Click on the Login button"""," """""," ""The page reloads and the user is now in the logged in state""",Test,,,,,,
6,,Manual,,3," ""Click over one product"""," """""," ""We are taken to the detail page of the product""",Test,,,,,,
6,,Manual,,3," ""Click on the image of the product"""," """""," ""A pop-up appear with a carrousel of images of the product""",Test,,,,,,
7,,Manual,Validate promotions,3," ""Step one"""," ""Data one"""," ""Expected result one""",Test,,,Validate detail page - promotions,,,Detail/Promotions
7,,Manual,,3," ""Step two"""," ""Data two"""," ""Expected result two""",Test,,,,,,




To import it into Xray, we use Test Case Importer with the recently created CSV file; you can use the configuration file provided with the .json extension (importConfiguration.json).

Once imported we can see that it has created two Preconditions and five Tests with all the properties defined in the CSV.


More Details

Let's look into some specificities of this approach and some test particularities.

precondition field into Precondition issue

In Qase, preconditions are another field in the Test.


The precondition is exported in a 'preconditions' field. 

precondition in comic_estore.xml
v2.id,title,description,preconditions,postconditions,tags,priority,severity,type,behavior,automation,status,is_flaky,layer,steps_type,steps_actions,steps_result,steps_data,milestone_id,milestone,suite_id,suite_parent_id,suite,suite_without_cases,parameters
,,,,,,,,,,,,,,,,,,,,1,,Login,1
,,,,,,,,,,,,,,,,,,,,2,,Listing,1
,,,,,,,,,,,,,,,,,,,,3,,Detail,1
,,,,,,,,,,,,,,,,,,,,4,3,Promotions,1
5,"Performance test","Performance test spamming 100 users simultaneously",,,,high,critical,performance,undefined,automated,actual,no,unit,classic,,,,,,,,,,
1,"My manual test title",,"Pre conditions
**Bold**
*Italic*

Bullets:

1. one
2. two 
3. three","Post Conditions",Login,undefined,normal,functional,positive,is-not-automated,actual,no,e2e,classic,"1. ""Click on the login button""
2. ""click on the username field""
...


When converting into a CSV for Xray we are creating a new issue of type 'precondition' and linking it to the Test.

Precondition in comic_estore.csv
Issue ID,Issue Key,Test Type,Test Summary,Test Priority,Action,Data,Result,Issue Type,Precondition,Precondition Type,Description,Unstructured Definition,Gherkin Definition,Test Repo
1,,,Pre conditions,,,,,precondition,,Manual,"Pre conditions
**Bold**
*Italic*

Bullets:

1. one
2. two 
3. three",,,
2,,Manual,My manual test title,3," ""Click on the login button"""," ""Data 1"""," ""The login page appear""",Test,1,,,,,Login

...


Once imported into Xray, we can see that the first line creates a Precondition in Xray.

The next line creates a Test and links the Precondition created in the same operation.

Test Suites into Test Repository

In Qase, we can organize our tests into suites and sub-suites as we can see below:

As we can see in the above picture we have:

  • one suite called 'Detail' with 3 tests and a sub-suite 'Promotions' with 2 tests
  • one suite called 'Login' with 2 tests
  • one section called 'Listing' with one test

Qase suites and sub-suites are exported into the CSV file at the beginning of the file, in the following form:

test section in comic_estore.xml
v2.id,title,description,preconditions,postconditions,tags,priority,severity,type,behavior,automation,status,is_flaky,layer,steps_type,steps_actions,steps_result,steps_data,milestone_id,milestone,suite_id,suite_parent_id,suite,suite_without_cases,parameters
,,,,,,,,,,,,,,,,,,,,1,,Login,1
,,,,,,,,,,,,,,,,,,,,2,,Listing,1
,,,,,,,,,,,,,,,,,,,,3,,Detail,1
,,,,,,,,,,,,,,,,,,,,4,3,Promotions,1
...


After running the script that converts the CSV file into a CSV format we can see that it adds, in the Test Repo field, the Test Repository name to be created when uploading the file into Xray.

Test Repo in comic_estore.csv
Issue ID,Issue Key,Test Type,Test Summary,Test Priority,Action,Data,Result,Issue Type,Precondition,Precondition Type,Description,Unstructured Definition,Gherkin Definition,Test Repo
1,,,Pre conditions,,,,,precondition,,Manual,"Pre conditions
**Bold**
*Italic*

Bullets:

1. one
2. two 
3. three",,,
2,,Manual,My manual test title,3," ""Click on the login button"""," ""Data 1"""," ""The login page appear""",Test,1,,,,,Login
...


After importing into Xray, we can see that new directories were created in the Test Repository:

Manual Tests into Manual Test Case

Qase allows you to create Manual Test Cases with steps (using action, data, and expected result).

In this example, we have created one test case using steps; the CSV output is the following:

Manual Tests in qase_export.csv
v2.id,title,description,preconditions,postconditions,tags,priority,severity,type,behavior,automation,status,is_flaky,layer,steps_type,steps_actions,steps_result,steps_data,milestone_id,milestone,suite_id,suite_parent_id,suite,suite_without_cases,parameters
,,,,,,,,,,,,,,,,,,,,1,,Login,1
,,,,,,,,,,,,,,,,,,,,2,,Listing,1
,,,,,,,,,,,,,,,,,,,,3,,Detail,1
,,,,,,,,,,,,,,,,,,,,4,3,Promotions,1
5,"Performance test","Performance test spamming 100 users simultaneously",,,,high,critical,performance,undefined,automated,actual,no,unit,classic,,,,,,,,,,
1,"My manual test title",,"Pre conditions
**Bold**
*Italic*

Bullets:

1. one
2. two 
3. three","Post Conditions",Login,undefined,normal,functional,positive,is-not-automated,actual,no,e2e,classic,"1. ""Click on the login button""
2. ""click on the username field""
3. ""```\nInsert Username in the username field\n```""
4. ""Insert the Password in the password field""
5. ""Click on the Login button""
6. ""Last step\n\n**Bold**\n\n*Italic*\n\nTable:\n\n| Header 1 | Header2 |\n| -------- | ------- |\n| Cell1 | Cell2 |""
","1. ""The login page appear""
2. ""The username field is selected""
3. ""The Username appear in the field""
4. ""The Password appear in the password field""
5. ""The page reloads and the user is now in the logged in state.""
6. ""Last Result\n**Bold**\n\n*Italic*\n\nTable:\n\n| Header 1 | Header2 |\n| -------- | ------- |\n| Cell1 | Cell2 |""
","1. ""Data 1""
2. ""Data 2""
3. ""$Username""
4. """"
5. """"
6. ""Last data dd""
",,,1,,Login,,"Username:John
Username:Barbara
Username:Peter
Password:password
Password:123456"
            ...


After running the script that converts this CSV into a Xray CSV file we can see that, as explained above, the Preconditions issues are created and linked back to the Tests. Each Test is created and the steps filled with the information extracted from the CSV.

Manual Tests in qase_xray_results.csv
Issue ID,Issue Key,Test Type,Test Summary,Test Priority,Action,Data,Result,Issue Type,Precondition,Precondition Type,Description,Unstructured Definition,Gherkin Definition,Test Repo
...
3,,Manual,My manual test title,3," ""Click on the login button"""," ""Data 1"""," ""The login page appear""",Test,2,,,,,Login
3,,Manual,,3," ""click on the username field"""," ""Data 2"""," ""The username field is selected""",Test,,,,,,
3,,Manual,,3," ""```\nInsert Username in the username field\n```"""," ""$Username"""," ""The Username appear in the field""",Test,,,,,,
3,,Manual,,3," ""Insert the Password in the password field"""," """""," ""The Password appear in the password field""",Test,,,,,,
3,,Manual,,3," ""Click on the Login button"""," """""," ""The page reloads and the user is now in the logged in state.""",Test,,,,,,
3,,Manual,,3," ""Last step\n\n**Bold**\n\n*Italic*\n\nTable:\n\n| Header 1 | Header2 |\n| -------- | ------- |\n| Cell1 | Cell2 |"""," ""Last data dd"""," ""Last Result\n**Bold**\n\n*Italic*\n\nTable:\n\n| Header 1 | Header2 |\n| -------- | ------- |\n| Cell1 | Cell2 |""",Test,,,,,,
...


The imported test corresponds to a Manual Test Case with the summary obtained from the CSV and the steps with Action, data and Expected Result.

Gherkin Test into Cucumber tests

 Qase has the possibility to define the test case steps with a Gherkin definition.


The exported CSV looks like the one below:

Gherkin Test in qase_export.csv
...
3,"Invalid login",,"Gherkin pre condition",,Login,high,critical,functional,negative,is-not-automated,actual,no,e2e,gherkin,"1. Given I access the application page
2. When I click the login button
3. And I insert ""failed"" in the username field
4. And I insert ""failed"" in the password field
5. And I click the login button
6. Then An error message stating that an error occurred in the login operation
","1. """"
2. """"
3. """"
4. """"
5. """"
6. """"
","1. """"
2. """"
3. """"
4. """"
5. """"
6. """"
",,,1,,Login,,
...

After using the script provided it will convert the CSV into the following Xray CSV file.

Gherkin Test in qase_xray_results.csv
...
5,,Cucumber,Invalid login,3,,,,Test,4,,,," Given I access the application page
 When I click the login button
 And I insert ""failed"" in the username field
 And I insert ""failed"" in the password field
 And I click the login button
 Then An error message stating that an error occurred in the login operation
",Login
...

The script has converted the Qase Gherkin type into the Xray Cucumber type and added it to the Test Cases  directory in the Test Repository.

Automated Tests into Automated Test Cases

The last type supported is the Automated type in Qase, this test has a description that is imported as well.

The exported CSV looks like the one below:

Automated Test in qase_export.csv
v2.id,title,description,preconditions,postconditions,tags,priority,severity,type,behavior,automation,status,is_flaky,layer,steps_type,steps_actions,steps_result,steps_data,milestone_id,milestone,suite_id,suite_parent_id,suite,suite_without_cases,parameters
,,,,,,,,,,,,,,,,,,,,1,,Login,1
,,,,,,,,,,,,,,,,,,,,2,,Listing,1
,,,,,,,,,,,,,,,,,,,,3,,Detail,1
,,,,,,,,,,,,,,,,,,,,4,3,Promotions,1
5,"Performance test","Performance test spamming 100 users simultaneously",,,,high,critical,performance,undefined,automated,actual,no,unit,classic,,,,,,,,,,
...


After using the script provided it will convert the CSV into the following Xray CSV file.

Automated Test in qase_xray_results.csv
Issue ID,Issue Key,Test Type,Test Summary,Test Priority,Action,Data,Result,Issue Type,Precondition,Precondition Type,Description,Unstructured Definition,Gherkin Definition,Test Repo
1,,Generic,Performance test,3,,,,Test,,,Performance test spamming 100 users simultaneously,,,
...


The script has converted the Qase Automated type into the Xray Generic type and added it to the Test Cases  directory in the Test Repository.

Other Tests

The script will convert all tests of type Manual, BDD or Automated; all the other types will be discarded and no output is created in the resulting CSV file.



Tips

  • Use the CSV file provided to import the examples and the Json configuration associated to have the setup and mapping correct.
  • Ensure you are using the scripts available for the right version of Jira (Cloud or Server).