mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-14 19:20:42 -06:00
Add 'slow' option to configure slow test threshold
This commit is contained in:
@@ -125,6 +125,7 @@ const descriptions = {
|
||||
record: 'records the run. sends test results, screenshots and videos to your Cypress Dashboard.',
|
||||
reporter: 'runs a specific mocha reporter. pass a path to use a custom reporter. defaults to "spec"',
|
||||
reporterOptions: 'options for the mocha reporter. defaults to "null"',
|
||||
slow: '"slow" test threshold in milliseconds. defaults to 5000',
|
||||
spec: 'runs specific spec file(s). defaults to "all"',
|
||||
tag: 'named tag(s) for recorded runs in the Cypress Dashboard',
|
||||
version: 'prints Cypress version',
|
||||
@@ -264,6 +265,7 @@ const addCypressRunCommand = (program) => {
|
||||
.option('-r, --reporter <reporter>', text('reporter'))
|
||||
.option('-o, --reporter-options <reporter-options>', text('reporterOptions'))
|
||||
.option('-s, --spec <spec>', text('spec'))
|
||||
.option('-S, --slow <milliseconds>', text('slow'))
|
||||
.option('-t, --tag <tag>', text('tag'))
|
||||
.option('--dev', text('dev'), coerceFalse)
|
||||
}
|
||||
@@ -451,6 +453,7 @@ module.exports = {
|
||||
.option('-r, --reporter <reporter>', text('reporter'))
|
||||
.option('-o, --reporter-options <reporter-options>', text('reporterOptions'))
|
||||
.option('-s, --spec <spec>', text('spec'))
|
||||
.option('-S, --slow <milliseconds>', text('slow'))
|
||||
.option('-t, --tag <tag>', text('tag'))
|
||||
.option('--dev', text('dev'), coerceFalse)
|
||||
.action((opts) => {
|
||||
|
||||
@@ -128,6 +128,10 @@ const processRunOptions = (options = {}) => {
|
||||
args.push('--reporter-options', options.reporterOptions)
|
||||
}
|
||||
|
||||
if (options.slow) {
|
||||
args.push('--slow', options.slow)
|
||||
}
|
||||
|
||||
// if we have specific spec(s) push that into the args
|
||||
if (options.spec) {
|
||||
args.push('--spec', options.spec)
|
||||
|
||||
@@ -220,6 +220,7 @@ const parseOpts = (opts) => {
|
||||
'reporterOptions',
|
||||
'record',
|
||||
'runProject',
|
||||
'slow',
|
||||
'spec',
|
||||
'tag')
|
||||
|
||||
|
||||
@@ -44,6 +44,11 @@
|
||||
"default": null,
|
||||
"description": "The reporter options used. Supported options depend on the reporter. See https://on.cypress.io/reporters#Reporter-Options"
|
||||
},
|
||||
"slow": {
|
||||
"type": "number",
|
||||
"default": 5000,
|
||||
"description": "Slow test timeout passed to mocha. See See https://on.cypress.io/configuration#Global"
|
||||
},
|
||||
"testFiles": {
|
||||
"type": [
|
||||
"string",
|
||||
|
||||
4
cli/types/cypress-npm-api.d.ts
vendored
4
cli/types/cypress-npm-api.d.ts
vendored
@@ -91,6 +91,10 @@ declare namespace CypressCommandLine {
|
||||
* Specify mocha reporter options
|
||||
*/
|
||||
reporterOptions: any
|
||||
/**
|
||||
* Specify a slow test threshold in milliseconds
|
||||
*/
|
||||
slow: number
|
||||
/**
|
||||
* Specify the specs to run
|
||||
*/
|
||||
|
||||
5
cli/types/cypress.d.ts
vendored
5
cli/types/cypress.d.ts
vendored
@@ -2572,6 +2572,11 @@ declare namespace Cypress {
|
||||
* @default "spec"
|
||||
*/
|
||||
reporterOptions: { [key: string]: any }
|
||||
/**
|
||||
* A slow test threshold in milliseconds
|
||||
* @default 5000
|
||||
*/
|
||||
slow: number | null
|
||||
/**
|
||||
* Whether Cypress will watch and restart tests on test file changes
|
||||
* @default true
|
||||
|
||||
Reference in New Issue
Block a user