diff --git a/docs/generated/packages/cypress/executors/cypress.json b/docs/generated/packages/cypress/executors/cypress.json index 715c10307237a..1f70dce5603bc 100644 --- a/docs/generated/packages/cypress/executors/cypress.json +++ b/docs/generated/packages/cypress/executors/cypress.json @@ -101,6 +101,7 @@ "description": "A named group for recorded runs in the Cypress dashboard." }, "ignoreTestFiles": { + "aliases": ["excludeSpecPattern"], "type": "string", "description": "A String or Array of glob patterns used to ignore test files that would otherwise be shown in your list of tests. Cypress uses minimatch with the options: `{dot: true, matchBase: true}`. We suggest using https://globster.xyz to test what files would match." }, diff --git a/packages/cypress/src/executors/cypress/cypress.impl.ts b/packages/cypress/src/executors/cypress/cypress.impl.ts index fd3ef2f3b9a81..e1a55a20d099e 100644 --- a/packages/cypress/src/executors/cypress/cypress.impl.ts +++ b/packages/cypress/src/executors/cypress/cypress.impl.ts @@ -190,6 +190,7 @@ async function runCypress( baseUrl: string, opts: NormalizedCypressExecutorOptions ) { + const cypressVersion = installedCypressVersion(); // Cypress expects the folder where a cypress config is present const projectFolderPath = dirname(opts.cypressConfig); const options: any = { @@ -225,7 +226,15 @@ async function runCypress( options.parallel = opts.parallel; options.ciBuildId = opts.ciBuildId?.toString(); options.group = opts.group; - options.ignoreTestFiles = opts.ignoreTestFiles; + // renamed in cy 10 + if (cypressVersion >= 10) { + options.config ??= {}; + options.config[opts.testingType] = { + excludeSpecPattern: opts.ignoreTestFiles, + }; + } else { + options.ignoreTestFiles = opts.ignoreTestFiles; + } if (opts.reporter) { options.reporter = opts.reporter; diff --git a/packages/cypress/src/executors/cypress/schema.json b/packages/cypress/src/executors/cypress/schema.json index 1e62f9dc2fb14..4d25cc9df3c93 100644 --- a/packages/cypress/src/executors/cypress/schema.json +++ b/packages/cypress/src/executors/cypress/schema.json @@ -108,6 +108,7 @@ "description": "A named group for recorded runs in the Cypress dashboard." }, "ignoreTestFiles": { + "aliases": ["excludeSpecPattern"], "type": "string", "description": "A String or Array of glob patterns used to ignore test files that would otherwise be shown in your list of tests. Cypress uses minimatch with the options: `{dot: true, matchBase: true}`. We suggest using https://globster.xyz to test what files would match." },