Note: If your product is an API, please see Post not found: api-tests as this might not be relevant to you.
These tests exercise the product from a point of view of the user.
For the purposes of this reference, these refer to tests which include a Graphic UI of some kind as while User Flow Tests should exist in any project, the things they must deal with are different based on the project.
These are usually the most expensive, slowest, and most brittle tests within a suite.
You want to keep them limited to the critical paths - where critical is defined as “if this is broken it is an emergency we must fix no matter what time it is”.
Obviously you will want to make sure these tests are as reliable as possible and utilize techniques to reduce their brittleness and increase their maintenability.
For most User Flow Suites which utilize a browser, Page Object Model is recommended.
Some tools, like Cypress, include page actions which can be used for more reliable interactions at the cost of no longer mimicking what a user can do. These techniques are worth being aware for the times when the tool cannot otherwise continue the flow in a reliable way.
- Can be cross browser
- Can be used in conjunction with other tools for specialized testing
- Easiest to write
- Mimicks user actions
- Long running
- Hardest to maintain
- Ensure users can accomplish their primary goals
- Test edge cases which are either not critical or can be tested via almost literally any other method
- Use BDD framework without a really good reason. See note in the example
(Note: I do not recommend using BDD, like cucumber, in your actual testing framework as it adds an unnecessary layer. Instead write clear code methods. However, BDD is useful as a conceptual tool for psuedo code and story writing)
User Buys A Product
Given user McTesty exists
And product Toy exists
When McTesty logs in
And McTesty searches for Toy
And McTesty adds Toy to basket
And McTesty checks out
Then McTesty should see a buy confirmation for Toy
- Usually using Post not found: unit-tests as well