-
Notifications
You must be signed in to change notification settings - Fork 36
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
Providing steps definitions basic implementation when running a new feature. #58
Comments
Oh, I forgot to ask/suggest, but did you have tried to reach out cucumber team to show your work and perhaps get some help? I think it would be good to have feedback and even code from them. @aslakhellesoy in this link shows that they are very nice and could join in this effort. It would be very cool have them here to help take White-Bread beyond and maybe even become an official implementation. Cheers. |
Hi @danielfoxp2. Firstly thank you for taking the time to raise an issue. I really appreciate it. White bread already uses a features directory. Is there something I could do to make this clearer? mix white_bread.new_feature my_cool_feature I added your feature above to a file called Default context module not found in features/contexts/default_context.exs.
Create one [Y/n]?
y then
So it gives the code for the first undefined steps but not all of them. I agree it would be better to create all of them so I've created #59. As for I'm testing feature A in the context of my http API. Do you think there's anything I could do to make the relationship between contexts and step definitions clearer? I'm currently working on V3 of this tool so now is a good time for any breaking changes to happen. |
Thanks for your fast reply and action. About the feature directory: Yes, White-Bread already has it. There is no need to make it clearer and the new command suggestion is not needed too. In fact, your suggestion comes, I think, because my text was not well formed (sorry hehe). I should've explained that I noted the feature directory exist and my focus was on step_definitions directory. With your explanation about the inspiration coming from behat, now I have a better understanding. But maybe some work on docs would be cool. A .gif or short video showing the simplest configuration in place and white_bread running an example feature could worth a thousand words hehe. Now about the step definition implementation: In my case, White-Bread is showing every parsed line. Is it normal? Yesterday, after all lines parsed the output was that all feature had passed, today the message shows it failed and the first implementation suggestion (like you described). loading features/contexts/default_context.exs
02:52:47.536 [debug] Parsing line: "feature: Testing"
02:52:47.536 [debug] Parsing line: "As something "
02:52:47.536 [debug] Parsing line: "I want to do one thing"
02:52:47.536 [debug] Parsing line: "So that I can feel complete"
02:52:47.536 [debug] Parsing line: "Scenario: First Scenario"
02:52:47.536 [debug] Parsing line: "Given I am serious"
02:52:47.538 [debug] Parsing line: "When I make a joke"
02:52:47.538 [debug] Parsing line: "Then nobody laugh"
... I don't know if I will be able to contribute to #59 because my actual lack of skill, but this feature it is a good thing to White-Bread have. To make context and step definitions relation clearer, I think that #59 could address it by creating not just only the console output but the context file with those steps definitions implemented if the user wanted it so as this scenario describe it: Scenario: Creation of steps definitions initial implementation
Given I executed a feature that has zero step definition implemented
And I am asked if I want that White-Bread creates these steps definitions
When I answer yes
Then a step definition file is created
And the initial implementation is inserted in the new step definition file
And I should be informed that the steps definitions were successfully created
And I should be informed where the file was created Thank you again. Do you think this issue can be closed or is better to wait till #59? Cheers. |
i totally agree with @mgwidmann, |
I am trying to learn Elixir. Having some kind of obsessive-compulsive disorder I want to do it in a certain way. This includes cucumber. I look around and found your port of it. Great, made my day and I really appreciate the effort and the work done. So, before anything, thank you.
But I am missing some things that I take for granted, like the features and step_definitions directories, the suggestion of implementation of steps when running a feature without steps definitions, and others little things. In this issue, I will ask about one of this things and make a suggestion/request for another one.
I only have used cucumber.js and SpecFlow, but I already saw original ruby cucumber and all these three work very similar in this regards (i.e. directories names and places and features without step definition implemented).
I looked in the code but, as a beginner, it was hard for me to understand and have the confidence to change it. But, if you let me, I thought a way that I could help and so I created the things below.
Let me know if it's valid or if it's out of concern for White-Bread now and future. Thank you again.
In SpecFlow, inside Visual Studio, I am able to use the IDE to generate the steps automatically or just copy the steps definitions to clipboard. In cucumber.js, we can see the steps definitions suggestions in the console and we can copy to clipboard too, but manually. With Elixir, I am thinking in use some kind of SpecFlow variation.
The actual behavior of White-Bread when it comes to run features that do not have steps definitions implemented is a kind of misinformation since it shows that the feature passes. So my user story described above can address this misinformation issue too, which is a serendipity welcome gain.
You have your reasons, of course, but why you choose not to follow the behavior of cucumber for ruby when it comes to names and places of directories (i.e. Having a features directory and inside of it the steps definitions directory - named steps_definitions - where all implementation of each step in a feature is placed)?
I am really sorry for any mistake that I probably made writing this. English is another language that I am trying to learn.
Some sources to exemplify myself, I don't know if it is needed hehe...
https://blog.codecentric.de/en/2013/08/cucumber-setup-basics/
https://www.custardbelly.com/blog/blog-posts/2014/01/08/bdd-in-js-cucumberjs/
Cheers.
The text was updated successfully, but these errors were encountered: