lundi 25 juin 2018

Reuse features in Cucumber

I want to test an app using Cucumber and Gherkin. Now I have the login part and then I have a form. Now I want to test this form for validation, but there ara many combinations taht I can do with valid and invalid data there and so a big number of tests.

Is there a way to reuse the feature of login so I do not have to insert the code in each new feature of validation?? I read this enter link description here, but it doesnt work for me.

I do it like this:

 Scenario: Test1
   Given I have already logged in
   step login 
   step put username
   step put password
       
   When I put validation data

   Then ...
Where each one of teh steps is astep definition of login feature and works. It gives me parse erros this way, maybe because the solution is for Ruby and I am using javascript? How can I reuse the login feature??

Aucun commentaire:

Enregistrer un commentaire