Description
The system should be able to import TestNG tests and results by using either the REST API or the "Import Execution Results" action within a Test Execution's issue screen.
 TestNG is a testing framework for Java.
It should provide support:
- test methods
 - test groups
 - parameterized tests
 
Parameterized Tests are imported to the same Test Run, where each set of parameters is identified by a different context.
TestNG's groups are not mapped to any special entity. However, the execution details screen will show the Test group related to a specific test result (e.g. "parent group.subgroup1 - TestMethodBla(1,2,3)" ).
Mapping of fields from the report to the Test issue
| TestNG XML report | Test in Jira | 
|---|---|
| "methodname" attribute | Summary field | 
| "classname" attribute + "." + "methodname" attribute | Generic Test Definition custom field | 
| groups | labels | 
Similar to what is available for other formats (e.g. JUnit, NUnit), two endpoints shall be provided: a standard one and a multipart variant.
POST /rest/raven/1.0/import/execution/testng
| parameter | type | description | 
|---|---|---|
| fixVersion | String | - the Fix Version associated with the test execution (it supports only one value). | 
| projectKey | String | 
  | 
| revision | String | 
  | 
| testEnvironments | String | - a string containing a list of test environments separated by ";" | 
| testExecKey | String | - key of the Test Execution. | 
| testPlanKey | String | 
  | 
POST /rest/raven/1.0/import/execution/testng/multipart
Ex: curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" -F "info=@testExec.json" http://yourserver/rest/raven/1.0/import/execution/testng/multipart
References:
Attachments
Issue Links
- duplicates
 - 
                    
XRAY-335 Support the import of execution result format from TestNG
-         
 - Closed
 
 -