Using setup for scenarios

Applies to CucumberStudio Cloud, and to Enterprise ver. 3.3 - 3.5.6.0. Last updated on November 17, 2023

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

CucumberStudio folder setup

Click the image to enlarge it.

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:

CucumberStudio folder setup: Folder contents

Click the image to enlarge it.

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 CucumberStudio folder setup

Click the image to enlarge it.

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).

See Also

Best practices for scenario writing

Highlight search results