Skip to main content

Profiles

Since v4.0.0

You can configure one or many launch profiles, each with its own options and settings. This enables you to configure unique launch configurations for each process in your project so you don't have to manage them externally. You simply give each profile a name and define its configuration in a same named settings file in the gwen/conf/profiles folder of your project. Then when you're ready to launch, you specify the name of the profile you want to run with the -p|--profile option.

Profile Settings

Example

Say you have two processes in your project that need to be launched differently, and you want:

  • process1 to:

    • Call the gwen/features/process1.feature only
    • Pass in the gwen/input/data-feed.csv data feed file
  • process2 to:

    • Call the gwen/features/process2.feature only
    • Not pass in any data feed

The first step in configuring these is to create the process1.conf and process2.conf files in the gwen/conf/profiles folder as shown:

The names of the settings files (minus their extensions) will serve as the names of the profiles

  ./                              # Project root
├── gwen.conf # Common settings
└── /gwen
├── /conf
│ ├── /browsers # Browser settings
| └── ..
│ ├──/env # Environment settings
| └── ..
│ └──/profiles # Launch profile settings
│ ├── process1.conf
│ └── process2.conf
├── /features # Features (and associative meta)
│ ├── process1.feature
│ ├── process1.meta
│ ├── process2.feature
│ └── process2.meta
├── /input # Input data
│ └── data-feed.csv
└── /meta # Meta
..

process1.conf

  • Call the gwen/features/process1.feature only
  • Pass in the gwen/input/data-feed.csv data feed file

File: gwen/conf/profiles/process1.conf

gwen {
launch {
options {
features = [
"${gwen.baseDir}/features/process1.feature"
]
inputData = "${gwen.baseDir}/input/data-feed.csv"
}
}
}

process2.conf

  • Call the gwen/features/process2.feature only
  • Don't pass in any data feed

File: gwen/conf/profiles/process2.conf

gwen {
launch {
options {
features = [
"${gwen.baseDir}/features/process2.feature"
]
inputData = ""
}
}
}

Launching Profiles

To launch a profile, simply pass the profile settings file name (minus the path and extension) to the -p|--profile launcher option. Gwen will find and load the same named settings file in the gwen/conf/profiles directory and launch that profile for you.

Launch process 1 and open repl when done

yarn gwen -p process1

Launch process 1 and exit when done

yarn gwen -p process1 -b

Launch process 1 in parallel mode

yarn gwen -p process1 --parallel

Launch process 2 in dry run mode

yarn gwen --profile process2 --dry-run