This script helps you to migrate your test cases from TestRail to Qase. It's written in Python 3.11 and uses Qase API and TestRail API.
pip install -r requirements.txt
Create a new config file from the example or use template:
{
"qase": {
"api_token": "<QASE_API_TOKEN>",
"scim_token": "<QASE_SCIM_API_TOKEN>",
"host": "<QASE_API_HOST|Default:qase.io>",
"ssl": true,
"enterprise": false
},
"testrail": {
"connection": "api",
"api": {
"host": "<TESTRAIL_HOST>",
"user": "<TESTRAIL_USER_EMAIL>",
"password": "<TESTRAIL_USER_PASSWORD>"
}
},
"projects": {
"import": [],
"status": "all|active|archived"
},
"tests": {
"preserve_ids": true,
"fields": [],
"refs": {
"enable": true,
"url": "http://localhost:8899/"
}
},
"runs": {
"created_after": 1672524000
},
"users": {
"default": 1,
"create": true,
"inactive": true
},
"groups": {
"create": false,
"name": "TestRail Migration"
},
"prefix": "local",
"sync": false,
"cache": true
}
Required fields to fill:
qase.host
- Qase hostqase.api
- API token from Qaseqase.scim
- SCIM token from Qaseqase.ssl
- If set totrue
migrator will usehttps
instead ofhttp
in all requeststestrail.connection
- Type of connection to TestRail. Can beapi
ordb
testrail.api.host
- URL of your TestRail instancetestrail.api.user
- Email of user in TestRail. This user should have administrator access rightstestrail.api.password
- Password of user in TestRailprojects.import
- List of projects to migrate. You can specify only name of project. Example:["Project 1", "Project 2"]
projects.status
- Status of projects to migrate. Can beall
,active
orinactive
.users.default
- ID of user in Qase. This user will be used as author of all test cases if migrator unable to match user from TestRail to Qaseusers.create
- If set totrue
migrator will create new users in Qase if it unable to match user from TestRail to Qase. SCIM API token is required for this option.users.inactive
- If set totrue
migrator will migrate all users from TestRail to Qase. SCIM API token is required for this option.groups.create
- If set totrue
migrator will create new groups in Qase if it unable to match group from TestRail to Qase. SCIM API token is required for this option.groups.name
- Name of group in Qase where new users will be added. SCIM API token is required for this option.runs.created_after
- Unix timestamp. Migrator will migrate only runs created after this date. Optionaltests.preserve_ids
- If set totrue
migrator will try to preserve test case IDs from TestRail. Optionaltests.fields
- List of fields to migrate. If empty, migrator will migrate all fields. Optionaltests.refs.enable
- If set totrue
migrator will add references to TestRail test cases. Optionaltests.refs.url
- URL of TestRail instance. Optional
Right now, there is no option to modify system fields in Qase through the API. If you want to migrate system fields values (like test result statuses or priority), you should add these values manually in Qase before migration. That can be done here.
python start.py