Hook after and before group of tagged scenarios
Hi,
I'd like to suggest you adding new kind of hook destined for running before and after group of scenario that can be used also by scenario outlines.
I'm unable to run hooks before and after group of tagged scenarios. I want to avoid creating test data for each scenario in group, the reason is because data setting takes a lot of time. It would be good to use conditinal hooks, so that select specific scenarios.
New before hook should be run when the first scenario in group is starting, whereas new after hook ought to be started when last scenario will be finished. In case group with only one scenario, the hooks should be started before and after single scenario. I suggest to use following names for hooks: @BeforeGroup and @AfterGroup.
Example usage, where hooks are running before and after group of scenarios tagged as Game:
# The first scenario in group
@game Scenario: Maker starts a game When the Maker starts a game Then the Maker waits for a Breaker to join
# The second scenario in group
@game Scenario: Breaker joins a game Given the Maker has started a game with the word "silky" When the Breaker joins the Maker's game Then the Breaker must guess a word with 5 characters
@BeforeGroup("@game") public void doSomethingBeforeGroup(Scenario scenario){ }
@AfterGroup("@game") public void doSomethingAfterGroup(Scenario scenario){ }
Regards