Skip to main content

Launcher CLI

tip

You will need to set up Gwen first to have to access the CLI.

Launch options and usage#

All launch operations can be invoked using the Launcher CLI. To list the usage and all available options, invoke the CLI with the --help switch:

Run the following command in a terminal window in any directory:

gwen --help

The following output will be displayed describing the usage and options:

Usage: gwen [options] [files/dirs]
  --version               Print Gwen version  --help                  Print CLI usage  --parallel              Execute features or scenarios in parallel                          - depending on gwen.state.level (default is features)  --parallel-features     Execute features in parallel (unconditionally)  -b, --batch             Exit when execution completes (omit to open REPL)  -n, --dry-run           Check all syntax and bindings and report errors  -p, --properties files  Properties/settings files to load (comma separated)  -r, --report dir        Directory to output generated report(s) to  -f, --formats include   Report formats to include in output (comma separated)                          - html,junit,json,rp (default is html)  -t, --tags filter       Tags to @include or ~@exclude (comma separated)  -i, --input-data file   Input data feed (CSV file with column headers)  -m, --meta files/dirs   Meta files or directories (comma separated)  files/dirs              Feature files or directories (space separated)

Usage examples#

CLI examples

Execute a singe feature file:

gwen -b path/to/file.feature

Recursively execute all feature files in a directory:

gwen -b path/to/directory

Recursively execute all feature files in a directory in parallel:

gwen -b --parallel path/to/directory

Recursively execute all feature files in a directory passing in a properties file

gwen -b -p path/to/file.properties path/to/directory

Check syntax and bindings for all feature and meta files in a directory and report errors

gwen -b -n -r output/reports path/to/directory
  • To generate HTML reports, add -r output/reports to the command
  • To generate HTML and JUnit-XML reports also, add -r output/reports -f html,junit to the command
  • Omitting the -b switch will open the REPL Console when execution completes

System properties and JVM options#

In addition to the above, you can also pass any number of Java system properties or JVM options to the Launcher CLI:

  • -Dprop.name=value
    • To pass a system property to the Java process that runs Gwen
    • Will override any same named Gwen settings
    • Will be picked up by ${prop.name} placeholders in feature and meta specs
  • -J<JVM_OPTION>
    • To pass a JVM option to the Java process that runs Gwen
    • The -J prefix will be stripped and <JVM_OPTION> will be passed through