Metrics are used to test the outcome of the actions that you have specified in your test. You can add multiple metrics to your test, all of these must be achieved in order for your test to pass.
For example, if you're testing your sign in form, you would expect that:
the server returns a 200 status code
the response data contains a token
This test has two metrics: HTTP status and response data.
There are currently 5 metric dimensions available:
1. HTTP Status
Test the server response for a specific HTTP status code from any request initiated by a user action. This includes responses from both form submissions and AJAX calls.
2. Response Time
Test the speed at which your server returned a response in milliseconds. Use this to benchmark the performance of your application by understanding how long it takes to return a response to the user.
Unlike an integration test running on your server, this simulates a real-time user interaction from a foreign location.
3. Page Change
Test if the page changed after an action took place. For example, after submitting a sign in form, was the user directed to the main application?
4. Response Data (JSON)
Test if the server returned a JSON response. You can also test for a specific variable name within the response and the type (string, array, object, number). If you want to test for multiple conditions simply create additional test metrics.
5. User Interface
Test if the UI contains or does not contain an element after the actions have been executed. For example, test if your form error handling is working by testing for an .error class after you submit it.