@ng-apimock/protractor-plugin
Advanced tools
Comparing version 1.1.0 to 2.0.0
@@ -6,2 +6,14 @@ # Changelog | ||
# [2.0.0](https://github.com/ng-apimock/protractor-plugin/compare/v1.1.0...v2.0.0) (2021-07-27) | ||
### Features | ||
* 🎸 test protractor support for create-preset ([332ca6e](https://github.com/ng-apimock/protractor-plugin/commit/332ca6eb67163c05c1e0a06efb9fbb55121c0938)) | ||
### BREAKING CHANGES | ||
* 🧨 update to v3.* | ||
# [1.1.0](https://github.com/ng-apimock/protractor-plugin/compare/v1.0.19...v1.1.0) (2020-07-08) | ||
@@ -8,0 +20,0 @@ |
{ | ||
"name": "@ng-apimock/protractor-plugin", | ||
"description": "Protractor plugin for ng-apimock", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"homepage": "https://github.com/ng-apimock/protractor-plugin#readme", | ||
@@ -17,2 +17,3 @@ "author": { | ||
"lint:fix": "npm run lint -- --fix", | ||
"lint-staged": "lint-staged", | ||
"test": "jest --config=jest.config.js -w 1", | ||
@@ -24,3 +25,4 @@ "protractor-local": "protractor test/protractor.local.conf.js", | ||
"sauce:start": "cd sc-4.6.2-linux && ./bin/sc", | ||
"sauce:started": "wait-on /tmp/sc-started -v" | ||
"sauce:started": "wait-on /tmp/sc-started -v", | ||
"semantic-release": "semantic-release" | ||
}, | ||
@@ -46,45 +48,55 @@ "repository": { | ||
"devDependencies": { | ||
"@commitlint/cli": "9.0.1", | ||
"@commitlint/config-conventional": "9.0.1", | ||
"@ng-apimock/core": "2.1.0", | ||
"@ng-apimock/test-application": "1.0.17", | ||
"@commitlint/cli": "13.1.0", | ||
"@commitlint/config-conventional": "13.1.0", | ||
"@ng-apimock/core": "3.0.3", | ||
"@ng-apimock/test-application": "3.0.0", | ||
"@semantic-release/changelog": "5.0.1", | ||
"@semantic-release/commit-analyzer": "8.0.1", | ||
"@semantic-release/git": "9.0.0", | ||
"@semantic-release/github": "7.0.7", | ||
"@semantic-release/npm": "7.0.5", | ||
"@semantic-release/release-notes-generator": "9.0.1", | ||
"@semantic-release/github": "7.2.3", | ||
"@semantic-release/npm": "7.1.3", | ||
"@semantic-release/release-notes-generator": "9.0.3", | ||
"@types/cucumber": "6.0.1", | ||
"@types/fs-extra": "9.0.1", | ||
"@types/jest": "26.0.4", | ||
"@typescript-eslint/eslint-plugin": "3.6.0", | ||
"@typescript-eslint/parser": "3.6.0", | ||
"commitizen": "4.1.2", | ||
"connect": "3.7.0", | ||
"@types/fs-extra": "9.0.12", | ||
"@types/jest": "26.0.24", | ||
"@typescript-eslint/eslint-plugin": "4.28.5", | ||
"@typescript-eslint/parser": "4.28.5", | ||
"commitizen": "4.2.4", | ||
"cucumber": "6.0.5", | ||
"eslint": "7.4.0", | ||
"eslint-config-airbnb-base": "14.2.0", | ||
"eslint-plugin-import": "2.22.0", | ||
"eslint-plugin-jest": "23.18.0", | ||
"fs-extra": "9.0.1", | ||
"husky": "4.2.5", | ||
"jest": "26.1.0", | ||
"eslint": "7.31.0", | ||
"eslint-config-airbnb-base": "14.2.1", | ||
"eslint-plugin-import": "2.23.4", | ||
"eslint-plugin-jest": "24.4.0", | ||
"express": "4.17.1", | ||
"fs-extra": "10.0.0", | ||
"http-proxy-middleware": "^2.0.1", | ||
"husky": "7.0.1", | ||
"jest": "27.0.6", | ||
"jest-matchers": "20.0.3", | ||
"lint-staged": "10.2.11", | ||
"lint-staged": "11.1.1", | ||
"protractor": "7.0.0", | ||
"protractor-cucumber-framework": "6.2.1", | ||
"protractor-cucumber-framework": "8.2.2", | ||
"rimraf": "3.0.2", | ||
"semantic-release": "17.1.1", | ||
"serve-static": "1.14.1", | ||
"ts-jest": "26.1.1", | ||
"ts-node": "8.10.2", | ||
"typescript": "3.9.6", | ||
"wait-on": "5.0.3" | ||
"semantic-release": "17.4.4", | ||
"ts-jest": "27.0.4", | ||
"ts-node": "10.1.0", | ||
"typescript": "4.3.5", | ||
"wait-on": "6.0.0" | ||
}, | ||
"dependencies": { | ||
"@ng-apimock/base-client": "2.0.0" | ||
"@ng-apimock/base-client": "3.1.0" | ||
}, | ||
"peerDependencies": { | ||
"protractor": ">=6.x" | ||
}, | ||
"lint-staged": { | ||
"**/**.{ts}": [ | ||
"eslint --fix" | ||
] | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "./node_modules/cz-conventional-changelog" | ||
} | ||
} | ||
} |
# ng-apimock/protractor-plugin [![npm](https://img.shields.io/npm/v/@ng-apimock/protractor-plugin?color=brightgreen)](https://www.npmjs.com/package/@ng-apimock/protractor-plugin) [![Build Status](https://github.com/ng-apimock/protractor-plugin/workflows/CI/badge.svg)](https://github.com/ng-apimock/protractor-plugin/actions?workflow=CI) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ng-apimock_protractor-plugin&metric=alert_status)](https://sonarcloud.io/dashboard?id=ng-apimock_protractor-plugin) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-brightgreen.svg)](https://github.com/semantic-release/semantic-release) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=ng-apimock/protractor-plugin)](https://dependabot.com) [![dependency Status](https://img.shields.io/david/ng-apimock/protractor-plugin.svg)](https://david-dm.org/ng-apimock/protractor-plugin) [![devDependency Status](https://img.shields.io/david/dev/ng-apimock/protractor-plugin.svg)](https://david-dm.org/ng-apimock/protractor-plugin#info=devDependencies) ![npm downloads](https://img.shields.io/npm/dm/@ng-apimock/protractor-plugin) | ||
protractor plugin for @ng-apimock/core | ||
## Getting Started | ||
## Getting started | ||
[Get started with @ng-apimock/protractor-plugin][gettingStarted]. | ||
```shell | ||
npm install @ng-apimock/protractor-plugin --save-dev | ||
``` | ||
## Changelog | ||
[Learn about the latest improvements][changelog]. | ||
### Usage | ||
This plugin connects to ng-apimock and makes the plugin functions available within the tests. | ||
Enable this plugin in your config file: | ||
```js | ||
exports.config = { | ||
plugins: [{ | ||
package: '@ng-apimock/protractor-plugin', | ||
options: { | ||
globalName: 'ngApimock' // optional option (defaults to ngApimock) | ||
} | ||
}] | ||
}; | ||
``` | ||
After registering the plugin, you can use it in your tests by calling it like this: | ||
```js | ||
describe('Some test', () => { | ||
it('does something', async () => | ||
await ngApimock.selectScenario('my-mock-name', 'some-scenario')); | ||
}); | ||
``` | ||
### Available plugin functions | ||
The following functions are available. Each plugin function returns a promise. | ||
##### selectScenario(name: string, scenario: string): Promise<any>; | ||
Selects the given scenario (when calling this function without a scenario or with 'passThrough' as scenario name, the call will be passed through to the actual backend). | ||
##### delayResponse(mockName: string, delay: number): Promise<any>; | ||
Sets the delay time in milliseconds for the mock. This makes sure the response is delayed. The delay set here overrides the delay defined in the response mock. | ||
##### echoRequest(name: string, echo: boolean): Promise<any>; | ||
Sets the indicator which enables / disables the request logging. | ||
##### setVariable(key: string, value: any): Promise<any>; | ||
Adds or updates the global variable. | ||
##### setVariables(variables: {[key: string]: any;}): Promise<any>; | ||
Adds or updates the global variables ie. {'some':'value', 'another': 'value'}. | ||
##### deleteVariable(key: string): Promise<any>; | ||
Deletes the global variable. | ||
##### resetMocksToDefault(): Promise<any>; | ||
Resets all the mocks to the default state. | ||
##### setMocksToPassThrough(): Promise<any>; | ||
Sets all the mocks to pass through. | ||
##### selectPreset(name: string): Promise<any>; | ||
Selects the mocks and variables in the selected state. | ||
[gettingStarted]: https://ngapimock.org/docs/plugins/protractor-plugin | ||
[api]: https://ngapimock.org/docs/api/select-scenario | ||
[changelog]: https://github.com/ng-apimock/protractor-plugin/blob/master/CHANGELOG.md |
13
16713
14
+ Added@ng-apimock/base-client@3.1.0(transitive)
+ Addednode-fetch@2.6.1(transitive)
+ Addeduuid@8.3.2(transitive)
- Removed@ng-apimock/base-client@2.0.0(transitive)
- Removednode-fetch@2.6.0(transitive)
- Removeduuid@8.2.0(transitive)