trentrand / cypress-utils

⚙ Easily parallelize and stress-test your Cypress tests
MIT License
25 stars 6 forks source link

Can't find specified specs files #23

Open jove4015 opened 2 years ago

jove4015 commented 2 years ago

No matter what I do, I can't seem to stress-test against one spec file:

$ npx cypress-utils stress-test Orders/SGO.spec.js

No Cypress spec files were found. You may have specified invalid file identifiers.

The following file identifiers were provided: "Orders/SGO.spec.js"

Your configuration specifies that test files are contained within the following directory:
`./specs`

See help for the `--integrationFolder` command-line option if this is incorrect.

In my config:

  "integrationFolder": "./specs",
  "testFiles": "**/*.spec.js",

I have tried:

The file is definitely there in the specs folder.

This same spec will run just fine if I don't specify it and just allow it to run all specs- but that's not what I'm trying to stress test.

Is there any way to get this thing to print out what specs it does find so that I can figure out what it wants me to refer to the spec as?

trentrand commented 2 years ago

Hey, sorry to hear you're having trouble running it!

I'd expect this would work with the input you've suggested (e.g. npx cypress-utils stress-test Orders/SGO.spec.js).

Here's the part that seems to be failing for you: https://github.com/trentrand/cypress-utils/blob/master/index.js#L197-L202

The file matcher glob.sync(cypressConfig.integrationFolder + '/' + argv.testFiles) is going to look for files relative to your terminals working directory. Are you inside of the correct folder? It will likely be your project root, and should contain a cypress/ directory and cypress.config file.

If this doesn't help, consider running the util from source code and throw in some breakpoints / log messages. I think the issue will become apparent.

trentrand commented 2 years ago

Or perhaps your test name was written with the wrong casing (i.e. Orders/SGO.spec.js instead of orders/SGO.spec.js)? See issue #2.

jove4015 commented 2 years ago

Thanks for writing back Trent! I was able to get past it in the meantime by just removing all the other specs I wasn't trying to stress test temporarily. However for the next time it would be nice to sort out.

I was in the project root (where there was a cypress folder/) and the path name as you described was valid for my CWD. Capitalization / etc is correct.

Got a lot to wrap up yet before the break - I will try to find time next week to set it up to run from source and debug.

trentrand commented 2 years ago

Awesome! Glad to hear you've unblocked yourself.

Let me know what you find. Happy to help get it fixed!