Before/AfterScenario has parameter uponType that determines when it will run. NORMAL type is run once for all the scenario cases; EXAMPLE type is run for each scenario case.
I am using the term "scenario case" for each row of the examples table (in case of parametrised scenarios) or the scenario itself (in case of "normal" scenarios).
When you want to define e.g. Before Scenario step, that will run before every scenario case, regardless whether it is parametrised or not, you must do something like this:
This is annoying and should be fixed. There are some ways how to fix it I can think of:
simple: Add another value to ScenarioType enum (e.g. ANY). But in this case, the name of the enum starts to feel bad.
more work: Add annotation, e.g. @BeforeScenarioCase
What do you think is better? Am I missing something? Propose a solution and I can submit a patch.