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:
process1to:- Call the
gwen/features/process1.featureonly - Pass in the
gwen/input/data-feed.csvdata feed file
- Call the
- Call the
gwen/features/process2.featureonly - Not pass in any data feed
process2 to:
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.featureonly - Pass in the
gwen/input/data-feed.csvdata 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.featureonly - 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
Launching a single profile
To launch a single 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.
- Yarn
- npm
- pnpm
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 irunning input records in parallel
yarn gwen -p process1 --parallel
Launch process 2 in dry run mode
yarn gwen --profile process2 --dry-run
Launch process 1 and open repl when done
npm run gwen -- --profile process1
Launch process 1 and exit when done
npm run gwen -- --profile process1 -b
Launch process 1 irunning input records in parallel
npm run gwen -- --profile process1 --parallel
Launch process 2 in dry run mode
npm run gwen -- --profile process2 --dry-run
Launch process 1 and open repl when done
pnpm gwen -p process1
Launch process 1 and exit when done
pnpm gwen -p process1 -b
Launch process 1 irunning input records in parallel
pnpm gwen -p process1 --parallel
Launch process 2 in dry run mode
pnpm gwen --profile process2 --dry-run
Launching mutiple profiles
Since v4.21.0
To launch multiple profiles one after the other, simply pass the names of the profile settings files (minus the path and extension) separated by a comma to the -p|--profile launcher option. Gwen will find and load each same named settings file in the gwen/conf/profiles directory and launch the profiles for each in the order given.
- Yarn
- npm
- pnpm
Launch process 1 followed by process 2 and open repl when done
yarn gwen -p process1,process2
Launch process 1 followed by process 2 and exit when done
yarn gwen -p process1,process2 -b
Launch process 1 followed by process 2, running input records in parallel for each
yarn gwen -p process1,process2 --parallel
Launch process 1 followed by process 2 in dry run mode
yarn gwen --profile process1,process2 --dry-run
Launch process 1 followed by process 2 and open repl when done
npm run gwen -- --profile process1,process2
Launch process 1 followed by process 2 and exit when done
npm run gwen -- --profile process1,process2 -b
Launch process 1 followed by process 2, running input records in parallel for each
npm run gwen -- --profile process1,process2 --parallel
Launch process 1 followed by process 2 in dry run mode
npm run gwen -- --profile process1,process2 --dry-run
Launch process 1 followed by process 2 and open repl when done
pnpm gwen -p process1,process2
Launch process 1 followed by process 2 and exit when done
pnpm gwen -p process1,process2 -b
Launch process 1 followed by process 2, running input records in parallel for each
pnpm gwen -p process1,process2 --parallel
Launch process 1 followed by process 2 in dry run mode
pnpm gwen --profile process1,process2 --dry-run