Forum Discussion
Hi matiq
We won't be adding this feature as it would lead to coupling between scenarios. Slow tests are usually an indication that your application is too tightly coupled.
Hi,
Thanks for your reply.
The hooks would be responsible for set up environment for some groups of autotests and it won't be lead to coupling between scenarios. The autotests aren't slow, but environment configuration takes a lot of time for some of them.
From my perspective they can be work similar to hooks "beforeAll" and "afterAll", but new ones will be destined for set up environment for group of autotests.
Regards
- mpkorstanje5 years agoOccasional Contributor
Cucumber currently doesn't support this. You may however be able to replicate this by using a conditional before hook and JUnits after all hook.
In the conditional before hook, if the environment hasn't been created, you create it. In the after all hook, you clean up all created environments.You can keep a reference to all created environments in a static variable.
Related Content
- 4 years ago