cypress-parallel
cypress-parallel copied to clipboard
Cannot execute just a spec (or group of them) inside the specs folder
Hi, first of all, thank you for your contribution, this can be very useful for our daily testing activities.
I see a problem, and it is that I cannot find a way to execute just a spec (or group of them) inside the specs folder.
For example, in regular Cypress I'll do:
"cypress run --spec 'cypress/integration/a.spec.js,cypress/integration/b.spec.js' --reporter cypr...
But if in cypress-parallel I try to do this, it does not work:
"parTest": "cypress-parallel -s cy:run -t 2 -a '\"--spec 'cypress/integration/a.spec.js,cypress/integration/b.spec.js'\"' ",
"cy:run": "cypress run ",
I also tried other alternatives but I can not find a way to do this. What I am doing wrong? Is it possible to achieve this with current version of cypress-parallel?
Thank you very much in advance!
I believe --spec
option only works for directories. If you leave it out and create another npm script and call it in the -s
option of cypress-parallel
I think that will work.
npx cypress-parallel --help
Options:
--help Show help [boolean]
--version Show version number [boolean]
--script, -s Your npm Cypress command [string]
--threads, -t Number of threads [number]
--verbose, -v Execute with verbose logging [boolean]
--bail, -b Exit on first suite finishing with errors [boolean]
--specsDir, -d Cypress specs directory [string]
--args, -a Your npm Cypress command arguments [string]
--reporter, -r Reporter to pass to Cypress [string]
--reporterOptions, -o Reporter options [string]
--reporterOptionsPath, -p Reporter options path [string]
Looks like you are requesting an Enhancement.
I see a problem, and it is that I cannot find a way to execute just a spec (or group of them) inside the specs folder. For example, in regular Cypress I'll do:
"cypress run --spec 'cypress/integration/a.spec.js,cypress/integration/b.spec.js' --reporter cypr..
This should be possible using the glob pattern match support:
npx cypress-parallel -s cypress run -t 2 -d "cypress/integration/**/{a,b}.spec.js
Full example (-v, verbose):
npx cypress-parallel -s cypress run -t 2 -d "cypress/integration/**/{a,b}.spec.js" -v
Using pattern cypress/integration/**/{a,b}.spec.js to find test suites
2 test suite(s) found.
Paths to found suites
[
"cypress/integration/a.spec.js",
"cypress/integration/b.spec.js"
]
[..]
Running: a.spec.js
[..]
Running: b.spec.js
Would result in 2 threads running the two matched specs in parallel.
Great, I will try and get back! Thanks @stevenmchaves and @isunja for your kind help!
Is there a way, where I can pass a list of test files instead of glob?