Fix Our Gherkins Challenge

Improve our Gherkins and Win Prizes

Every week in May 2022 we publish here a new challenge. The goal of each one is to improve a from us provided feature file. These feature files have some issues and your task is to improve these.
All of them are about the Tricentis Vehicle Insurance Application, which can be found here.
To take part in the challenge you will need a SpecFlow Account, as we are using our Online Gherkin Editor to submit your solution.
Upskill your Gherkin knowledge
The three best submissions will win a $25 Amazon Gift card
(decided by the SpecFlow Team, no objection possible)
Earn one certificate for participating in any challenge

How does it work?

Every challenge has a link to a feature file, that is shared via our Online Gherkin Editor.
To submit your solution, you need to share your version of the feature file also with the Online Gherkin Editor.
Please share it as "Anyone with the link can view" with us.
When the challenge is over (always ends on Sunday), we will have a look at the submissions and choose the three winners.
ShareFeatureFile

Multiple Checks in one Scenario

As this is our first challenge, we are starting with an rather easy to fix feature file. Someone wrote a scenario to check, if depending on the chosen vehicle type the correct input fields are displayed.

See the challenge

This is SpecFlow's solution

The biggest issue with this feature file was the multiple When/Then combinations.
You can almost every time make multiple scenarios out of it.

The second issue is, that it was too much focused on the UI. You can formulate it in a way, that the scenario is independent of the UI and you can automate then on a level of your choosing.
More details here.

See our solution

This weeks winners:

Too Much Details

Our second challenge shows an issue that we are seeing very often out in the wild. The scenarios are polluted with too much unnecessary information. Please clean up these scenarios!

See the challenge

This is SpecFlow's solution

We did the following things to clean up the scenarios:

  1. Create a definition for a car, that is referenced by name in later steps
  2. Remove all data for a person that is not influencing the calculation
  3. Combine the three scenarios to one scenario outline as the only difference between the scenarios is the annual mileage
See our solution

This weeks winners:

Handling Empty Data

Our third challenge combines issues from the first and the second challenge. It was written like a test script as a guide on what to do in the application.

See the challenge

This is SpecFlow's solution

We combined all the Given- Statements into a single one. There is no need to have so many details in your Given statements. 

Also, we change the formulation to be less UI-dependent.

See our solution

This weeks winners:

Rewrite a Test Script

In the last challenge, you have two scenarios, that were written like a test script that was recorded with a tool like Selenium IDE.

See the challenge

This is SpecFlow's solution

Again we are hiding all technical details in the automation layer and concentrate on the behavior in the scenario. So all selectors were removed from the steps.
Also the first scenario won’t fail in every month that has not 31 days.

See our solution

This weeks winners: