This workflow accepts any parameter URL from DTP's Explorer views (Test Explorers and Violations Explorers) and passes the parameters to the DTP REST API so that it can query the test cases and generate a CSV output.
In this section:
See Downloading and Installing Artifacts for instructions on installing DTP Enterprise Pack extensions.
The workflow provides endpoints specific to the service. To get the endpoint URLs, click on the category in which the artifact is running and expand the appropriate services.
The Convert Results to Data needed for CSV function node constructs a msg.payload object array for the CSV node to accept.
The CSV node header columns list must be used to construct a new msg.payload object array.
The two items must be in sync. Review the DTP REST API documentation to become familiar with how to customize CSV output from the violation or test case data.
Any fields returned from the /dynamicAnalysisTestCases and /staticAnalysisViolations APIs can be included in CSV output.
The /dynamicAnalysisTestCases API returns data from the Test Explorer.
Populate the request parameters with URL parameters and click Send Request to view the output.
In the Convert Results to Data needed for CSV node, the values in the csvEntry variable must match the fields specified in the API. For example, if you want to add branch from the resource to be exported. You would add a branch column name and assign a value. Each test case will be under the testCase variable and the branch will be under the testCase.resource object.
Edit the CVS node and add branch to the Columns field.
The /staticAnalysisViolations API returns data from the Violations Explorer.
As with the Test Case Explorer, any output from this API can be exported to CSV. See DTP Test Case Explorer for details.
http://<DTP Server>:8080/grs/dtp/explorers/test?filterId=71&buildId=parabank-cbt&action=Retest
Run CURL or make an HTTP request to the endpoint with the parameters in your URL. For example:
curl http://localhost:8321/slices/d3cbc19d.a299d?filterId=71&buildId=parabank-cbt&action=Retest
curl "http://localhost:8321/slices/d3cbc19d.a299d?filterId=71&buildId=parabank-cbt&action=Retest" > retest-7-parabank-cbt.csv