Wherever you are, you can help Ukraine

Act Now! Flag Ukraine

The Ultimate Combination Of Feature Files And Gherkin

TestFortExpert by TestFortExpert on 07/30/2014

The Ultimate Combination Of Feature Files And Gherkin

This Post’s Beginner terminology

Let’s get to business.

Quality assurance is a huge field with lots of tricks. Here is one of such. Now that we are done with terminology that will be used in this post we may get going with our combinations. Now we are getting to the question that matters. Where do we put gherkin scenarios?

Let’s say we have a User Story written in cucumber. That user story came with associated Gherkin (G) scenarios. So the main question is on where to put each scenario. The Bugs take place due to human nature. Programmers for some reason, known to them only (I don’t even know whether it’s psychological or intuitive) tend to associate every User Story to a separate G file. So your team is performing some test-first development. They will start writing Gherkin scenarios the moment their hands reach the User Story. Thus it will be nothing but natural to place these scenarios inside a new G file.


The Ultimate Combination Of Feature Files And Gherkin

You can see an Epic ‘search for customers’ in this example. It has three user stories: the search by name, address, account number. It is possible for each User story to get a personal G file, let’s say a search-by-name feature. This is an easy way to go, yet even an easier way to get involved with some trouble. The user stories will demand some updates into the Gherkin scenarios and voila – your team is in a mess. User Stories are something like a very thin vertical slice that is going through the system.  And they will certainly be rapidly followed by other exact same slices in the very same area. Having different G files makes the fact that all the functionality is being related at some higher level quite blurry.

That is but one example of making testing more complicated. Or simpler. Depends on the way you’ll be looking at things.


We use cookies to ensure your best experience. By continuing to browse this site, you accept the use of cookies and "third-party" cookies. For more information or to refuse consent to some cookies, please see our Privacy Policy and Cookie Policy