hermione-retry-progressive

0.0.3 • Public • Published

hermione-retry-progressive Build Status

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; default true.
  • extraRetry (optional) Number – how many times a test should be retried if it fails with error matched by errorPatterns. Global value for all browsers; default 5.
  • errorPatterns (optional) - Array - error message patterns for adding retries. Array element must be Object ({'name': String, 'pattern': String}) or String (interpret as name and pattern). 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:

module.exports = {
    // ...
    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

Install

npm i hermione-retry-progressive

DownloadsWeekly Downloads

2

Version

0.0.3

License

MIT

Unpacked Size

10.6 kB

Total Files

9

Last publish

Collaborators

  • catwithapple