Tracking usage coverage
The core idea of Gravity is to help you build an end-to-end test suite that covers the most critical features and paths for your users. The Usages section of Gravity allows watching how your application is used and informs your testing decisions.
#What is a usage?
In Gravity, a usage is an ordered sequence of user actions within the same page or across multiple pages. When a user or test session goes through all the steps of usage, it is considered fulfilled (for a user session) or covered (for a test session).
For example, a "sign in" usage looks like this:
#Define new usage from a session
You can define a new usage from a session page:
A new screen is displayed, allowing you to build the sequence of actions that will be the different steps of the usage:
- You can select a whole page and no actions within. It will add an "Any action" event in the usage, meaning that a simple visit of the page will fulfill this step
- You can modify the page address of a usage step to make it dynamic. In the following example, the step is fulfilled on any
/transactions/...
page.
#Define new usage from a suggestion
You can define a new usage from a usage suggestion:
A modal window is displayed, allowing you to build the sequence of actions that will be the different steps of the usage:
- A usage suggestion has all its actions on the same page;
- At least one action must be selected to create the usage;
- You can modify the page address of an action to make it dynamic, as in the "Define new usage from a session" section.
#Browse usages
You can find all the usages you defined for you application under the Usages section of Gravity.
For each of them, you can see:
- The steps a session has to go through to consider the usage as fulfilled or covered
- Metrics on the user and test sessions that fulfill or cover the usage
Use these metrics to learn which usages need more tests and which ones could be less tested.
#Untested usages
A usage is considered untested if it is not covered by a single test in the current scope. You can find the list of untested usage under the usages list:
If all your usages are covered by at least one test in the scope, you get the following message:
#Define a scope
The definition of a scope allows Gravity to compute metrics for each usage on a subset of sessions containing specific traits or happening during a custom time range. Different scopes can be used on test and user sessions.
Previously collected traits can be used in the scope to exclude non-matching sessions from the computed coverage metrics. In the same way, a time range can also be defined to keep only interesting sessions: