Warewolf Test Coverage framework enables a summarized view of the tested service’s nodes versus nodes not yet covered by any test using the Warewolf Test Framework.
To quickly review nodes covered for each one of your services, you can Run Tests Coverage from the explorer in the studio.
Running your first Test Coverage
Test coverage depends on existing service tests.
- You can Run All Tests to update all your test records and/or if you need to see if they exist.
From within Warewolf Studio: In the Explorer, to open the Test Editor, select a service, folder containing multiple services, or even the server name to select all the services on the selected server and click Run All Tests:
Tests found on the selected folder or service will be run and the browser will return a JSON formatted output using the URL:
- Now you are ready to run your first test coverage.
Go back to the Explorer and select the folder or service you want to run coverage for. Right-click and select Test Editor and click Run Tests Coverage.
Test Coverage will be returned as HTML in your browser using the following URL:
- For more detail regarding your tested service nodes, on the browser URL:
http://localhost:3142/secure/Hello%20World.coverageadd .json to the URL as follows:
This will return a JSON formatted output as follows:
In the JSON report, you will see which nodes are covered by the test. It will display if the node is mocked or not. Mocked nodes are not executed during the test which is useful when your service calls a database or another workflow.
Mocked nodes are excluded from the total number of nodes covered by tests. But these mocked nodes will still be calculated as one of the workflow nodes when the coverage percentage is calculated. So the more mocked your service is the less coverage you will get.
Tests Invalid are tests that are not covering any node of your service. To increase your coverage, go back to the Test editor and select nodes to be covered by the test. Run All Tests and Run Tests Coverage again.