Using setup for scenarios

In Hiptest folders, you will notice the presence of the same editor than the one you can see in scenarios or action words:

Hiptest folder setup

This editor is used to define a setup for the scenarios belonging to the folder. So basically, every scenario inside this folder will consider the folder steps as a pre-requisite for its own content (as would do a Background scenario in Gherkin).

Here is an example of a scenario inside the previous folder:

It does not contain a call to the “start the coffee machine” action word, but now if we look at the test associated to this scenario, we see that it includes the steps from the folder:

Interpreted test with Hiptest folder setup

So, with this folder definition, you can easily factorise some common setup (or pre-condition) steps shared by multiple scenarios.

One important thing to note is that this definition only applies to the scenarios that are directly inside the folder, not to ones that belong to a sub-folder (setups are not cumulatives).

Download the ebook

By submitting this form, you agree to our Terms of Use and Privacy Policy

Hiptest is FREE for open source projects

We actually utilize a number of open source components, which is why Hiptest service is free for any open source project. We are giving back to the community!

Your open source project must meet the following criteria to be approved:

  • Your project is licensed under a license approved by the Open Source Initiative
  • Your project source code is available for download
  • Your project has a publicly accessible website