All Projects → bahmutov → cypress-retry

bahmutov / cypress-retry

Licence: other
Retry just the failed Cypress.io tests using Cypress module API and AST rewriting

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cypress-retry

instrument-cra
Little module for CRA applications to instrument code without ejecting react-scripts
Stars: ✭ 61 (+281.25%)
Mutual labels:  cypress, cypress-io
cypress-angularjs-unit-test
Unit test Angularjs code using Cypress.io test runner
Stars: ✭ 23 (+43.75%)
Mutual labels:  cypress, cypress-io
cypress-watch-and-reload
Reloads Cypress when one of the watched files changes
Stars: ✭ 46 (+187.5%)
Mutual labels:  cypress, cypress-io
cypress-browserify-preprocessor
Cypress preprocessor for bundling JavaScript via browserify
Stars: ✭ 23 (+43.75%)
Mutual labels:  cypress, cypress-io
cypress-angular-unit-test
Trying to load and bootstrap Angular component dynamically inside Cypress
Stars: ✭ 146 (+812.5%)
Mutual labels:  cypress, cypress-io
cypress-test-tiny
Tiny Cypress E2E test case
Stars: ✭ 48 (+200%)
Mutual labels:  cypress, cypress-io
cypress-xpath
Adds XPath command to Cypress test runner
Stars: ✭ 145 (+806.25%)
Mutual labels:  cypress, cypress-io
cypress-example-circleci-orb
Demo of using the Cypress CircleCI Orb
Stars: ✭ 26 (+62.5%)
Mutual labels:  cypress, cypress-io
cypress-mochawesome-reporter
Zero config Mochawesome reporter for Cypress with screenshots
Stars: ✭ 48 (+200%)
Mutual labels:  cypress, cypress-io
cypress-example-docker-compose
Example running Cypress tests against Apache server via docker-compose
Stars: ✭ 106 (+562.5%)
Mutual labels:  cypress, cypress-io
cypress-upload-file-post-form
Solution for two Cypress testing use-cases I came across with: perform a direct http FORM request to the server containing a file and other parameters and upload a file into a form before submission
Stars: ✭ 59 (+268.75%)
Mutual labels:  cypress, cypress-io
cypress-hyperapp-unit-test
Unit test Hyperapp components using Cypress
Stars: ✭ 26 (+62.5%)
Mutual labels:  cypress, cypress-io
TLE5012-Magnetic-Angle-Sensor
This repository includes an library for Arduino for the TLE5012 Magnetic Angle Sensor with SSC interface.
Stars: ✭ 37 (+131.25%)
Mutual labels:  cypress, cypress-io
cypress-get-it
Get elements by data attribute by creating a Cy command on the fly
Stars: ✭ 23 (+43.75%)
Mutual labels:  cypress, cypress-io
cypress-example-docker-circle-workflows
Cypress + Docker + CircleCI Workflows = ❤️
Stars: ✭ 29 (+81.25%)
Mutual labels:  cypress, cypress-io
todo-graphql-example
Example Todo app on top of json-graphql-server
Stars: ✭ 20 (+25%)
Mutual labels:  cypress, cypress-io
svelte-pwa-now
A PWA ready Svelte v3.0 starter template with Tailwind, Now integration and optional Typescript suppot
Stars: ✭ 138 (+762.5%)
Mutual labels:  cypress, cypress-io
snapshot
Adds value / object / DOM element snapshot testing support to Cypress test runner
Stars: ✭ 114 (+612.5%)
Mutual labels:  cypress, cypress-io
amazin
A MERN-stack app for eCommerce platform, Webshop, Web Store. Storybook: https://www.amazin.one/ Alternative: https://ntrix.github.io/amazin-story
Stars: ✭ 27 (+68.75%)
Mutual labels:  cypress
firebase-spring-boot-rest-api-authentication
Firebase Spring Boot Rest API Authentication
Stars: ✭ 172 (+975%)
Mutual labels:  cypress

cypress-retry

Retry just the failed Cypress.io tests using Cypress module API and AST rewriting

First this script runs all tests in a given spec file. If any tests fail, these tests are returned by the module API. The script parses the spec file source into AST and changes all passing tests from it(...) to it.skip(...), and saves the updated spec file. Then it runs the spec again - and now only the failed tests should run. Then it restores the original spec back to full.

Example

First run - single test has failed

First run

The script has found the failed tests in the spec file

failures: 1
failed test titles:
outside,inside,fails when env variable FAIL is set
found test [ 'outside', 'inside', 'passes' ]
should skip this test
found test [ 'outside', 'inside', 'fails when env variable FAIL is set' ]
found test [ 'outside', 'works from single describe' ]
should skip this test
found test [ 'exists by itself' ]
should skip this test

Once all tests but one test have been switched to it.skip, the tests are retried - this time without env.FAIL=1 variable and the previously failing test is passing. Notice how all other tests are "pending", meaning they have been skipped by the test runner.

Second run

Debugging

Run with DEBUG=cypress-retry environment variable to see additional debug output.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].