New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

protractor-retry

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protractor-retry

module for protractor to automatically re-run failed tests with specific number of attempts

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.2K
decreased by-0.04%
Maintainers
1
Weekly downloads
 
Created
Source

Protractor-retry

  • A solution to address the flakyness of your Protractor FE automation test suites.
  • This module used protractor features to automatically re-run failed tests with a specific configurable number of attempts.
  • This module is added in our CICD pipelines where we have a zero failure policy in order to bless an environment.



This module fully relies on protractor available callbacks and internal functionalities.

It is from within protractor itself and not relying on any external dependency. All the changes that you need to add in order to integrate this module is located only in one file, the protractor configuration file. *You don’t need to update a single line of the spec.js files.

The module will create an XML file which contains the failed spec(s) filename(s). and will re-run only them, till either we don't have anymore failures or we reached the retry attempt maximum.



Steps to Integrate

Install
npm i -g  protractor-retry
Step 1: Require the Package ( Your Protractor Config )
var retry = require('protractor-retry').retry;
Step 2: onPrepare ( Your Protractor Config )
beforeOnPrepare: function() { 
  retry.onPrepare(); 
}
Step 3: onCleanUp ( Your Protractor Config )
onCleanUp = function(results) {
    retry.onCleanUp(results);
};

It is Mandatory to provide the results to the retry.onCleanUp function

Step 4: afterLaunch ( Your Protractor Config )
afterLaunch = function() { 
   return retry.afterLaunch(NUMBER_OF_RETRIES);
}

It is Mandatory to use return here

Full Protractor Config snippet with 2 retries
exports.config = {
    // rest of your config
    onCleanUp: function (results) {
        retry.onCleanUp(results);
    },
    onPrepare: function () {
        retry.onPrepare();
    },
    afterLaunch: function() {
        return retry.afterLaunch(2);
    }
};

Known Caveat

If you are NOT Running in Parallel mode, the package will retry the whole testsuite if any failure.

Keywords

FAQs

Package last updated on 25 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc