Hi All,
Please help me how to pass features files as parameters while running my tests through Maven in command line .
I am using command :
mvn clean install -Dcucumber.options ="--glue classpath:features/featurefilename.feature
But it is running all the features files.
Kindly answer if anybody has used this.
Thanks in advance.
Shivi
--
-- 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.
Hi,
I tried using this but it is giving me initialization error, no such directory found.
Do we need to define classpath anywhere to run this ?
Also, when we give only directory path like mvn clean install -Dcucumber.options ="directorypath/featurefilename.feature" then it provides all definitions present in feature files.
Hi,
Thanks for letting me know the options to try this out.
As per the options, please find my findings :
You can tell cucumber to load feature files in two ways:a) Relative to your current directory:
mvn clean install -Dcucumber.options ="path/to/your/features/featurefilename.feature"
[Shivi ] : Tests are not run, I am asked to implement the steps of the feature file which I have already done.(though it runs when I run with only mvn clean install)
b) From the classpath:mvn clean install -Dcucumber.options ="classpath:features/featurefilename.feature"
[Shivi] : With this, I am still facing Initialization error. Where should I define classpath value in my code?
Please suggest.
Thanks,
Shivi
Thanks in advance.
Shivi
Hi,
Thanks for the README. I updated my cucumber versions and now it works fine.
I still wonder can we pass multiple feature files as parameters with :
mvn test -Dcucumber.options="classpath:featurename.feature"
--
Hi Roberto,I looked into the framework provided by you. I have a query how can we handle multiple stepdefinition files in this case and what about the methods @Before and @After tests, where they will be defined, in each stepdef file?
Also, how would I manage stepdefinitions which are used in more than one feature file?
You received this message because you are subscribed to a topic in the Google Groups "Cukes" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cukes/-sltUaDmYtY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cukes+un...@googlegroups.com.
Il giorno venerdì 13 settembre 2013, shivi malviya ha scritto:Hi Roberto,I looked into the framework provided by you. I have a query how can we handle multiple stepdefinition files in this case and what about the methods @Before and @After tests, where they will be defined, in each stepdef file?
You can define such methods in whichever class you like, I usually define a specific class (Environment or Hooks) where I place those methods. Remember such annotated methods are valid for each and every feature run, no matter what class is bound to the steps. If you want to include/exclude @Before/@After you have to manipulate the glue option.
Also, how would I manage stepdefinitions which are used in more than one feature file?There is no relationship between Java file and feature file other than the regexp annotation mapping: if you write a feature containing a step then cucumber-jvm will scan all the classes contained in the glue code and executes the matching one (multiple matches are treated as an error).
On Fri, Sep 13, 2013 at 2:06 PM, Roberto Lo Giacco <rlog...@gmail.com> wrote:
Il giorno venerdì 13 settembre 2013, shivi malviya ha scritto:Hi Roberto,I looked into the framework provided by you. I have a query how can we handle multiple stepdefinition files in this case and what about the methods @Before and @After tests, where they will be defined, in each stepdef file?
You can define such methods in whichever class you like, I usually define a specific class (Environment or Hooks) where I place those methods. Remember such annotated methods are valid for each and every feature run, no matter what class is bound to the steps. If you want to include/exclude @Before/@After you have to manipulate the glue option.A better way is to use tagged hooks: https://github.com/cucumber/cucumber/wiki/Hooks#tagged-hooks