Skip to main content

Gwen Settings

Settings Files

All Gwen settings and properties are maintained in files in your project.

Formats

The following settings file formats are supported:

  • HOCON (Human-Optimized Config Object Notation), since v3.0.0
    • The recommended and default format
    • A superset of JSON
    • Maintained in .conf files
  • JSON, since v3.0.0
    • Pure JSON format
    • Maintained in .json files
  • Properties, since v1.0.0
    • Legacy Java properties style format
    • Flat name = value pairs
    • Maintained in .properties files

Ideally you should use one format for all your settings files, but using combinations of the above is also permitted. Priority will be given in the order shown to same named files in a directory having different formats:

  1. .conf
  2. .json
  3. .properties

Load order and precedence

Settings are loaded in the following order of precedence, with those higher in the list overriding the lower.

  1. System properties
    • Passed to the Gwen CLI as -Dname=value pairs
  2. User settings
    • A gwen.conf, gwen.json, or gwen.properties file in your user directory
  3. Launch settings
    • Comma separated list of *.conf, *.json, or *.properies files passed to the Gwen CLI via the -c|--conf launch option (or -p|--properties for Gwen versions prior to v3.0.0). These are loaded in the order given with latter entries overriding the former.
  4. Project settings
    • A gwen.conf, gwen.json or gwen.properties file in your root project directory
  5. Default settings
    • Internal Gwen defaults

Maintaining settings

System properties override all other settings

-Dname=value pairs passed to the Gwen CLI as system properties have topmost precedence and will always override ALL other settings.

You can maintain settings and override internal defaults at various levels as described here.

User settings

User-level settings can optionally be defined in a gwen.conf|json|properties file in the root of your user directory on a machine. These are useful when you want to override certain settings on a machine for a user.

 /Users
โ””โ”€โ”€ /<username> (~/)
โ””โ”€โ”€ gwen.conf # User-level overrides

Launch settings

You can maintain any settings and properties (except CLI options) in your own files and explicitly pass them to Gwen at launch time using the -c|conf CLI option. For convenience, you would typically store these somewhere within your project where your features directory lives however you are free to store them in any location you wish.

Project settings

When you set up and initialise your project, all project level settings are stored in a gwen.conf|json|properties file in the root of the project. Gwen automatically discovers and loads this file for you, so you don't need to explictly pass it to Gwen when you launch in the project directory.

 /project                    # Your project root
โ””โ”€โ”€ gwen.conf # Project settings