# protractor-xhr-interceptor-plugin

> Protractor XHR/Fetch interceptor plugin

Latest version **0.1.4** (published 2021-01-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install protractor-xhr-interceptor-plugin
pnpm add protractor-xhr-interceptor-plugin
yarn add protractor-xhr-interceptor-plugin
bun add protractor-xhr-interceptor-plugin
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2021-01-07 |
| First published | 2021-01-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 31.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | artemr2009@gmail.com |
| Maintainers | artemrudenko |
| Keywords | protractor, plugin, xhr, intercept |

## Links

- npm: https://www.npmjs.com/package/protractor-xhr-interceptor-plugin
- Repository: https://github.com/artemrudenko/protractor-xhr-interceptor
- Homepage: https://github.com/artemrudenko/protractor-xhr-interceptor#readme
- Issues: https://github.com/artemrudenko/protractor-xhr-interceptor/issues
- npm.io page: https://npm.io/package/protractor-xhr-interceptor-plugin

## Dependencies (5)

- [tslib](https://npm.io/package/tslib.md) ^2.1.0
- [ts-node](https://npm.io/package/ts-node.md) ^9.1.1
- [protractor](https://npm.io/package/protractor.md) ^7.0.0
- [typescript](https://npm.io/package/typescript.md) ^4.1.3
- [@types/jasmine](https://npm.io/package/@types/jasmine.md) ^3.6.2

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.1.4 (latest) — 2021-01-07
- 0.1.3 — 2021-01-07
- 0.1.2 — 2021-01-07
- 0.1.1 — 2021-01-07
- 0.1.0 — 2021-01-07

## README

# protractor-xhr-interceptor-plugin

## Introduction
This plugin was inspired by **wdio-intercept-service** and provide similar functionality but for protractor.
Capture and assert HTTP ajax calls in [protractortest.org](https://www.protractortest.org/#/plugins)

## Installation
```
npm install protractor-xhr-interceptor-plugin -D
```

## Usage
You can download sample project from [sample](https://github.com/artemrudenko/xhr-plugin-usage-example.git)

It should be as easy as adding *protractor-xhr-interceptor-plugin* to your `protractor.conf.js`:

```javascript
exports.config = {
  plugins: [
    package: 'protractor-xhr-interceptor-plugin'
  ]
};
```

Once initialized, some related functions are added to your browser instance.

## Example
```ts
await browser.get(`https://angular.io`);
await browser.addInterceptor();
await browser.expectRequest('GET', 'generated/docs/docs.json', 200);
await element(by.xpath('//a[contains(.,"Get Started")]')).click();
await browser.assertRequests();
```

---
_Source: https://npm.io/package/protractor-xhr-interceptor-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
