Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
309 views
by
retagged by
I have created one feature file which has 4 scenarios. Do I need to create 4 step definitions or only 1?

If 1 then is it ok to have multiple @Given, @When and @Then in one step definition?

1 Answer

0 like 0 dislike
by The go-to Tester (142 points)

It depends on the complexity of the elements in page. If the scenario involves interaction with elements in multiple pages, or a single page having too many elements then it’s better to split into multiple step definition classes. This will help out in maintaining your tests well versed

Currently working on a PoC for BDD with Specflow + NUnit so my take always are

1. Multiple scenario with single Feature file

2. Common Step definition file for generic functions

3. Generic file for handling utils functions

...