Launching Gwen
Since v1.0.0
Options and usage
All launch operations can be invoked using the Gwen CLI. To list the usage and all available options, invoke Gwen with only the --help
option. The following output will be displayed:
Usage: gwen [options] [files|dirs]
--version Print Gwen version
--help Print CLI usage
--parallel Execute features or scenarios in parallel
- features if gwen.state.level = feature (default)
- scenarios if gwen.state.level = scenario
--repl Open REPL (forcefully) regardless of other options
-p, --profile name Name of profile to launch
-b, --batch Exit when execution completes (ignored if --repl is specified)
-v, --verbose Enable verbose log output
-d, --debug Enable breakpoints and interactive debugging
-n, --dry-run Check all syntax and bindings and report errors
-c, --conf files Settings files: conf, json or properties (comma separated)
-r, --report dir Directory to output generated report(s) to
-f, --formats reports Report formats to include in output (comma separated)
- html,results,junit,json,rp,none (default = html, rp deprecated)
-t, --tags filter Tags to @include or ~@exclude (comma separated)
-i, --input-data file Input data feed (csv or json file)
-m, --meta files|dirs Meta files or directories to load (comma separated)
files|dirs Feature files or directories to execute (space separated)
Command: init [dir]
Initialise project directory
dir Project directory to initialise (default is gwen)
--docker Generate files in project for running Gwen in Docker
--jenkins Generate files in project for running Gwen on Jenkins
--force Regenerate and overwrite previously initialised files
Command: format files|dirs
Format feature and meta files
files|dirs Feature/meta files or dirs to format (space separated)
--pretty Pretty Gherkin format (default)
Environment variables
The following environment variables can be set to override certain settings as below:
Since | Environment variable | Values | Overrides setting | Affects CLI option |
---|---|---|---|---|
v3.23.0 | GWEN_ENV | local|dev| test|staging| prod|.. | gwen.target.env | |
v4.0.0 | GWEN_PROFILE | Name of the profile to launch | -p, --profile | |
v3.16.0 | GWEN_BROWSER | chrome|edge| firefox|safari|ie | gwen.target.browser | |
v3.16.0 | GWEN_DRY_RUN | true|false | gwen.launch.options.dryRun | -n, --dry-run |
v3.16.0 | GWEN_PARALLEL | true|false | gwen.launch.options.parallel | --parallel |
v3.18.0 | GWEN_THREADS | auto|number | gwen.parallel.maxThreads | |
v3.16.0 | GWEN_HEADLESS | true|false | gwen.web.browser.headless | |
v3.18.0 | GWEN_VIDEO | true|false | selenoid:options.enableVideo | |
v3.71.3 | GWEN_WEB_VERSION | Version or Semver range (Overrides Gwen web version in package.json) |
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 CLI:
-Dprop.name=value
- To pass a system property to the Java process that runs Gwen
- Will override any same named Gwen setting
- 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
The enviornment variable overrides in the previous section however do have precedence over these.
Launch Options
Default launch options and arguments can also be configured in settings (excluding --version
and --help
) so you don't have to explictly specify them on the command line.
--version
Optional switch for outputting the Gwen version.
--version
--help
Optional switch for outputting CLI usage.
--help
Usage
- Yarn
- npm
- pnpm
yarn gwen --help
npm run gwen -- --help
pnpm gwen --help
Output
__ ___ _____ _ __ _
/ _` \ \ /\ / / _ \ '_ \ { \,"
| (_| |\ V V / __/ | | | {_`/
\__, | \_/\_/ \___|_| |_| `
|___/
Welcome to gwen-web v4.0.0
gweninterpreter.org
Usage: gwen [init] [options] <args>...
--version Print Gwen version
--help Print CLI usage
--parallel Execute features or scenarios in parallel
- features if gwen.state.level = feature (default)
- scenarios if gwen.state.level = scenario
-b, --batch Exit when execution completes (omit to open REPL)
-v, --verbose Enable verbose log output
-n, --dry-run Check all syntax and bindings and report errors
-p, --profile name Name of profile to launch
-c, --conf files Settings files: conf, json or properties (comma separated)
-r, --report dir Directory to output generated report(s) to
-f, --formats reports Report formats to include in output (comma separated)
- html,junit,json,rp,none (default is html)
-t, --tags filter Tags to @include or ~@exclude (comma separated)
-i, --input-data file Input data feed (csv or json file)
-m, --meta files|dirs Meta files or directories to load (comma separated)
files|dirs Feature files or directories to execute (space separated)
Command: init [dir]
Initialise project directory
dir Project directory to initialise (default is gwen)
--docker Generate files in project for running Gwen in Docker
--jenkins Generate files in project for running Gwen on Jenkins
--force Regenerate and overwrite previously initialised files
Command: format files|dirs
Format feature and meta files
files|dirs Feature/meta files or dirs to format (space separated)
--pretty Pretty Gherkin format (default)
--parallel
Optional switch for executing features or scenarios in parallel (one per CPU core) depending on the configured state level. Omit to execute sequentially.
--parallel
Will utilise all avaialable CPU cores unless gwen.parallel.maxThreads
is configured with an explicit maximum.
Examples
- Features
- Scenarios
Features will run in parallel (one per CPU core) when the parallel launch option is provided and gwen.state.level
is feature
- Yarn
- npm
- pnpm
Specify the parallel launch option to execute all feature files in a given directory in parallel
yarn gwen -b --parallel gwen/features/dir
Specify the parallel launch option to execute the given feature files in parallel
yarn gwen -b --parallel gwen/features/file1.feature gwen/features/file2.feature
Omit parallel launch option to execute all feature files in a given directory in sequence
yarn gwen -b gwen/features/dir
Omit parallel launch option to execute the given feature files in sequence
yarn gwen -b gwen/features/file1.feature gwen/features/file2.feature
Specify the parallel launch option to execute all feature files in a given directory in parallel
npm run gwen -- -b --parallel gwen/features/dir
Specify the parallel launch option to execute the given feature files in parallel
npm run gwen -- --batch --parallel gwen/features/file1.feature gwen/features/file2.feature
Omit parallel launch option to execute all feature files in a given directory in sequence
npm run gwen -- -b gwen/features/dir
Omit parallel launch option to execute the given feature files in sequence
npm run gwen -- -b gwen/features/file1.feature gwen/features/file2.feature
Specify the parallel launch option to execute all feature files in a given directory in parallel
pnpm gwen -b --parallel gwen/features/dir
Specify the parallel launch option to execute the given feature files in parallel
pnpm gwen -b --parallel gwen/features/file1.feature gwen/features/file2.feature
Omit parallel launch option to execute all feature files in a given directory in sequence
pnpm gwen -b gwen/features/dir
Omit parallel launch option to execute the given feature files in sequence
pnpm gwen -b gwen/features/file1.feature gwen/features/file2.feature
Scenarios will run in parallel (one per CPU core) when the parallel launch option is provided and gwen.state.level
is scenario
- Yarn
- npm
- pnpm
Specify the parallel launch option to execute all scenarios in all feature files in a given directory in parallel
yarn gwen -b --parallel gwen/features/dir
Specify the parallel launch option to execute all scenarios in the given feature files in parallel
yarn gwen -b --parallel gwen/features/file1.feature gwen/features/file2.feature
Omit parallel launch option to execute all scenarios in all feature files in a given directory in sequence
yarn -b gwen/features/dir
Omit parallel launch option to execute all scenarios in the given feature files in sequence
yarn -b gwen/features/file1.feature gwen/features/file2.feature
Specify the parallel launch option to execute all scenarios in all feature files in a given directory in parallel
npm run gwen -- -b --parallel gwen/features/dir
Specify the parallel launch option to execute all scenarios in the given feature files in parallel
npm run gwen -- -b --parallel gwen/features/file1.feature gwen/features/file2.feature
Omit parallel launch option to execute all scenarios in all feature files in a given directory in sequence
npm run gwen -- -b gwen/features/dir
Omit parallel launch option to execute all scenarios in the given feature files in sequence
npm run gwen -- -b gwen/features/file1.feature gwen/features/file2.feature
Specify the parallel launch option to execute all scenarios in all feature files in a given directory in parallel
pnpm gwen -b --parallel gwen/features/dir
Specify the parallel launch option to execute all scenarios in the given feature files in parallel
pnpm gwen -b --parallel gwen/features/file1.feature gwen/features/file2.feature
Omit parallel launch option to execute all scenarios in all feature files in a given directory in sequence
pnpm -b gwen/features/dir
Omit parallel launch option to execute all scenarios in the given feature files in sequence
pnpm -b gwen/features/file1.feature gwen/features/file2.feature
--repl
Optional switch to open REPL either even if batch mode is enabled or features are specified.
--repl
Where
Option name is:
--repl
(longhand only supported)
Examples
- Yarn
- npm
- pnpm
Specify the repl launch option to open the REPL
yarn gwen --repl
Specify the repl launch option to bypass feature execution and open the REPL
yarn gwen --repl gwen/features/file.feature
Specify the repl launch option to open REPL even if batch is specified
yarn gwen --repl -b
yarn gwen --repl --batch
Specify the repl launch option to bypass feature execution and open the REPL even if batch is specified
yarn gwen --repl -b gwen/features/file.feature
yarn gwen --repl --batch gwen/features/file.feature
Specify the repl launch option to immediatelly open the REPL
npm run gwen -- --repl
Specify the repl launch option to bypass feature execution and open the REPL
npm run gwen -- --repl gwen/features/file.feature
Specify the repl launch option to open REPL even if batch is specified
npm run gwen -- --repl -b
npm run gwen -- --repl --batch
Specify the repl launch option to bypass feature execution and open the REPL even if batch is specified
npm run gwen -- --repl -b gwen/features/file.feature
npm run gwen -- --repl --batch gwen/features/file.feature
Specify the repl launch option to immediatelly open the REPL
pnpm gwen --repl
Specify the repl launch option to bypass feature execution and open the REPL
pnpm gwen --repl gwen/features/file.feature
Specify the repl launch option to open REPL even if batch is specified
pnpm gwen --repl -b
pnpm gwen --repl --batch
Specify the repl launch option to bypass feature execution and open the REPL even if batch is specified
pnpm gwen --repl -b gwen/features/file.feature
pnpm gwen --repl --batch gwen/features/file.feature
-b|--batch
Optional switch to execute features and then exit immediately (batch mode). Omit to open REPL instead of exiting (interactive mode).
-b|--batch
Where
Option name is either:
-b
for shorthand--batch
for longhand
Examples
- Yarn
- npm
- pnpm
Specify the batch launch option to execute all feature files in a given directory and then exit
yarn gwen -b gwen/features/dir
Specify the batch launch option to execute the given feature file and then exit
yarn gwen --batch gwen/features/file.feature
Omit the batch launch option to execute the given feature file and then open the REPL
yarn gwen gwen/features/file.feature
Omit the batch launch option to open the REPL immediately without executing anything
yarn gwen
Specify the batch launch option to execute all feature files in a given directory and then exit
npm run gwen -- -b gwen/features/dir
Specify the batch launch option to execute the given feature file and then exit
npm run gwen -- --batch gwen/features/file.feature
Omit the batch launch option to execute the given feature file and then open the REPL
npm run gwen -- gwen/features/file.feature
Omit the batch launch option to open the REPL immediately without executing anything
npm run gwen
Specify the batch launch option to execute all feature files in a given directory and then exit
pnpm gwen -b gwen/features/dir
Specify the batch launch option to execute the given feature file and then exit
pnpm gwen --batch gwen/features/file.feature
Omit the batch launch option to execute the given feature file and then open the REPL
pnpm gwen gwen/features/file.feature
Omit the batch launch option to open the REPL immediately without executing anything
pnpm gwen
-p|--profile <name>
Name of profile to launch.
-p|--profile <name>
Where
You can use either:
-p
for shorthand--profile
for longhand
<name>
is the name of a profile with associatedgwen/conf/profiles/<name>.conf
settings to load and launch with.
Examples
To load all settings and execute all features defined in the gwen/conf/profiles/custom.conf
settings and open REPL:
gwen -p custom
To load all settings and execute all features defined in the gwen/conf/profiles/custom.conf
settings and exit when done:
gwen -p custom -b
-v|--verbose
Optional switch for enabling verbose log output.
-v|--verbose
Where
Option name is either:
-v
for shorthand--verbose
for longhand
Usage
- Yarn
- npm
- pnpm
yarn gwen -v
Or
yarn gwen --verbose
npm run gwen -- -v
Or
npm run gwen -- --verbose
pnpm gwen -v
Or
pnpm gwen --verbose
-d|--debug
Optional switch for enabling breakpoints and debugging.
-d|--debug
Where
Option name is either:
-d
for shorthand--debug
for longhand
Usage
- Yarn
- npm
- pnpm
yarn gwen -d
Or
yarn gwen --debug
npm run gwen -- -d
Or
npm run gwen -- --debug
pnpm gwen -d
Or
pnpm gwen --debug
-n|--dry-run
Optional switch to find and report any syntax or binding errors that may exist in your feature and meta files. Use this to validate your feature and meta files before committig to an automation cycle. Omit to execute.
-n|--dry-run
Where
Option name is either:
-n
for shorthand--dry-run
for longhand
Output
- A HTML report highlighting all errors found (if any)
- Errors are also logged to the console
Examples
- Yarn
- npm
- pnpm
Specify the dry run launch option to find and report any errors in all feature and meta files in a given directory
yarn gwen -b -n gwen/features/dir
Specify the dry run launch option to find and report any errors in the given feature file and its associative meta
yarn gwen --batch --dry-run gwen/features/file.feature
Specify the dry run launch option to find and report any errors in all feature and meta files in a given directory
npm run gwen -- -b -n gwen/features/dir
Specify the dry run launch option to find and report any errors in the given feature file and its associative meta
npm run gwen -- --batch --dry-run gwen/features/file.feature
Specify the dry run launch option to find and report any errors in all feature and meta files in a given directory
pnpm gwen -b -n gwen/features/dir
Specify the dry run launch option to find and report any errors in the given feature file and its associative meta
pnpm gwen --batch --dry-run gwen/features/file.feature
-c|--conf <files>
Optional list of settings files to load. These are loaded in the order given with latter entries overriding the former.
-c|--conf <files>
Where
Option name is either:
-c
for shorthand--conf
for longhand
<files>
is a comma separated list of.conf
,.json
, or.properties
settings file paths.
The following settings files are implicity added as defaults:
- Browser settings file if it exists and no other browser settings file is explicitly passed:
gwen.baseDir/conf/browsers/$gwen.target.browser.conf
- Environment settings file if it exists and no other environment settings file is explicitly passed:
gwen.baseDir/conf/env/$gwen.target.env.conf
Examples
- Yarn
- npm
- pnpm
To execute all feature files in a directory on the firefox browser using dev environment settings.
yarn gwen -b -c gwen/conf/browsers/firefox.conf,gwen/conf/env/dev.conf gwen/features/dir
To execute a feature file and load custom properties.
yarn gwen --batch --config gwen/props/custom.properties gwen/features/file.feature
To execute all feature files in a directory on the firefox browser using dev environment settings.
npm run gwen -- -b -c gwen/conf/firefox.conf,gwen/conf/env/dev.conf gwen/features/dir
To execute a feature file and load custom properties.
npm run gwen -- --batch --config gwen/props/custom.properties gwen/features/file.feature
To execute all feature files in a directory on the firefox browser using dev environment settings.
pnpm gwen -b -c gwen/conf/browsers/firefox.conf,gwen/conf/env/dev.conf gwen/features/dir
To execute a feature file and load custom properties.
pnpm gwen --batch --config gwen/props/custom.properties gwen/features/file.feature
-r|--report <dir>
Optional directory to output generated reports to.
-r|--report <dir>
Where
Option name is either:
-r
for shorthand--report
for longhand
<dir>
is the path to the directory where generated reports will be written to.
Since v3.0.0, HTML reports are generated by default and all reports are written to the output directory defined by the gwen.launch.options.report
setting (which you can change if you wish). You therefore only need to specify this report option if you want to override this default on the CLI for a particular launch. If additionally, you don't want any reports to be generated by default, you can set the gwen.launch.options.format
setting to none
.
Examples
- Yarn
- npm
- pnpm
To execute a feature file and output a HTML report to the default output directory
yarn gwen -b gwen/features/file1.feature
To execute all feature files in a directory and output HTML reports to nominated directory
yarn gwen -b --report nominated/outdir gwen/features/dir
To execute a feature file and output a HTML report to the default output directory
npm run gwen -- -b gwen/features/file1.feature
To execute all feature files in a directory and output HTML reports to nominated directory
npm run gwen -- -b --report nominated/outdir gwen/features/dir
To execute a feature file and output a HTML report to the default output directory
pnpm gwen -b gwen/features/file1.feature
To execute all feature files in a directory and output HTML reports to nominated directory
pnpm gwen -b --report nominated/outdir gwen/features/dir
-f|--format <reports>
Optional list of report formats to output.
-f|--format <reports>
Where
Option name is either:
-f
for shorthand--format
for longhand
<reports>
is a comma separated list of one or more of the following:html
for HTML reportsjunit
for JUnit-XML reportsjson
for JSON reportsresults
for CSV results (since v3.77.0)none
for no reports
Since Since v3.0.0, HTML reports are generated by default and all reports are written to the output directory defined by the gwen.launch.options.report
setting (which you can change if you wish). You therefore no longer need to explictly specify the -r|--report
option with this option unless you want to override the default on the CLI for a particular launch.
Examples
- Yarn
- npm
- pnpm
To
yarn gwen -b gwen/features/dir
To
yarn gwen --batch gwen/features/file.feature
To
npm run gwen -- -b gwen/features/dir
To
npm run gwen -- --batch gwen/features/file.feature
To
pnpm gwen -b gwen/features/dir
To
pnpm gwen --batch gwen/features/file.feature
-i|--input-data <file>
Optional CSV of JSON data feed file.
-i|--input-data <file>
Where
Option name is either:
-i
for shorthand--input-data
for longhand
<file>
is a path to a CSV or JSON data file
See data feeds for more details.
Examples
- Yarn
- npm
- pnpm
To execute all feature files in a directory for every record in a CSV file
yarn gwen -b -i gwen/data/records.csv gwen/features/dir
To execute a feature file for every record in a CSV file
yarn gwen -b --input-data gwen/data/records.csv gwen/features/file.feature
To execute all feature files in a directory for every record in a JSON file (Since v3.47.0)
yarn gwen -b -i gwen/data/records.json gwen/features/dir
To execute a feature file for every record in a JSON file (Since v3.47.0)
yarn gwen -b --input-data gwen/data/records.json gwen/features/file.feature
To execute all feature files in a directory for every record in a CSV file
npm run gwen -- -b -i gwen/data/records.csv gwen/features/dir
To execute a feature file for every record in a CSV file
npm run gwen -- -b --input-data gwen/data/records.csv gwen/features/file.feature
To execute all feature files in a directory for every record in a JSON file (Since v3.47.0)
npm run gwen -- -b -i gwen/data/records.json gwen/features/dir
To execute a feature file for every record in a JSON file (Since v3.47.0)
npm run gwen -- -b --input-data gwen/data/records.json gwen/features/file.feature
To execute all feature files in a directory for every record in a CSV file
pnpm gwen -b -i gwen/data/records.csv gwen/features/dir
To execute a feature file for every record in a CSV file
pnpm gwen -b --input-data gwen/data/records.csv gwen/features/file.feature
To execute all feature files in a directory for every record in a JSON file (Since v3.47.0)
pnpm gwen -b -i gwen/data/records.json gwen/features/dir
To execute a feature file for every record in a JSON file (Since v3.47.0)
pnpm gwen -b --input-data gwen/data/records.json gwen/features/file.feature
-m|--meta <files|dirs>
Optional list of meta files or directories to load.
-m|--meta <files|dirs>
Where
Option name is either:
-m
for shorthand--meta
for longhand
<files|dirs>
is a comma separated list of meta file paths or directories (containing meta files) to load
Examples
- Yarn
- npm
- pnpm
To load all meta files in a directory before executing each feature file in a given directory
yarn gwen -b -m gwen/meta/dir gwen/features/dir
To load a specific meta file before executing a feature file
yarn gwen -b -m gwen/meta/file.meta gwen/features/file.feature
To load all meta files in a directory before executing each feature file in a given directory
npm run gwen -- -b -m gwen/meta/dir gwen/features/dir
To load a specific meta file before executing a feature file
npm run gwen -- -b -m gwen/meta/file.meta gwen/features/file.feature
To load all meta files in a directory before executing each feature file in a given directory
pnpm gwen -b -m gwen/meta/dir gwen/features/dir
To load a specific meta file before executing a feature file
pnpm gwen -b -m gwen/meta/file.meta gwen/features/file.feature
Launch Arguments
[files|dirs]
Optional list of feature files or directories to execute (optional).
[files|dirs]
Where
<files|dirs>
is a space separated list of feature files or directories (containing feature files) to execute
Examples
- Yarn
- npm
- pnpm
To execute all features in two given directories
yarn gwen -b gwen/features/dir1 gwen/features/dir2
To execute two feature files
yarn gwen --batch gwen/features/file1.feature gwen/features/file2.feature
To execute all features in two given directories and another feature file
yarn gwen --batch gwen/features/dir1 gwen/features/dir2 gwen/features/file.feature
To execute all features in two given directories
npm run gwen -- -b gwen/features/dir1 gwen/features/dir2
To execute two feature files
npm run gwen -- --batch gwen/features/file1.feature gwen/features/file2.feature
To execute all features in two given directories and another feature file
npm run gwen -- --batch gwen/features/dir1 gwen/features/dir2 gwen/features/file.feature
To execute all features in two given directories
pnpm gwen -b gwen/features/dir1 gwen/features/dir2
To execute two feature files
pnpm gwen --batch gwen/features/file1.feature gwen/features/file2.feature
To execute all features in two given directories and another feature file
pnpm gwen --batch gwen/features/dir1 gwen/features/dir2 gwen/features/file.feature
Project Init
init [options] [dir]
Command for initialising Gwen in a project directory.
init [options] [dir]
Where
[options]
Can be one or more space separated switches including:[dir]
is- Defaults to a
gwen
subdirectory in your project if not specified
- Defaults to a
Run this command in your project directory to initialise Gwen in it. You can then start using Gwen in your project.
Example
- Yarn
- npm
- pnpm
To initialse a Gwen project
yarn gwen init
To initialse a Gwen project
npm run gwen init
To initialse a Gwen project
pnpm gwen init
The init
command will generate the following Gwen files and subdirectories in your project
./ # Project root
├── .gitignore # Git ignore file
├── README.md
├── gwen.conf # Common settings
└── /gwen
├── .gitignore # Git ignore file
├── /conf
│ ├── /browsers # Browser settings
│ │ ├── chrome.conf
│ │ ├── edge.conf
│ │ ├── firefox.conf
│ │ ├── README.md
│ │ └── safari.conf
│ ├── /env # Environment settings
│ │ ├── dev.conf
│ │ ├── local.conf
│ │ ├── prod.conf
│ │ ├── README.md
│ │ ├── staging.conf
│ │ └── test.conf
│ └── /profiles # Profile settings
│ ├── README.md
│ └── samples.conf
├── /features # Features and associative meta
│ ├── README.md
│ └── /samples # Samples
└── /meta # Common/reusable meta
└── README.md
Project Init options
init --docker [--force] [dir]
Generate all the files in your project required for running Gwen in Docker.
init --docker [--force] [dir]
Where
--force
- Include to regenerate and overwrite any previously generated docker files.
[dir]
is the directory to generate the docker files into- Defaults to the
gwen
subdirectory in your project if not specifed
- Defaults to the
- Yarn
- npm
- pnpm
yarn gwen init --docker
npm run gwen init --docker
pnpm gwen init --docker
The init
command will generate the following files
./ # Project root
└── /gwen
├── .env # Docker env file
├── docker-compose.yml # Docker compose file
├── Dockerfile # Docker image file
└── /browsers # Browser settings
├── browsers.json # Selenoid browsers file
└── selenoid.conf # Selenoid settings
init --jenkins [--force] [dir]
Generate a Jenkins pipeline file for your project (Jenkinfile).
init --jenkins [--force] [dir]
Where
--force
- Include to regenerate and overwrite any previously generated Jenkinsfile.
[dir]
is the directory to generate the Jenkinfile into- Defaults to the
gwen
subdirectory in your project if not specifed
- Defaults to the
- Yarn
- npm
- pnpm
yarn gwen init --jenkins
npm run gwen init --jenkins
pnpm gwen init --jenkins
The init
command will generate the following files
./ # Project root
└── /gwen
└── Jenkinsfile # Jenkins pipeline file
Pretty formatting
format --pretty <files|dirs>
Command for formatting feature and meta files for consistent and tidy Gherkin. Pretty formatting involves indenting all Gherkin nodes in a standard manner and removing uncecessary whitespace. Formatted files will be updated in place.
format --pretty <files|dirs>
Where
--pretty
- Is the pretty formatting option (default)
- This is currently the default and only supported formatting option
<files|dirs>
(mandatory) is a space separated list of feature/meta files or directories to format
This command will remove any comment lines you may have in your files. You should restore them manually after running the command if you don't want to lose them.
Example
- Yarn
- npm
- pnpm
To format all feature and meta files in the current directory
yarn gwen format --pretty .
To format all feature and meta files in a given directory
yarn gwen format --pretty path/to/dir
To format a single feature file
yarn gwen format --pretty path/to/file.feature
To format a single feature file
yarn gwen format --pretty path/to/file.feature
To format a single meta file
yarn gwen format --pretty path/to/file.meta
To format all feature and meta files in the current directory
npm run gwen -- format --pretty .
To format all feature and meta files in a given directory
npm run gwen -- format --pretty path/to/dir
To format a single feature file
npm run gwen -- format --pretty path/to/file.feature
To format a single meta file
npm run gwen -- format --pretty path/to/file.meta
To format all feature and meta files in the current directory
pnpm gwen format --pretty .
To format all feature and meta files in a given directory
pnpm gwen format --pretty path/to/dir
To format a single feature file
pnpm gwen format --pretty path/to/file.feature
To format a single meta file
pnpm gwen format --pretty path/to/file.meta