[JVM] Running cucumber with multiple tags

2,590 views
Skip to first unread message

Andrii Dzynia

unread,
Sep 5, 2012, 4:59:19 AM9/5/12
to cu...@googlegroups.com
I need to run features that have @done and @important annotation. I read  https://github.com/cucumber/cucumber/wiki/Tags and when I trying to pass the parameter -DtagArg=@done -DtagArg=@important(mvn run cli cucumber) I get that all the tests are running.

The question is how I can use logic AND in JVM implementation?

aslak hellesoy

unread,
Sep 5, 2012, 5:24:20 AM9/5/12
to cu...@googlegroups.com
Make sure the CLI gets these arguments: --tags @done --tags @important

How you pass that from your shell to Maven via system properties is up to you.
The JVM doesn't allow you to specify a system variable twice (the last
one will just clobber previous ones).

For example - in your pom:

<argument>${cucumber.tags}</argument>

And from your shell:

-Dcucumber.tags="--tags @done --tags @important"

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

Andrii Dzynia

unread,
Sep 5, 2012, 6:33:17 AM9/5/12
to cu...@googlegroups.com
Thanks,

The next thing I want to do is to run cucumber with jUnit runner and tags. Could you help me with this please?

aslak hellesoy

unread,
Sep 5, 2012, 6:45:40 AM9/5/12
to cu...@googlegroups.com
On Wed, Sep 5, 2012 at 11:33 AM, Andrii Dzynia <d3u...@gmail.com> wrote:
> Thanks,
>
> The next thing I want to do is to run cucumber with jUnit runner and tags.
> Could you help me with this please?
>

No need to ask the same question twice. And please don't top post. See
rule 2 below.

Aslak

Andrii Dzynia

unread,
Sep 5, 2012, 7:11:45 AM9/5/12
to cu...@googlegroups.com
Sorry for that!

koteswara rao

unread,
Jan 5, 2014, 7:15:48 PM1/5/14
to cu...@googlegroups.com
Hi Aslak ,

i was just implementing the Cucumber Jvm and would like to the following things --

1. complete list of tags and how to use  it as now i was using only @ for my reporting purpose to identify the feature what i have tested .

2. with few examples of using tags and hooks .

Thanks 

Roberto Lo Giacco

unread,
Jan 7, 2014, 3:58:43 AM1/7/14
to cu...@googlegroups.com
Il giorno lunedì 6 gennaio 2014 01:15:48 UTC+1, koteswara rao ha scritto:
Hi Aslak ,

i was just implementing the Cucumber Jvm and would like to the following things --

1. complete list of tags and how to use  it as now i was using only @ for my reporting purpose to identify the feature what i have tested .

There is no list of tags, you define the tags yourself! I believe you are getting a little confused with HTML tags or so. In Cucumber a tag is just a label you put in front of scenarios or features to somehow annotate them. For example I'm used to annotate the scenarios with the sprint it has been developed (@sprint-1, @sprint-2, etc...) so I can decide to execute all the scenarios related to a specific sprint. You can use whatever fits your needs, like the name of the developer that implemented the step definition, the color of the keyboard where the scenario has been typed or the scent you smelt while typing the scenario :-D
 
2. with few examples of using tags and hooks .

Tags and hooks are not directly related each other, they represent two very different concepts: tags are there to annotate scenarios and features, hooks are a programming trick to allow certain specific behavior to get executed across multiple scenarios/features. The only correlation between tags and hooks is the fact you can annotate an hook with a tag so you can decide to activate or not an hook.


In general I suggest you read the documentation here https://github.com/cucumber/cucumber/wiki/Tags and here https://github.com/cucumber/cucumber/wiki/Hooks

Roberto
Reply all
Reply to author
Forward
0 new messages