Re: [Cucumber] Cucumber JVM Tags with Gradle

1,728 views
Skip to first unread message

aslak hellesoy

unread,
May 16, 2013, 10:38:14 AM5/16/13
to Cucumber Users



On Thu, May 16, 2013 at 9:34 AM, Bilal Ejaz <u096...@gmail.com> wrote:
I am strugling with using tags. I have created a project which contains @Cucumber.Options(format = {"pretty", "html:build/cucumber-html-report"}, tags = {"@my", "@first"}). nevertheless when i try to run via command line using gradle cucumber -Pproject="Sugar" -Ptags="@first". by inputting this command I am expecting to run only that particular that scenario, but it runs the whole feature file it doesn't acknowldge -Ptags ="first" at all. 

Where did you read that -Ptags=xx would do anything at all??

Try this:

-Dcucumber.options="--tags @first"

Also make sure you understand how AND and OR works:


Aslak
 
Please Help.


Kind Regards, 

Bilal Ejaz

--
-- 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.
 
 

Bilal Ejaz

unread,
May 17, 2013, 5:16:58 AM5/17/13
to cu...@googlegroups.com
Hi Aslak, 

thank you for you prompt reply, I have input the following in the command line (gradle cucumber -PPlatform="Android" -PAppName="Mustatrd" -Dcucumber.options="--tags @my"). it just runs the whole feature without acknowledging the tags I am specifying. 

I have two scenarios which contains tags , below is my gradle.feature file specifying tags

@ff
Feature:Gradle-Cucumber integration

@my
Scenario: run app non-mustard
Given run simple non-mustard steps

@second
Scenario: run app mustard
Given run simple mustard steps

@Cucumber.Options(format = {"pretty", "html:build/cucumber-html-report"}, tags = {"@my", "@first"}). What I was hopping for it to execute only one tag (which is scenario with @my tag). Could you please elaborate on this matter. 

Kind Regards, 

Bilal Ejaz

aslak hellesoy

unread,
May 17, 2013, 10:52:00 AM5/17/13
to Cucumber Users
On Fri, May 17, 2013 at 4:16 AM, Bilal Ejaz <u096...@gmail.com> wrote:
Hi Aslak, 

thank you for you prompt reply, I have input the following in the command line (gradle cucumber -PPlatform="Android" -PAppName="Mustatrd" -Dcucumber.options="--tags @my"). it just runs the whole feature without acknowledging the tags I am specifying. 


Hmm, that should work. What's your Cucumber-JVM version?

Aslak
 
I have two scenarios which contains tags , below is my gradle.feature file specifying tags
 
@ff
Feature:Gradle-Cucumber integration

@my
Scenario: run app non-mustard
Given run simple non-mustard steps

@second
Scenario: run app mustard
Given run simple mustard steps

@Cucumber.Options(format = {"pretty", "html:build/cucumber-html-report"}, tags = {"@my", "@first"}). What I was hopping for it to execute only one tag (which is scenario with @my tag). Could you please elaborate on this matter. 
 
Kind Regards, 

Bilal Ejaz

--

Bilal

unread,
May 17, 2013, 3:38:51 PM5/17/13
to cu...@googlegroups.com
Hi Aslak, 

I am using cucumber 1.1.12, I had to down grade it from 1.1.13 due to some bugs which are due to patch in the new release (Ive read through your previous post to fix that one). Nevertheless, my tags did not work in either of the cucumber JVM version. Thank you for your prompt answer once again. 

Kind Regards, 
Bilal Ejaz

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/diklu9YlCYA/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to cukes+un...@googlegroups.com.

aslak hellesoy

unread,
May 17, 2013, 3:56:57 PM5/17/13
to Cucumber Users
On Fri, May 17, 2013 at 2:38 PM, Bilal <u096...@gmail.com> wrote:
Hi Aslak, 

I am using cucumber 1.1.12, I had to down grade it from 1.1.13

Neither of those versions exist. Can you check again?

Aslak

Bilal

unread,
May 17, 2013, 4:13:16 PM5/17/13
to cu...@googlegroups.com
Hi Aslak,

i downloaded the jar file for cucumber-java 1.1.12 and down graded to cucumber-java 1.1.13. I do apologise if my answer is wrong as i am new to this technology. Nevertheless I am keen and enthusiastic on expanding my skills in cucumber. 

Kind Regards, 

Bilal Ejaz

On 17 May 2013, at 15:52, aslak hellesoy wrote:

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/diklu9YlCYA/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to cukes+un...@googlegroups.com.

Bilal

unread,
May 17, 2013, 4:24:41 PM5/17/13
to cu...@googlegroups.com
Hi Aslak, 


I do understand its a weekend and you will be busy but when you are free could you also recommend a book or online material which i can use to practise my skills. 

Kind Regards, 

Bilal Ejaz
On 17 May 2013, at 15:52, aslak hellesoy wrote:

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/diklu9YlCYA/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to cukes+un...@googlegroups.com.

aslak hellesoy

unread,
May 17, 2013, 4:52:28 PM5/17/13
to cu...@googlegroups.com
See rule 2 at the bottom of the mail.


On Friday, May 17, 2013, Bilal wrote:
Hi Aslak,

i downloaded the jar file for cucumber-java 1.1.12 and down graded to cucumber-java 1.1.13.

Really?? I said these versions don't exist. You meant 1.1.2 and 1.1.3 right.
3) If you have a question, don't reply to an existing message. Start a new top 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/diklu9YlCYA/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Bilal

unread,
May 17, 2013, 4:57:24 PM5/17/13
to cu...@googlegroups.com
Hi Aslak, 

I am extremely sorry, yes you are correct, the version i am using is 1.1.2 which is downgraded from 1.1.3. I do apologise for this mistake. 

Kind Regards, 

Bilal Ejaz

aslak hellesoy

unread,
May 17, 2013, 5:04:01 PM5/17/13
to Cucumber Users
On Fri, May 17, 2013 at 3:57 PM, Bilal <u096...@gmail.com> wrote:
Hi Aslak, 

I am extremely sorry, yes you are correct, the version i am using is 1.1.2 which is downgraded from 1.1.3. I do apologise for this mistake. 


No worries. Now please read rule 2 at the bottom.

aslak hellesoy

unread,
May 17, 2013, 5:06:49 PM5/17/13
to Cucumber Users
On Thu, May 16, 2013 at 9:34 AM, Bilal Ejaz <u096...@gmail.com> wrote:
I am strugling with using tags. I have created a project which contains @Cucumber.Options(format = {"pretty", "html:build/cucumber-html-report"}, tags = {"@my", "@first"}). nevertheless when i try to run via command line using gradle cucumber -Pproject="Sugar" -Ptags="@first". by inputting this command I am expecting to run only that particular that scenario, but it runs the whole feature file it doesn't acknowldge -Ptags ="first" at all. 
Please Help.


Grab a fresh copy of cucumber-jvm from git and cd into examples/java-helloworld. Then try this:

mvn test
mvn test -Dcucumber.options="--tags @foo"

The second run should only run a single scenario, while the first one should run them all.

Aslak

Bilal Ejaz

unread,
May 17, 2013, 7:47:52 PM5/17/13
to cu...@googlegroups.com
HI Aslak, 

Thank you for your reply, I will try this example. Also i will be buying your book to get further inside of cucumber. 

Kind Regards,

Bilal Ejaz
Reply all
Reply to author
Forward
0 new messages