maven with cuke4duke: optionally defining cucumber tags on cmd line -



maven with cuke4duke: optionally defining cucumber tags on cmd line -

as test developer using cuke4duke maven2, want able optionally select tests tags on cmd line. seems since maven doesn't have conditionals, 'optionally' part requires hack.

the cucumber arg might e.g. "--tags @firsttag". 1 way implement have in pom.xml

<cucumberargs> ... <cucumberarg>${tagargs}</cucumberarg> </cucumberargs>

then cmd line has

mvn integration-test -dtagargs="--tags @firsttag"

this works fine when want define tags, when don't include -d argument (i.e. not selecting tags), get

[info] no such file or directory - null (errno::enoent)

a workaround define ${tagargs} in properties duplicate of cucumber arg use:

<properties> <tagargs>--strict</tagargs> </properties>

so, worst case "--strict --strict". such hack best maven capable of?

i've managed work around problem using ignored negative tag. note i'm using cuke4duke 0.4.4.

define default value property runs scenarios not tagged "ignore" (call whatever like).

<properties> <tagargs>--tags=~@ignore</tagargs> </properties>

maven utilize property when not pass in specific value on command line. hence of scenarios match , execute.

maven

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -