protractor-fail-fast

Source code for protractor-fail-fast

Showing:

Popularity

Downloads/wk

14.2K

GitHub Stars

16

Maintenance

Last Commit

4yrs ago

Contributors

3

Package

Dependencies

1

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

protractor-fail-fast

Allow Protractor tests to "fail-fast", exiting on the first failure instead of running all tests no matter what. This can save a great deal of time as Protractor tests are typically slow and expensive.

This Protractor plugin is effectively a wrapper around jasmine-fail-fast.

Install

yarn

yarn add protractor-fail-fast

npm

npm install protractor-fail-fast

Fail file

Since test runners run in independent processes, we use a "fail file", .protractor-fail-fast, to communicate between them (better ideas welcome). The "fail file" is created when the plugin is initialized and the test runners then continuously check for the presence of it. If/when a test runner fails, it will delete the "fail file", signaling to the other test runners to stop the test run.

It is recommended that .protractor-fail-fast is added to .gitignore since this file may be left behind if all test runners finish successfully. It can removed in the afterLaunch (see below), but could still be left behind if Protractor is shut down prior to executing the hook (crash/forced exit).

Usage

Inside the Protractor config file:

import failFast from 'protractor-fail-fast';

exports.config = {
  plugins: [
    failFast.init(),
  ],
  
  // Optional
  afterLaunch: function() {
    failFast.clean(); // Removes the fail file once all test runners have completed.
  },
}

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial