We have recently started using BDD to write our requirements. It's been really helpful, it made the communication between analysts and developers a lot easier. (Combined with user interfaces, and old school requirements)
Now we are thinking about writing our test cases with BDD. When I search online for the best practices I see a lot of different variations on how to write it.
There are some examples like:
- Given > And(s) > When > And(s) > Then > And(s)
- Given > And(s) > When > Then > And(s)
Problem is almost all examples are for very simple cases, on the other hand we'd like to write scenarios that includes multiple actions, multiple system outputs (warnings, errors etc.) and multiple outputs.
We are trying to figure out best way to write BDD for following scenario:
- We need to check if the user is authorized
- And he/she is in the correct module
We want user to do following actions:
- User sets a start date
- User sets an end date
- User selects a category
- User selects sub-categories (based on selected category)
- User clicks Run
- System throws a warning because there is no polygon on map
- User close the warning
- User draws a polygon on map (and each step to draw a polygon has a validation in backend, and visually rendered on map)
- User stops drawing
- User clicks Run
- System generates a chart.
The reason we have such a long story is that this is a common scenario that can happen and we want to make sure that users are able to go back to happy path.
What do you think is the best way to handle such scenario using BDD?
Aucun commentaire:
Enregistrer un commentaire