protractor-intercept

Intercept AJAX requests from

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
protractor-intercept
541.0.28 years ago8 years agoMinified + gzip package size for protractor-intercept in KB

Readme

protractor-intercept Build Status
Simple Interception of the XMLHttpRequest on the current context.

Install

$ npm install --save protractor-intercept

Usage

var Intercept = require('protractor-intercept');

var intercept = new Intercept(browser);

describe('Intecept XHttpRequests', function() {
  it('can add the listener to your page', function() {
    browser.get('https://docs.angularjs.org/api');
    intercept.addListener();
    element(by.linkText('angular.isFunction')).click();
    intercept.getRequests().then(function(reqs) {
      //make some assertions about what happened here
    });
  });
});

License

MIT © Steven Bassett