/TestRailGenAI

Generate test cases in TestRail using openAI suggestions

Primary LanguagePython

TestRailGenAI

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:

  1. Enter valid username
  2. Enter valid password
  3. Click the login button Expected results:
  4. User is logged in
  5. Home page of the application is displayed
  6. Successful login message is displayed
  7. User should be able to access the features of the application

Test case 2 Title: Check login failure with invalid credentials Steps:

  1. Enter invalid username
  2. Enter invalid password
  3. Click the login button Expected results:
  4. User is not logged in
  5. Login page should be displayed
  6. Error message is displayed
  7. 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.```