Discussion:
[Cucumber] [cucumber-jvm] Run all tests via maven/command line when Cucumber.Options is set?
Christian
2014-05-29 13:56:25 UTC
Permalink
Hi,

Given someone has added the following:

@Cucumber.Options(
format = {"pretty", "html:target/cucumber", "json:target/cucumber.json"},
tags = "@myTag",
features = "src/test/resources/features" )

Is there a way to make sure all scenarios are executed when running maven
via a command line, e.g. on a continuous integration platform, like the
following:

mvn clean test -Dcucumber.options="src/test/resources/features --tags @myTest"

Put differently, is there a command line option to force cucumber to
"execute all features", e.g. using something like

mvn clean test -Dcucumber.options="src/test/resources/features --tags "

And am I correct in assuming

--tags ~@doNotRunMe

will execute all tags except the one mentioned?

If so, would

--tags ~@nonexistantTag

achieve what I'm after?

Thanks,

Christian

P.S.: I'm cross-posting this from stackoverflow; for some reason I posted
it there before being told to come here...
http://stackoverflow.com/questions/23934915/make-cucumber-jvm-run-all-tests-on-continuous-integration-platform-when-kicked-o
--
Posting rules: http://cukes.info/posting-rules.html
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Björn Rasmusson
2014-05-30 09:42:41 UTC
Permalink
Post by Christian
Hi,
@Cucumber.Options(
format = {"pretty", "html:target/cucumber", "json:target/cucumber.json"},
features = "src/test/resources/features" )
Is there a way to make sure all scenarios are executed when running maven
via a command line, e.g. on a continuous integration platform, like the
Put differently, is there a command line option to force cucumber to
"execute all features", e.g. using something like
mvn clean test -Dcucumber.options="src/test/resources/features --tags "
And am I correct in assuming
will execute all tags except the one mentioned?
If so, would
achieve what I'm after?
Yes,

mvn clean test -Dcucumber.options="--tags ~@nonexistantTag"

should execute all scenarios (even though @CucumberOptions specified tags =
"@myTag")
See also the README.md
<https://github.com/cucumber/cucumber-java-skeleton#overriding-options> of
the cucumber-java-skeleton project for more examples.

Best Regard
Björn
Post by Christian
Thanks,
Christian
P.S.: I'm cross-posting this from stackoverflow; for some reason I posted
it there before being told to come here...
http://stackoverflow.com/questions/23934915/make-cucumber-jvm-run-all-tests-on-continuous-integration-platform-when-kicked-o
--
Posting rules: http://cukes.info/posting-rules.html
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Christian
2014-05-30 10:21:23 UTC
Permalink
Post by Christian
Put differently, is there a command line option to force cucumber to
Post by Christian
"execute all features", e.g. using something like
mvn clean test -Dcucumber.options="src/test/resources/features --tags "
...
If so, would
achieve what I'm after?
Yes,
See also the README.md
<https://github.com/cucumber/cucumber-java-skeleton#overriding-options>
of the cucumber-java-skeleton project for more examples.
Thank you!

Just had the help printed out and thought I'd copy it in here, in case
someone else wants to have a look:
Usage: java cucumber.api.cli.Main [options] [ [FILE|DIR][:LINE[:LINE]*] ]+

Options:

-g, --glue PATH Where glue code (step
definitions and hooks) is loaded from.
-f, --format FORMAT[:PATH_OR_URL] How to format results. Goes to
STDOUT unless PATH_OR_URL is specified.
Built-in FORMAT types: junit,
html, pretty, progress, json.
FORMAT can also be a fully
qualified class name.
-t, --tags TAG_EXPRESSION Only run scenarios tagged with
tags matching TAG_EXPRESSION.
-n, --name REGEXP Only run scenarios whose names
match REGEXP.
-d, --[no-]-dry-run Skip execution of glue code.
-m, --[no-]-monochrome Don't colour terminal output.
-s, --[no-]-strict Treat undefined and pending
steps as errors.
--snippets [underscore|camelcase] Naming convention for generated
snippets. Defaults to underscore.
--dotcucumber PATH_OR_URL Where to write out runtime
information. PATH_OR_URL can be a file system
path or a URL.
-v, --version Print version.
-h, --help You're looking at it.

Looking at that, I wonder if there is a page that explains what a
valid TAG_EXPRESSION looks like?
I'll set up another email thread to ask that in a separate chain... :)

Brgrds,

Ch
--
Posting rules: http://cukes.info/posting-rules.html
---
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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Loading...