[cucumber-jvm] Run annotated method (with hooks) when one tag OR the other OR both are present?

191 views
Skip to first unread message

Christian

unread,
May 30, 2014, 6:32:39 AM5/30/14
to cu...@googlegroups.com
Hi!

Is there a way to use the @Before(value = {"@a", "@b"}) annotation so that the annotated method kicks off if either one or both of the tags are present? 
I believe the method treats tag lists as AND (i.e. a scenario must have both tags for it to run) instead of OR (i.e. a scenario can have either one or both tags for the hook to be used)?

Kind regards,

Christian

Björn Rasmusson

unread,
May 30, 2014, 7:58:55 AM5/30/14
to cu...@googlegroups.com
Christian:
Hi!

Is there a way to use the @Before(value = {"@a", "@b"}) annotation so that the annotated method kicks off if either one or both of the tags are present? 
I believe the method treats tag lists as AND (i.e. a scenario must have both tags for it to run) instead of OR (i.e. a scenario can have either one or both tags for the hook to be used)?

Hi,

@Before(value = {"@a", "@b"}) -> AND

@Before(value = {"@a,@b"})
-> OR

The tagged hooks section of the hooks page on the Cucumber(-Ruby) wiki should be valid also for Cucumber-JVM, with the obvious syntax adaptations (except or course, that Around and AfterStep hooks does not exist in Cucumber-JVM.

Best Regards
Björn
 
Kind regards,

Christian

Christian

unread,
May 30, 2014, 9:14:21 AM5/30/14
to cu...@googlegroups.com
Hi Björn,

Awesome, thank you! :)

Brgrds,

Christian
Reply all
Reply to author
Forward
0 new messages