When Cucumber JVM goes through my feature file(s) and generates the java code snippets, it skips similar steps that is has already generated code for. For example if I have two separate features that both start with "@Given I view the login page" it will only generate the java code for the first occurrence. I know this is how most want to use cucumber but I want a 1 to 1 relationship for my implementation. Even if the step for both features is the same I want it to generate the java code twice. Yes I know this would create an issue if I put all my Java into a single file but I am not.
Is there an option I can use or a way to force cucumber to generate a snippet for each feature step?Thank you in advance :)
--
-- Rules --
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Thank you for the reply. I was going to write my own run manager that would individually pick and run the java files. Would doing it this way still cause a conflict?
If not, going back to my original question, despite being frowned upon, can you force Cucumber to output 1:1 relationship snippets and ignore the fact that its a duplicate?
On Friday, November 15, 2013 11:39:36 AM UTC-5, Aslak Hellesøy wrote:Please don't top post. See rule 2 in the email footer.On Fri, Nov 15, 2013 at 3:40 PM, <cyas...@gmail.com> wrote:
Thank you for the reply. I was going to write my own run manager that would individually pick and run the java files. Would doing it this way still cause a conflict?All step definitions are stored inside RuntimeGlue. Adding one with the same pattern as one that is already added will throw a DuplicateStepDefinitionException.
The framework we came up with was to use cucumber to auto generate the java snippets and create individual java files for each feature. From there we would use our own run manager with selenium integrated to kick off the java file, read through it, and then determine if it passed or failed. My understanding is that the run manager would not be looking at any feature files at this point and would just run the java code that we have supplied for the single feature and execute it that way. It should not have to make a decision as to which step to pick because the steps with all supplied code would be in the individual java files and it would only be looking in that one java file. Perhaps we are not using Cucumber correctly so please let me know if there are obvious flaws in my thinking.
My only other comment would be that if doing it the other way where cucumber generates the java code for say 150 features,
and all that java code sits inside one java file, maintaining that file would be difficult. If the "log-in" button where changed to say "sign-in" and you only wanted to change the one code line to correct this, it would be difficult to look through the entire java file to find this one line. Doing it the other way you could say, "oh Feature 29 tests log-in" and just update the code under "@Given" in Feature 29's Java file.
Please do not email me privately. Here is why:
I'm bringing this discussion back to the list.
On Fri, Nov 15, 2013 at 5:32 PM, <cyas...@gmail.com> wrote:
On Friday, November 15, 2013 11:39:36 AM UTC-5, Aslak Hellesøy wrote:Please don't top post. See rule 2 in the email footer.On Fri, Nov 15, 2013 at 3:40 PM, <cyas...@gmail.com> wrote:
Thank you for the reply. I was going to write my own run manager that would individually pick and run the java files. Would doing it this way still cause a conflict?All step definitions are stored inside RuntimeGlue. Adding one with the same pattern as one that is already added will throw a DuplicateStepDefinitionException.The framework we came up with was to use cucumber to auto generate the java snippets and create individual java files for each feature. From there we would use our own run manager with selenium integrated to kick off the java file, read through it, and then determine if it passed or failed. My understanding is that the run manager would not be looking at any feature files at this point and would just run the java code that we have supplied for the single feature and execute it that way. It should not have to make a decision as to which step to pick because the steps with all supplied code would be in the individual java files and it would only be looking in that one java file. Perhaps we are not using Cucumber correctly so please let me know if there are obvious flaws in my thinking.It sounds like you are using Cucumber-JVM very differently from how it's intended to be used. It sounds like you are complicating things by building stuff around it.
You're not supposed to create something outside cucumber to start cucumber.Instead, start cucumber from your preferred build tool:* Maven* Ant* IDE* ScriptAnd use one of the following built-in runners:* JUnit* cucumber.cli.api.Main* Android runnerIf you want to run a subset of features, do so with --tags.Aslak
My only other comment would be that if doing it the other way where cucumber generates the java code for say 150 features,I don't understand what you mean. Cucumber doesn't generate code at all.
It just prints a stepdef snippet to stdout when it encounters a gherkin step it can't match. Typically this would be 2-3 steps when you're working on a new scenario.If you have hundreds of undefined steps you should definitely consider a more incremental development process.
for the features they want to test?
Thank you for your patience with me. As you can tell I am VERY new to cucumber. Before I even saw your reply I was talking to my team and said that we will probably have to break our class files down to domains instead of our initial 1:1 idea. Your reply is all the confirmation I need that this is the right choice. Thanks for pointing me in the right direction, we've already started working on this.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Just as an example: if you are using Cucumber to create an automated test suite then you are missing a big value point of Cucumber.I know this is an old post but please elaborate why Cucumber would not work for an automated test suite?