cucumber - repeat steps in specflow -
i'm having long scenario specflow , need add 3 users, steps same. how can repeat couples of steps in flow?
scenario outline: register multiple users
given go page #login , click on sign in button when enter email 'mail@gmail.com' , enter password '123456' , click on submit button , click on events list button , open event , go new opened page , click on register event button
these steps need repeat
when click on person title '<title>' , select ticket package , select ticket quantity '15' , click on submit registration button , enter mail <email> register event , enter first name <first name> register event , enter last name <last name> register event , click on submit registration button , click on submit registration button examples: | title | email | first name | last name | | person 1 | mail1@mail.com | person1 | person1 | | person 2 | mail2@mail.com | person2 | person2 | | person 3 | mail3@mail.com | person3 | person3 |
stop repeating , finish scenario
when click on continue button 3 user should in list
what did , seems working fine me
when register multiple users '3' event click on 'person'
[when(@"register multiple users '(.*)' event click on '(.*)'")] public void whenregistermultipleuserstoeventclickon(int userqty, string title) { (int = 1; <= userqty; i++) { whenclickonpersontitle(title + " " + i); whenselectticketpackage(); whenselectticketquantity(10); whenclickonsubmitregistrationbutton(); whenentermailtoregistertoevent("mail" + + "@mai.com"); whenenterfirstnametoregistertoevent("name" + i); whenenterlastnametoregistertoevent("lastname" + i); whenclickonsubmitregistrationbutton(); whenclickonsubmitregistrationbutton(); } }
Comments
Post a Comment