I have a fairly large library of test files in my project (roughly 80) and I have them named with keywords ex. "create" "Edit" and "lifecycle". I want to be able to run npx cypress open
and only include all the test files that contain "lifecycle" for example. Is there something I can add to the Cypress.json globing wise?
To expand on @JosePita's idea, you can set up glob patterns in scripts (package.json) and by-pass the multitude config files he was concerned about.
For example, these work on my system,
"scripts": {
"cy:open": "cypress open", // all files
"cy:user": "cypress open -c testFiles=user/**/*", // just the user folder
"cy:error": "cypress open -c testFiles=**/*error*.js", // files with keyword 'error'
There's a search bar at the top of the Cypress runner, where the tests are listed, but search is all it does.
Pressing the Run all specs button runs the full set regardless of search results.
If you want to run a subset, specify the testFiles
config option on the command line.