Socket
Socket
Sign inDemoInstall

cypress-repeat

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-repeat

Run Cypress multiple times in a row


Version published
Maintainers
0
Created
Source

cypress-repeat ci status renovate-app badge cypress version

Run Cypress multiple times in a row, great at finding test flake

Read Wrap Cypress Using NPM Module API and Retry, Rerun, Repeat.

Install

npm i -D cypress-repeat
# or using Yarn
yarn add -D cypress-repeat

This module assumes the cypress dependency v5.3.0+ has been installed.

Use

npx cypress-repeat run -n <N> ... rest of "cypress run" arguments

Which will run Cypresss <N> times, exiting after the first failed run or after all runs finish successfully.

Until passes

You can flip the logic and run Cypress up to N times until the first successful exit

npx cypress-repeat run -n <N> --until-passes ... rest of "cypress run" arguments

Rerun only failed Specs

You can rerun only the specs that failed

npx cypress-repeat run -n <N> --until-passes --rerun-failed-only ... rest of "cypress run" arguments

Env variables

Every run has two utility variables injected

const n = Cypress.env('cypress_repeat_n') // total repeat attempts
const k = Cypress.env('cypress_repeat_k') // current attempt, starts with 1
                                          // and is <= n

Debugging

Run this script with environment variable DEBUG=cypress-repeat to see verbose logs

What about test retries?

This NPM module retries the entire Cypress run, if you need to retry just the failed tests, use the Test Retries.

Keywords

FAQs

Package last updated on 06 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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