-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Ability to name the hooks #73
Comments
@suswariadla would you mind elaborating on your use case a little? Interested to know the motivation and whether just |
Hey @davidjgoss Thanks for Replying. |
I think this could be useful for reporting purposes. Would you be interested in helping us implement this @suswariadla? Since the JSON format is now deprecated in favour of messages, this is something that would have to be added to the message protocol. We probably wouldn't update the existing native JSON formatters, but we could update the standalone json formatter instead. Cucumber implementations would have to extend the hook API. The syntax for various languages is already somewhat constrained because it's already used to pass tag expressions. Proposed syntax: JavaScriptBefore({name: "Take out the rubbish"}, function () {
}) Java@Before(name = "Take out the rubbish")
public void doSomething(){
// Do something before each scenario
} RubyBefore(name: 'Take out the rubbish') do
end |
@aslakhellesoy Sure, I would be happy to implement it. |
Thanks @suswariadla - much appreciated! Here is a rough outline of the steps that should be taken:
I think that's a good start. Eventually we'll also have to add an example to the compatibility kit's hook examples, and also improve fake-cucumber so it outputs We'll also have to update @cucumber/react so it can render the names of hooks. For now I'd suggest focusing on the numbered list above. Happy to answer any questions - I realise this is a bit light on detail. |
Hey @aslakhellesoy , |
You can find the Cucumber JS implementation here: https://github.com/cucumber/cucumber-js Messages (the module aslak you suggested to update) is a library that is used by Cucumber JS. https://github.com/cucumber/cucumber-js/blob/master/package.json#L162 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective. |
Any progress on this? I would like to see the description/name of the hook in reports, as now it only shows |
@suswariadla was the last person who was mentioning they would look at this. So I'll tag them to see if they worked on it. I know no-one from the core team has spent time working on this. If you are wanting to work on it yourself, let us know and someone might be able to help. |
Hey, nope. I did not finish it |
Well, I don't have sufficient time right now, and this change isn't a minor one from what I see. (minor in the sense that it needs lots of changes, not that it would be a hard one). When I get the time in the future, and this isn't yet implemented, I can take another look into implementing it. |
I'm happy to pitch in on this. I think we can do it in a few stages:
|
Closing this as completed. We have named hooks being tested in the cck fully for all cck conformant cucumbers. Any new cucumber flavours that would need conformancy would need to pass this step in the CCK. I know the main ones are already working with it |
Hi,
I don't see there is an ability to add names to the Before and After hooks rightnow.
Can the team consider adding the ability to name Before and After hooks so that they appear in the json reporter.
The text was updated successfully, but these errors were encountered: