@codeceptjs/configure
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -0,1 +1,5 @@ | ||
0.8.0 | ||
* Added `setCommonPlugins` hook | ||
0.7.0 | ||
@@ -10,2 +14,2 @@ | ||
* Added try/catch block when taking cookie for `setSharedCookie` | ||
* CodeceptJS 3 compatibility | ||
* CodeceptJS 3 compatibility |
@@ -8,2 +8,3 @@ module.exports = { | ||
setTestHost: require('./hooks/setTestHost'), | ||
setCommonPlugins: require('./hooks/setCommonPlugins'), | ||
} |
{ | ||
"name": "@codeceptjs/configure", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "Set of CodeceptJS config hooks to simplify configuration", | ||
@@ -30,3 +30,3 @@ "main": "index.js", | ||
"chai": "^4.2.0", | ||
"codeceptjs": "^3.0.0", | ||
"codeceptjs": "^3.3.0", | ||
"mocha": "^8.2.1", | ||
@@ -33,0 +33,0 @@ "puppeteer": "^2.1", |
@@ -64,3 +64,23 @@ ## CodeceptJS Configuration Hooks [![Build Status](https://travis-ci.org/codeceptjs/configure.svg?branch=master)](https://travis-ci.org/codeceptjs/configure) | ||
``` | ||
### setCommonPlugins | ||
Enables CodeceptJS plugins which are recommened for common usage. | ||
The list of plugins can be updated from version to version so this hook ensures that all of them are loaded and you won't need to update them in a config: | ||
```js | ||
// in codecept.conf.js | ||
const { setCommonPlugins } = require('@codeceptjs/configure'); | ||
setCommonPlugins(); | ||
``` | ||
These plugins will be loaded: | ||
* tryTo (enabled globally) | ||
* retryFailedStep (enabled globally) | ||
* retryTo (enabled globally) | ||
* eachElement (enabled globally) | ||
* pauseOnFail (disabled, should be turned on when needed) | ||
* screenshotOnFail (enable globally) | ||
### setSharedCookies | ||
@@ -67,0 +87,0 @@ |
@@ -10,2 +10,3 @@ const Config = require('../codeceptjs').config; | ||
setTestHost, | ||
setCommonPlugins, | ||
} = require('../index'); | ||
@@ -312,2 +313,38 @@ | ||
}); | ||
describe('#setCommonPlugins', () => { | ||
it('create standard plugins', () => { | ||
Config.reset(); | ||
const config = { | ||
helpers: {}, | ||
} | ||
setCommonPlugins(); | ||
Config.create(config); | ||
expect(Config.get()).to.have.nested.property(`plugins.screenshotOnFail`); | ||
expect(Config.get()).to.have.nested.property(`plugins.tryTo`); | ||
expect(Config.get()).to.have.nested.property(`plugins.retryTo`); | ||
expect(Config.get()).to.have.nested.property(`plugins.eachElement`); | ||
}); | ||
it('should not override plugins', () => { | ||
Config.reset(); | ||
const config = { | ||
helpers: {}, | ||
plugins: { | ||
screenshotOnFail: { enabled: false }, | ||
otherPlugin: {} | ||
} | ||
} | ||
setCommonPlugins(); | ||
Config.create(config); | ||
expect(Config.get()).to.have.nested.property(`plugins.screenshotOnFail`); | ||
expect(Config.get()).to.have.nested.property(`plugins.screenshotOnFail.enabled`); | ||
expect(Config.get().plugins.screenshotOnFail.enabled).to.be.false; | ||
expect(Config.get()).to.have.nested.property(`plugins.tryTo`); | ||
expect(Config.get()).to.have.nested.property(`plugins.retryTo`); | ||
expect(Config.get()).to.have.nested.property(`plugins.eachElement`); | ||
expect(Config.get()).to.have.nested.property(`plugins.otherPlugin`); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42968
22
986
182