dimanche 8 juillet 2018

Where cucumber then

When I'm doing an end-to-end test by using cucumber, where would the testing flow stop? For example, we have several steps here:

  • I walk into a shop
  • I select some items
  • I pay for them
  • I get my receipt
  • I walk out of the shop
  • I walk to my car

If the first part of cucumber tests like this:

Given I walk into a shop
when I select some items
And I pay for them

Then, what assertion should I use? I expect the result should only to be I get my receipt, but it seems I walk out of the shop will also work since it will also be the result after I pay for the items as long as it will happen after the payment, and so does I walk to my car. Then it becomes unclear. How does the cucumber Then work? Why would it assert the two different assertions/stages to be right? Thanks!

Aucun commentaire:

Enregistrer un commentaire