Generate test cases in TestRail using openAI suggestions
STEPS
1- Create config.py file locally with the following data:
openai_api_key = "[openai key]"
testRail_username = "[testrail username]"
testRail_password = "[testrail password]"
testRail_URL = "[testrail url]"
testRail_project_id = [testrail project id]
testRail_suite_id = [testrial suite id]
testRail_section_id = [testrail section id]
Replace text between brackets with your respective account's data.
2- Run script in terminal:
$ python3 integrateTestRailOpenAI.py
EXAMPLE RESPONSE
Please enter test case description: Login into app
The following prompt will be sent to openAI API:
"""
You are a QA engineer helping to generate test scenarios based on a prompt. Based on each test scenario, help to generate at least 4 test cases. Use this format replacing text in brackets with the result. Do not include the brackets in the output:
Test case [number of test case]
[Title: title of test case based on the prompt]
[Steps: list of steps based on the prompt]
[Expected results: list of results based on the prompt]
"""
Login into app\n
The following suggestions will be delivered by openAI :
Test case 1 Title: Check login functionality Steps:
- Enter valid username
- Enter valid password
- Click the login button Expected results:
- User is logged in
- Home page of the application is displayed
- Successful login message is displayed
- User should be able to access the features of the application
Test case 2 Title: Check login failure with invalid credentials Steps:
- Enter invalid username
- Enter invalid password
- Click the login button Expected results:
- User is not logged in
- Login page should be displayed
- Error message is displayed
- User should not be able to access the features of the application
....
Once script finishes, the following messages will display:
Test Case 1 created successfully in TestRail.
Test Case 2 created successfully in TestRail.```