Skip to content

Simple protractor module to wrap XMLHttpRequest.open to intercept requests.

License

Notifications You must be signed in to change notification settings

consoleau/protractor-intercept

 
 

Repository files navigation

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

About

Simple protractor module to wrap XMLHttpRequest.open to intercept requests.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 88.4%
  • HTML 11.6%