Scriptworks provides a feature to launch test execution from a command line using curl. Full documentation can be found here
This feature allows for integration with CI tools such as Jenkins, and allows test results to contribute to indications of Build health.
Launching tests can be achieved by adding a Build Step in Jenkins as follows:
2. For Jenkins on Linux/MacOS the Command Line call using curl can be entered directly into the Shell command field as shown:
This can be used with any of the supported parameters documented for the Command Line Execution feature here
Two useful options for linking Scriptworks results with a Jenkins Build and displaying results in Jenkins are shown below:
The Run Name feature in Scriptworks can be useful as a way of linking results in the Scriptworks Dashboard with a Jenkins Build for analysis purposes:
This can be achieved by incorporating Jenkins Environment Variables into the call to the Scriptworks Command Line an example is shown below:
curl -d '{"runName": "Jenkins Build: '"$BUILD_DISPLAY_NAME"'","apiUrl": "https://app.scriptworks.io/api", "projectId": 89, "testIds":[253,2004,2003], "runSettingIds":[56],"username": "myuser","password": "mypass","outputFormat": "JUnit"}' -H "Content-Type: application/json" -X POST 'http://127.0.0.1:8081/ci/runTests/' -o Results.xml
Note - The use of the Quotes surrounding the Environment Variable are important.
To enable Jenkins to process test results and report on Build Health the call to the Scriptworks command line should incorporate the outputFormat parameter set to JUnit and the results should be output to a file for processing using the -o <filename>.xml switch. A full example of such is shown below:
curl -d '{"runName": "Jenkins Build: '"$BUILD_DISPLAY_NAME"'","apiUrl": "https://app.scriptworks.io/api", "projectId": 89, "testIds":[253,2004,2003], "runSettingIds":[56],"username": "myuser","password": "mypass","outputFormat": "JUnit"}' -H "Content-Type: application/json" -X POST 'http://127.0.0.1:8081/ci/runTests/' -o Results.xml
The results themselves are processed by Jenkins as a Post-Build action as shown below:
2. The name of the output file should be added into the step itself:
Results will then appear on the Jenkins Dashboard:
Clicking on the Chart will open the report detail showing any Failed tests:
Additional Test Detail can be obtained from the Scriptworks dashboard and clicking on the Sessionid of the test:
Any screenshots or screen recordings (in conjunction with Cloud providers such as Saucelabs) will be shown in the detail: