Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cypress-slow-down

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-slow-down - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

5

package.json
{
"name": "cypress-slow-down",
"version": "1.0.0",
"version": "1.1.0",
"description": "Slow down your Cypress tests",

@@ -27,3 +27,6 @@ "main": "src/index.js",

"url": "https://github.com/bahmutov/cypress-slow-down.git"
},
"dependencies": {
"cypress-plugin-config": "^1.0.0"
}
}

@@ -5,2 +5,4 @@ # 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)

Watch this plugin in the video [Slow Down Cypress Tests](https://youtu.be/lxx-_nAkQo8).
## Install

@@ -21,2 +23,3 @@

// cypress/e2e/spec.cy.js
// https://github.com/bahmutov/cypress-slow-down
import { slowCypressDown } from 'cypress-slow-down'

@@ -46,2 +49,3 @@ // slow down each command by the default amount

env: {
// https://github.com/bahmutov/cypress-slow-down
commandDelay: 500,

@@ -79,2 +83,3 @@ },

env: {
// https://github.com/bahmutov/cypress-slow-down
commandDelay: false,

@@ -86,2 +91,10 @@ },

## Change the command delay from DevTools
Because this plugin uses [cypress-plugin-config](https://github.com/bahmutov/cypress-plugin-config) to read the command delay option, you can change its value or disable the plugin completely from the DevTools console using the command `Cypress.setPluginConfigValue('commandDelay', <value>)`
![Change the command delay from the DevTools](./images/set-delay.png)
The re-run the tests by pressing the key "R" or clicking "Run All Tests" button.
## Small print

@@ -88,0 +101,0 @@

9

src/index.js

@@ -1,3 +0,8 @@

function slowCypressDown(commandDelay = Cypress.env('commandDelay')) {
import { getPluginConfigValue } from 'cypress-plugin-config'
function slowCypressDown(commandDelay) {
if (typeof commandDelay === 'undefined') {
commandDelay = getPluginConfigValue('commandDelay')
}
if (typeof commandDelay === 'undefined') {
commandDelay = 1000

@@ -13,3 +18,3 @@ }

throw new Error(
`Command delay cannot be negative, you passed ${commandDelay}`,
`Time is linear (I think), the command delay cannot be negative, you passed ${commandDelay}`,
)

@@ -16,0 +21,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc