-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Before/After Hooks to be renamed #2798
Comments
Cucumber has a few different runners and reports. Where do you see the after hooks represented as |
Same thing here, would love to see this implemented |
Currently plugins are based on the events from This report is generated by the cucumber-jvm/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java Lines 327 to 349 in 7ee0983
It should be possible to include the hooks method name using An example of that can be seen here for Java, and just below it is an example for Java 8. cucumber-jvm/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java Lines 259 to 264 in 7ee0983
If this method doesn't work, the hooks name should just be rendered as To test this, be mindful that you have to declare an explicit location string in the stubbed step definitions. For example: cucumber-jvm/cucumber-core/src/test/java/io/cucumber/core/plugin/TeamCityPluginTest.java Line 306 in 7ee0983
|
The TeamCityPlugin for IntelliJ IDEA now uses the hook's method name for the name of the hook itself. For example, if we have a hook with the method name `com.example.HookDefinition.beforeHook()``, the generated name will be `Before(beforeHook)`. If we have a hook with the method name `com.example.HookDefinition.<init>(HookDefinition.java:12)`, the generated name will be `Before(HookDefinition)`. If the hook's method can't be identified then fallback to simple hook name. Closes #2798
@mpkorstanje is there any documentation on how to use cucumber messages? |
🤔 What's the problem you're trying to solve?
Cucumber for Java allows defining different @after hooks and allows ordering them, during execution all steps are just shown as After, making it difficult to discern which step failed without explicit logging inside of the steps
✨ What's your proposed solution?
Allow the annotation of the Hook to include a name or displayName such as
@after(order = 2, name="GenericCleanUp")
@after(order = 1, name="SpecificCleanUp")
and show the provided name during execution / reporting instead of showing After for every Hook annotated with @after
⛏ Have you considered any alternatives or workarounds?
Currently it is needed to either know exactly which after hooks get executed for each scenario in which order to know which one failed or to put logging into each Afterhook to check afterwards
The text was updated successfully, but these errors were encountered: