I am trying to use Testrail as a test case management system and so, integrating testrail with the Jenkins would be useful.
This is what I want to achieve:
Lets say I manually create three test cases in testrail with case ID's C1, C2 and C3 and these test cases will have some unique automated test names such as A1, A2, and A3 (in more info, there will be a field in testrail with such a unique information)
When I hit "Start Automated Tests" button and run a Jenkins job from testrail (considering I have already implemented UI script for testrail that has this button):
, I want to run a script/something that takes the case ID's of the selected test cases and annotate those IDs to the actual Java tests temporarily so that it can run those specific tests and post results back to the Testrail.
Approach I can think of:
When I hit "Start Automated Tests" button on Testrail, I can make a script to run to create an XML file that will include the desired selected test cases from Testrail. This XML will then be provided as a default input to the Jenkins job and it will run the test cases mentioned in the XML file. This XML will be temporary and will be replaced everytime the selection is made from the Testrail. However, how do you do it? I am a newbie to the Testrail and read its API and looks like API will be useful to post the results back to the Testrail. But, how do we achieve the mapping of the ID's?
Also, any advise on posting results back to the Testrail will be useful.