Plugin for hermione to adding extra retries at runtime if error message (from failed test) matched by patterns (from config).
You can read more about hermione plugins here.
Installation
$ npm install hermione-retry-progressive
Usage
Plugin has following configuration:
- enabled (optional)
Boolean
– enable/disable the plugin; defaulttrue
. - extraRetry (optional)
Number
– how many times a test should be retried if it fails with error matched by errorPatterns. Global value for all browsers; default5
. - errorPatterns (optional) -
Array
- error message patterns for adding retries. Array element must beObject
({'name':String
, 'pattern':String
}) orString
(interpret asname
andpattern
).name
is needed for pretty console output.pattern
must be valid for RegExp constructor.
Also there is ability to override plugin parameters by CLI options or environment variables
(see configparser).
Use hermione_retry_progressive
prefix for the environment variables and --retry-progressive-
for the cli options.
For example you can override extraRetry
option like so:
$ hermione_retry_progressive_extra_retry=3 hermione$ hermione --retry-progressive-extra-retry 3
Add plugin to your hermione
config file:
moduleexports = // ... plugins: 'hermione-retry-progressive': enabled: true extraRetry: 7 errorPatterns: 'Parameter .* must be a string' name: 'Cannot read property of undefined' pattern: 'Cannot read property .* of undefined' // ...;
Testing
Run mocha tests:
npm run test-unit
Run eslint codestyle verification
npm run lint