bahmutov / cypress-repeat

Run Cypress multiple times in a row
https://glebbahmutov.com/blog/wrap-cypress-using-npm/
37 stars 11 forks source link

Currently im trying to use cypress-repeat and it gives me a 'Can't run because no spec files were found.' in --rerun-failed-only #31

Open tanimaroy2012 opened 2 years ago

tanimaroy2012 commented 2 years ago

My cypress tests are in the hierarchy cypress/payment/integration and in cypress run --until-passes works as expected but when i try to run --rerun-failed-only i always get the following error :-

Can't run because no spec files were found.

We searched for any files matching this glob pattern:

i tried setting the testFiles in cypress.json but no luck. Could you please help me with this? Thanks!

christianinsert commented 2 years ago

I have the same issue. Output I get:

cypress-repeat: failed specs
integration/myfolder/my_spec.ts
Can't run because no spec files were found.

We searched for any files matching this glob pattern:

../../integration/myfolder/my_spec.ts

Relative to the project root folder:

error: Cannot read properties of undefined (reading 'filter')
TypeError: Cannot read properties of undefined (reading 'filter')
    at onTestResults (node_modules/cypress-repeat/index.js:110:14)
    at tryCatcher (node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (node_modules/bluebird/js/release/promise.js:729:18)
    at Promise._fulfill (node_modules/bluebird/js/release/promise.js:673:18)
    at Promise._resolveCallback (node_modules/bluebird/js/release/promise.js:466:57)
    at Promise._settlePromiseFromHandler (node_modules/bluebird/js/release/promise.js:559:17)
    at Promise._settlePromise (node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (node_modules/bluebird/js/release/promise.js:729:18)
    at Promise._fulfill (node_modules/bluebird/js/release/promise.js:673:18)
    at node_modules/bluebird/js/release/nodeback.js:42:21
    at node_modules/universalify/index.js:22:54

It seems the ../.. part of the spec to retry is the problem.

kushale2014 commented 2 years ago

I get this error when I try to run --rerun-failed-only and with argument --project. The error does not appear if run without an argument --project.

I replaced 111 line in node_modules/cypress-repeat/index.js to: .map((run) => ((allRunOptions[k]['project']) ? allRunOptions[k]['project'] + '/' : '') + run.spec.relative)

It works for me.