cypress-slow-down
Advanced tools
Comparing version 1.2.1 to 1.3.0
{ | ||
"name": "cypress-slow-down", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Slow down your Cypress tests", | ||
@@ -22,4 +22,4 @@ "main": "src/index.js", | ||
"devDependencies": { | ||
"cypress": "^10.3.1", | ||
"cypress-timestamps": "^1.2.0", | ||
"cypress": "12.3.0", | ||
"cypress-timestamps": "1.2.3", | ||
"prettier": "^2.7.1", | ||
@@ -26,0 +26,0 @@ "semantic-release": "^19.0.3" |
@@ -1,2 +0,2 @@ | ||
# cypress-slow-down ![cypress version](https://img.shields.io/badge/cypress-10.3.1-brightgreen) [![ci](https://github.com/bahmutov/cypress-slow-down/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/bahmutov/cypress-slow-down/actions/workflows/ci.yml) [![cypress-slow-down](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/simple/q3727b&style=flat&logo=cypress)](https://dashboard.cypress.io/projects/q3727b/runs) | ||
# cypress-slow-down ![cypress version](https://img.shields.io/badge/cypress-12.3.0-brightgreen) [![ci](https://github.com/bahmutov/cypress-slow-down/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/bahmutov/cypress-slow-down/actions/workflows/ci.yml) [![cypress-slow-down](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/simple/q3727b&style=flat&logo=cypress)](https://dashboard.cypress.io/projects/q3727b/runs) | ||
@@ -7,2 +7,4 @@ > Slow down your Cypress tests | ||
![One command per second](./images/slow.gif) | ||
## Install | ||
@@ -58,2 +60,8 @@ | ||
You can set the optional `logToConsole` parameter to false to prevent the plugin from logging each delay to the console. | ||
```js | ||
slowCypressDown(1000, false) | ||
``` | ||
## Disable the slow down | ||
@@ -141,26 +149,1 @@ | ||
[open issue](https://github.com/bahmutov/cypress-slow-down/issues) on Github | ||
## MIT License | ||
Copyright (c) 2022 Gleb Bahmutov <gleb.bahmutov@gmail.com> | ||
Permission is hereby granted, free of charge, to any person | ||
obtaining a copy of this software and associated documentation | ||
files (the "Software"), to deal in the Software without | ||
restriction, including without limitation the rights to use, | ||
copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following | ||
conditions: | ||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. |
@@ -11,2 +11,5 @@ // import the custom Cypress commands provided by this module | ||
*/ | ||
export function slowCypressDown(ms?: number | false): void | ||
export function slowCypressDown( | ||
ms?: number | false, | ||
logToConsole?: boolean, | ||
): void |
@@ -10,3 +10,3 @@ // for consistency, if we use CommonJS to export from this module | ||
function slowCypressDown(commandDelay) { | ||
function slowCypressDown(commandDelay, logToConsole = true) { | ||
if (typeof commandDelay === 'undefined') { | ||
@@ -31,3 +31,5 @@ commandDelay = getPluginConfigValue(key) | ||
const currentCommandDelay = getPluginConfigValue(key) || commandDelay | ||
console.log({ currentCommandDelay }) | ||
if (logToConsole) { | ||
console.log({ currentCommandDelay }) | ||
} | ||
if (!currentCommandDelay) { | ||
@@ -34,0 +36,0 @@ return rc(cmd) |
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
9927
7
108
147