Question
Cucumber Hook Execution Order with Tagged Scenarios
Sky Lane
0 reputation · 17 Nov 2021, 10:16 UTC
89K views0
Cucumber utilizes @Before and @After hooks to manage setup and teardown logic. While the order parameter allows for precise sequencing of global hooks, the interaction between global ordering and tagged hook execution requires clarification.
When a scenario matches both a global hook (with a specific order) and a tagged hook, it is unclear if the tagged hook respects the global order sequence or if tagged hooks are prioritized regardless of the assigned order value.
- Does the
orderparameter apply across both global and tagged hooks collectively? - If two tagged hooks match a scenario, does the reverse-order execution rule for
@Afterhooks remain consistent with global hook behavior?