hermione-passive-browsers

0.3.2 • Public • Published

hermione-passive-browsers Build Status

Plugin for hermione to run tests in passive browsers on request. Passive browsers are browsers in which tests do not run by default.

You can read more about hermione plugins here.

Installation

npm install hermione-passive-browsers

Usage

Configuration

Plugin has following configuration:

  • enabled (optional) Boolean – enable/disable the plugin; by default plugin is enabled
  • browsers (optional) String|RegExp|Array<String|RegExp> - browsers in which tests should not run by default
  • commandName (required) String - command name which will be added to hermione context and used in tests before test or suite declaration for enable test in passed browser

Also there is ability to override plugin parameters by CLI options or environment variables (see configparser). Use hermione_passive_browsers_ prefix for the environment variables and --hermione-passive-browsers- for the cli options.

Hermione usage

Add plugin to your hermione config file:

module.exports = {
    // ...
    system: {
        plugins: {
            'hermione-passive-browsers': {
                enabled: true,
                browsers: /ie/,
                commandName: 'enable'
            }
        }
    },
    //...
}

Example:

hermione.enable.in('ie6');
describe('suite', () => {
    it('test1', function() {...});

    hermione.enable.in(['ie7', /ie[89]/]);
    it('test2', function() {...});

    hermione.enable.in(/ie1[01]/);
    it('test3', function() {...});
})

As a result:

  • test test1 will be run in ie6 browser
  • test test2 will be run in ie6, ie7, ie8 and ie9 browsers
  • test test3 will be run in ie6, ie10 and ie11 browsers

Testing

Run mocha tests:

npm run test-unit

Run eslint codestyle verification

npm run lint

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.3.20latest

Version History

VersionDownloads (Last 7 Days)Published
0.3.20
0.3.10
0.3.00
0.2.00
0.1.10
0.1.00
0.0.10

Package Sidebar

Install

npm i hermione-passive-browsers

Weekly Downloads

0

Version

0.3.2

License

MIT

Unpacked Size

9.64 kB

Total Files

7

Last publish

Collaborators

  • j0tunn
  • dudagod
  • xrsd
  • kuznetsovroman