Agiletestware Pangolin TestRail Connector plugin integrates Jenkins with TestRail by automatically publishing test results from Jenkins to TestRail using Pangolin server (http://www.agiletestware.com/pangolin/).
The plugin allows users to integrate TestRail into their CI workflow without writing a single line of code.
Installation of Jenkins plugin can be easily done from Jenkins Plugin Manager:
Please restart Jenkins Server after the installation of plugin
Pangolin global configuration is accessible on "Mange Jenkins" - "Configure System" screen:
|Pangolin URL||URL for Pangolin server. Example: http://some-server:8888|
|TestRail URL||URL for your TestRail instance. Example: https://testrail:8080|
|TestRail User||Name of user in TestRail|
|TestRail Password||Password for TestRail user|
|Upload Timeout||The number of minutes to wait for the Pangolin server to process the request. 0 means wait indefinitely|
When all fields are set, please click on "Save Configuration" button - Pangolin will check availability of entered URLs and encrypt your password.
To upload test results into TestRail, a new "Pangolin: Upload test results into TestRail" post-build action has to be added:
|Field Name (pipeline property)||Required||Description|
|Project (testRailProject)||Yes||The name of project in TestRail to which results should be exported|
|TestRail User (testRailUserName)||No||If specified, overrides TestRail user name defined in Global Configuration|
|TestRail Password (testRailPassword)||No||If specified, overrides TestRail user password defined in Global Configuration|
|Test Path (testPath)||Yes||Path to where Pangolin should test definitions, must contain suite name in the beginning (for single-suite project, suite name is always 'Master'), e.g. Master\Section1\Section2|
|Format (format)||Yes||Format of test results generated during the build. Available values: junit, nunit, testng, trx, cucumber, robot|
|Results File Pattern (resultPattern)||Yes||Provide path to the report file(s) generated during the build. This is a comma separated list of test result directories. You can also use Ant style patterns such as **/surefire-reports/*.xml|
|Test Run (testRun)||No||Name of test run in TestRail to which test results will be added|
|Test Plan (testPlan)||No||Name of test plan in TestRail to which test results will be added|
|Milestone Path (milestonePath)||No||Path to a milestone in TestRail to which test run/plan will be added. E.g. Milestone1\Milestone2|
|Case Fields (customProperties)||No||Values for custom case fields in TestRail. The format is [TestRail field system name]=[value 1], [TestRail field system name]=[value 2]... E.g.: custom_user_field1=foo, custom_user_field2=bar|
|Fail build if upload unsuccessful (failIfUploadFailed)||N/A||If checked, the build will be marked as failed if for any reason the plugin was not able to upload the results. This could be due to Pangolin server issues, TestRail server issues, network issues, etc.|
To add more than one upload configuration, just click on "Add More" button.
Here is an example of pipeline configuration for exporting test results to TestRail:
pangolinTestRail([ testRailProject: 'project', testRailUserName: 'user', testRailPassword: 'encrypted password', configs:[[ testPath: 'Master\\Section1\\Section2', format: 'JUNIT', resultPattern:'**/surefire-reports/*.xml', testRun:'test run', testPlan:'test plan', milestonePath:'milestonePath', customProperties:'custom_required_field=foo', failIfUploadFailed: true ]], ])
When pipeline script is used, value for testRailPassword must be encrypted. Password can be encrypted by navigating to Pangolin Server GUI page (http://pangolinUrl) and clicking to Password Encryption link.
Once the job is configured, simply run the job. Here is Jenkins job output example:
Results in TestRail:
Test Plan and Test Run:
Created Milestones hierarchy: