One thing you can do is combine the specs into a single "batch".
If you make a spec file called, for instance, home-about.spec.js
that imports the home spec and about spec
import './home-page-test.spec.js'
import './about-page-test.spec.js'
The command yarn cypress run --spec cypress/e2e/home-about.spec.js
produces the following results
That method might be a bit simplistic, depending on what your npm run home-page-test
, npm run about-page-test
, etc commands are doing.
It might be better to create a NodeJs script and running the Cypress API Module, where you can add various options and also process results and errors.
// e2e-run-tests.js
const cypress = require('cypress')
cypress
.run({
spec: [
'./cypress/e2e/home-page-test.spec.js',
'./cypress/e2e/about-page-test.spec.js',
]
})
Run it with the command node e2e-run-tests.js