At first, testring have similar API for config file and arguments in command line,
so this guide will have examples for both CLI and config file.
Framework have 3 levels of configuration, sorted by priority:
CLI arguments -> environment file -> config file
Config file have lowest priority, it's fields will be overrided by environment config, if it's exists, CLI arguments overrides everything.
- config
- envConfig
- tests
- logLevel
- bail
- workerLimit
- retryCount
- retryDelay
- testTimeout
- screenshots
- envParameters
- restartWorker
- plugins
Path to config file, relative to project root, works only as CLI argument. Config can be json or javascript file.
Javascript file should return:
- Config object;
- Function with config object;
- Function with
Promise
, that returns config object (for async initialization).
$ testring run --config ./my-custom-config.json
Path to environment config, relative to project root, works only as CLI argument.
All resolving logic is similar to --config
.
envConfig
extends and overrides original config, useful for decomposing config into smaller parts.
Glob pattern, relative to project root. All founded file will be added to run queue.
$ testring run --tests ./src/**/test/*.spec.js
{
"tests": "./src/**/test/*.spec.js"
}
Filtering logs rule.
Available levels:
verbose
debug
info
warning
error
silent
$ testring run --log-level silent
{
"logLevel": "silent"
}
Alias for --logLevel silent
.
$ testring run --silent
{
"silent": true
}
Fail out on the first error instead of tolerating it.
$ testring run --bail
{
"bail": true
}
Limit of parallel running tests. Increase this number carefully,
because a lot of workers won't be so efficient,
also your driver plugin may not be able to handle so much connections.
Can be passed as local
value to run test in same process with runner.
$ testring run --worker-limit 20
{
"workerLimit": 20
}
Reruns count, if test failed. Useful, if your test is not stable.
$ testring run --retry-count 5
{
"retryCount": 5
}
Value in milliseconds, adds time gap between reruns of test.
$ testring run --retry-delay 10000
{
"retryDelay": 10000
}
Value in milliseconds, maximum time for test execution.
$ testring run --test-timeout 10000
{
"testTimeout": 10000
}
String value for screenshots making policy
Available values:
disable
- turn off screenshotsenable
- turn on screenshotsafterError
- turn on screenshots only on retry runs
$ testring run --screenshots enable
{
"screenshots": "enable"
}
String value for workers restart strategy. If passed always - it will be killed after it ends
Available values:
always
- always restart worker after test execution finishednever
- disable restart
$ testring run --restartWorker always
{
"restartWorker": "never"
}
Special object, that passed right into test.
You can get it inside test with api.getEnvironment()
call.
{
"envParameters": {
"custom": [ "test", "data" ]
}
}
Delay between http requests in milliseconds. Useful if you don't want spam your test environment.
$ testring run --http-throttle 500
{
"httpThrottle": 500
}
Plugins are powerful instrument for extending framework functional. More about plugins you can read here.
$ testring run --plugins my-plugin-1 --plugins my-plugin-2
{
"plugins": [
"my-plugin-1",
["my-plugin-2", {
"userConfig": true
}]
]
}