jeudi 3 octobre 2019

Cucumber: loop through steps withing scenario

I'm writing test using Java, Intellij, Selenium + Cucubmer. I have a simple test scenario:

  Scenario: Add X random products to the shopping cart

      Given I choose a random product from a list
      When I add random quantity of the product to the shopping cart
      Then I see that number of products in the cart was updated

After last step I should go to first step and repeat all process X times. I don't know how to achive it within one scenario without copying steps. Is it possible to run steps 1-3 in a loop?

Aucun commentaire:

Enregistrer un commentaire