-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
🤔 What's the problem you've observed?
When we have scenarios tagged with @Skip
, Cucumber knows to "ignore" each step - even though it goes through the scenario and marks each step individually as "IGNORED." It is also executing all before/after hooks for skipped scenarios.
✨ Do you have a proposal for making it better?
If a whole scenario is skipped, under what circumstances would we want to execute the hooks or review each individual step in the scenario. It just takes more time and resources for no apparent value:
- The before hook sets everything up for a scenario that doesn't run.
- The review of each individual step provides no value - we know we're skipping it and it displays as such on the report (Serenity).
- The after hooks runs and acts to close out a scenario that never ran. This ends up wasting time and resources, and often errs because it's trying to act on a scenario it's assuming has run.
Basically, if we tag a Scenario as @Skip
, it should actually skip the whole scenario (or there should at least be an option for that). Test automation requires enough time and resources as is, we shouldn't be needlessly wasting more.
📚 Any additional context?
If there is a concept we're missing, please let us know. Most teams I know use the before hook for authorization or data setup, and the after for tear down and data restoration. If the scenario doesn't run, those aren't needed. Why would we want to run all that if we're skipping a scenario?
We know we can use "not @Skip" for tags and/or @ExcludeTags("Skip")
in the Junit executor, but this completely disregards them, eliminating them from the report, which keeps them out of sight, out of mind, and we need our report to be able to call attention to skipped tests.