forked from cypress-io/cypress-example-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-me.js
28 lines (22 loc) · 742 Bytes
/
run-me.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// runs Cypress end-to-end tests using Cypress Node module API
// https://on.cypress.io/module-api
/* eslint-disable no-console */
const cypress = require('cypress')
cypress.cli.parseRunArguments(process.argv.slice(2))
.then((runOptions) => {
console.log('Parsed cypress run options:')
console.log(runOptions)
return runOptions
})
.then(cypress.run)
.then((results) => {
if (results.failures) {
// means really bad error, could not run tests
console.error('Failed to run Cypress')
console.error(results.message)
process.exit(1)
}
console.log('Cypress run results: %d total tests, %d passed, %d failed',
results.totalTests, results.totalPassed, results.totalFailed)
process.exit(results.totalFailed)
})