@codeceptjs/configure
Advanced tools
Comparing version 0.2.0 to 0.2.1
module.exports = { | ||
useHeadlessWhen: require('./hooks/useHeadlessWhen'), | ||
useSharedCookies: require('./hooks/useSharedCookies'), | ||
setHeadlessWhen: require('./hooks/setHeadlessWhen'), | ||
setSharedCookies: require('./hooks/setSharedCookies'), | ||
setWindowSize: require('./hooks/setWindowSize'), | ||
} |
{ | ||
"name": "@codeceptjs/configure", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Set of CodeceptJS config hooks to simplify configuration", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha index_test.js", | ||
"test": "mocha test/index_test.js", | ||
"test-integration": "cd test/integration && CI=true npx codeceptjs run", | ||
"publish": "npm publish --access public" | ||
@@ -17,5 +18,2 @@ }, | ||
], | ||
"peerDependencies": { | ||
"codeceptjs": "codeception/codeceptjs" | ||
}, | ||
"author": "Michael Bodnarchuk", | ||
@@ -28,9 +26,11 @@ "license": "ISC", | ||
"dependencies": { | ||
"codeceptjs": "github:codeception/codeceptjs", | ||
"lodash.merge": "^4.6.2" | ||
"lodash.merge": "^4.6.2", | ||
"lodash.mergewith": "^4.6.2" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"mocha": "^6.2.0" | ||
"codeceptjs": "github:codeception/codeceptjs", | ||
"mocha": "^6.2.0", | ||
"puppeteer": "^1.20.0" | ||
} | ||
} |
@@ -7,3 +7,3 @@ ## CodeceptJS Configuration Hooks [![Build Status](https://travis-ci.org/codecept-js/configure.svg?branch=master)](https://travis-ci.org/codecept-js/configure) | ||
### useHeadlessWhen | ||
### setHeadlessWhen | ||
@@ -16,10 +16,10 @@ Toggle headless mode for Puppeteer, WebDriver, TestCafe, and Nightmare on condition. | ||
// in codecept.conf.js | ||
const { useHeadlessWhen } = require('@codeceptjs/configure'); | ||
const { setHeadlessWhen } = require('@codeceptjs/configure'); | ||
// enable headless only if environment variable HEADLESS exist | ||
useHeadlessWhen(process.env.HEADLESS); | ||
// Use it like: | ||
// | ||
// HEADLESS=true npx codeceptjs run | ||
setHeadlessWhen(process.env.HEADLESS); | ||
// or enable headless on CI | ||
useHeadlessWhen(process.env.CI); | ||
exports.config = { | ||
@@ -38,3 +38,3 @@ helpers: { | ||
### useSharedCookies | ||
### setSharedCookies | ||
@@ -48,6 +48,6 @@ Shares cookies between browser and REST/GraphQL helpers. | ||
// in codecept.conf.js | ||
const { useSharedCookies } = require('@codeceptjs/configure'); | ||
const { setSharedCookies } = require('@codeceptjs/configure'); | ||
// share cookies between browser helpers and REST/GraphQL | ||
useSharedCookies(); | ||
setSharedCookies(); | ||
@@ -74,2 +74,21 @@ exports.config = { | ||
### setWindowSize | ||
Universal way to set a browser window size. For Puppeteer this launches Chrome browser with a specified width and height dimensions without changing viewport size. | ||
Usage: `setWindowSize(width, height)`. | ||
```js | ||
// in codecept.conf.js | ||
const { setWindowSize } = require('@codeceptjs/configure'); | ||
setWindowSize(1600, 1200); | ||
exports.config = { | ||
helpers: { | ||
Puppeteer: {} | ||
} | ||
} | ||
``` | ||
## Contributing | ||
@@ -76,0 +95,0 @@ |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
GitHub dependency
Supply chain riskContains a dependency which resolves to a GitHub URL. Dependencies fetched from GitHub specifiers are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
27180
2
16
619
113
0
4
1
1
+ Addedlodash.mergewith@^4.6.2
+ Addedlodash.mergewith@4.6.2(transitive)