@nx/cypress 24.0.0-beta.2 → 24.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/internal.d.ts +1 -1
- package/dist/plugins/cypress-preset.js +47 -3
- package/dist/src/executors/cypress/{cypress.impl.d.ts → schema.d.ts} +0 -8
- package/dist/src/executors/cypress/schema.js +2 -0
- package/dist/src/generators/component-configuration/component-configuration.js +7 -57
- package/dist/src/generators/component-configuration/schema.d.ts +0 -2
- package/dist/src/generators/configuration/configuration.d.ts +0 -1
- package/dist/src/generators/configuration/configuration.js +13 -64
- package/dist/src/generators/init/init.js +2 -45
- package/dist/src/generators/init/schema.d.ts +0 -1
- package/dist/src/migrations/update-23-3-0/adapt-query-command-overwrites.md +1 -1
- package/dist/src/migrations/update-23-3-0/ai-instructions-for-cypress-16.md +2 -2
- package/dist/src/migrations/update-23-3-0/upgrade-to-cypress-16.js +3 -2
- package/dist/src/migrations/update-24-0-0/disable-wait-for-server-ready.d.ts +4 -0
- package/dist/src/migrations/update-24-0-0/disable-wait-for-server-ready.js +35 -0
- package/dist/src/migrations/update-24-0-0/disable-wait-for-server-ready.md +33 -0
- package/dist/src/migrations/update-24-0-0/finish-inferred-conversion.md +12 -0
- package/dist/src/migrations/update-24-0-0/remove-deprecated-executors.d.ts +6 -0
- package/dist/src/migrations/update-24-0-0/remove-deprecated-executors.js +10 -0
- package/dist/src/migrations/update-24-0-0/remove-deprecated-executors.md +61 -0
- package/dist/src/plugins/plugin.d.ts +5 -0
- package/dist/src/plugins/plugin.js +4 -1
- package/dist/src/utils/add-linter.d.ts +0 -1
- package/dist/src/utils/add-linter.js +0 -1
- package/dist/src/utils/find-target-options.js +0 -24
- package/executors.json +1 -7
- package/migrations.json +14 -0
- package/package.json +6 -7
- package/dist/src/executors/cypress/cypress.impl.js +0 -136
- package/dist/src/executors/cypress/schema.json +0 -186
- package/dist/src/utils/deprecation.d.ts +0 -3
- package/dist/src/utils/deprecation.js +0 -20
- package/dist/src/utils/start-dev-server.d.ts +0 -9
- package/dist/src/utils/start-dev-server.js +0 -165
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#### Convert `@nx/cypress:cypress` targets to inferred tasks
|
|
2
|
+
|
|
3
|
+
Nx 24 removes the `@nx/cypress:cypress` executor and its `@nrwl/cypress:cypress` alias. The migration registers `@nx/cypress/plugin` in `nx.json` and converts the targets that use those executors to inferred tasks. It moves the dev server and `baseUrl` settings into `cypress.config.*`. A target with nothing left to override is removed from project configuration. When several projects share the same remaining options, those options move to a `targetDefaults` entry scoped to the plugin. `targetDefaults` entries keyed by a removed executor are removed once no target uses that executor.
|
|
4
|
+
|
|
5
|
+
The migration lists the targets the converter cannot convert safely. In agentic runs, an AI prompt finishes them and validates the project graph.
|
|
6
|
+
|
|
7
|
+
#### Sample code changes
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```json title="myapp-e2e/project.json"
|
|
12
|
+
{
|
|
13
|
+
"name": "myapp-e2e",
|
|
14
|
+
"targets": {
|
|
15
|
+
"e2e": {
|
|
16
|
+
"executor": "@nx/cypress:cypress",
|
|
17
|
+
"options": {
|
|
18
|
+
"cypressConfig": "myapp-e2e/cypress.config.ts",
|
|
19
|
+
"testingType": "e2e",
|
|
20
|
+
"devServerTarget": "myapp:serve"
|
|
21
|
+
},
|
|
22
|
+
"configurations": {
|
|
23
|
+
"ci": {
|
|
24
|
+
"devServerTarget": "myapp:static-serve"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
##### After
|
|
33
|
+
|
|
34
|
+
```json title="myapp-e2e/project.json"
|
|
35
|
+
{
|
|
36
|
+
"name": "myapp-e2e",
|
|
37
|
+
"targets": {
|
|
38
|
+
"e2e": {
|
|
39
|
+
"options": {
|
|
40
|
+
"config-file": "./cypress.config.ts"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```json title="nx.json"
|
|
48
|
+
{
|
|
49
|
+
"plugins": [
|
|
50
|
+
{
|
|
51
|
+
"plugin": "@nx/cypress/plugin",
|
|
52
|
+
"options": {
|
|
53
|
+
"ciTargetName": "e2e-ci",
|
|
54
|
+
"componentTestingTargetName": "component-test",
|
|
55
|
+
"openTargetName": "open-cypress",
|
|
56
|
+
"targetName": "e2e"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
```
|
|
@@ -5,6 +5,11 @@ export interface CypressPluginOptions {
|
|
|
5
5
|
openTargetName?: string;
|
|
6
6
|
componentTestingTargetName?: string;
|
|
7
7
|
ciComponentTestingTargetName?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Wait for the web server task's `readyWhen` and test against the URL it
|
|
10
|
+
* reports. Defaults to `true`.
|
|
11
|
+
*/
|
|
12
|
+
waitForServerReady?: boolean;
|
|
8
13
|
}
|
|
9
14
|
export declare const createNodes: CreateNodes<CypressPluginOptions>;
|
|
10
15
|
export declare const createNodesV2: CreateNodes<CypressPluginOptions>;
|
|
@@ -177,6 +177,7 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
177
177
|
};
|
|
178
178
|
const webServerCommands = pluginPresetOptions?.webServerCommands;
|
|
179
179
|
const shouldReuseExistingServer = pluginPresetOptions?.reuseExistingServer ?? true;
|
|
180
|
+
const waitForServer = options.waitForServerReady === false ? {} : { waitFor: 'ready' };
|
|
180
181
|
const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
|
|
181
182
|
const targets = {};
|
|
182
183
|
let metadata;
|
|
@@ -211,6 +212,7 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
211
212
|
{
|
|
212
213
|
projects: [webServerCommandTask.project],
|
|
213
214
|
target: webServerCommandTask.target,
|
|
215
|
+
...waitForServer,
|
|
214
216
|
},
|
|
215
217
|
];
|
|
216
218
|
}
|
|
@@ -291,13 +293,14 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
291
293
|
{
|
|
292
294
|
target: ciWebServerCommandTask.target,
|
|
293
295
|
projects: [ciWebServerCommandTask.project],
|
|
296
|
+
...waitForServer,
|
|
294
297
|
},
|
|
295
298
|
];
|
|
296
299
|
}
|
|
297
300
|
else {
|
|
298
301
|
targets[targetName].parallelism = false;
|
|
299
302
|
}
|
|
300
|
-
targets[targetName] = (0, internal_1.applyTestFileDirectives)(targets[targetName], context.workspaceRoot, file,
|
|
303
|
+
targets[targetName] = (0, internal_1.applyTestFileDirectives)(targets[targetName], context.workspaceRoot, file, { ignoreServerInputs: true });
|
|
301
304
|
}
|
|
302
305
|
targets[options.ciTargetName] = {
|
|
303
306
|
executor: 'nx:noop',
|
|
@@ -21,6 +21,5 @@ export interface CyLinterOptions {
|
|
|
21
21
|
* This is useful when adding linting to a brand new project vs an existing one
|
|
22
22
|
**/
|
|
23
23
|
overwriteExisting?: boolean;
|
|
24
|
-
addPlugin?: boolean;
|
|
25
24
|
}
|
|
26
25
|
export declare function addLinterToCyProject(tree: Tree, options: CyLinterOptions): Promise<GeneratorCallback>;
|
|
@@ -24,7 +24,6 @@ async function addLinterToCyProject(tree, options) {
|
|
|
24
24
|
enableTypedLinting,
|
|
25
25
|
skipPackageJson: options.skipPackageJson,
|
|
26
26
|
rootProject: options.rootProject,
|
|
27
|
-
addPlugin: options.addPlugin,
|
|
28
27
|
}));
|
|
29
28
|
}
|
|
30
29
|
// Everything below configures ESLint — predefined configs, `extends`, ignore
|
|
@@ -42,7 +42,6 @@ ${Array.from(options.validExecutorNames)
|
|
|
42
42
|
.map((ve) => ` - ${ve}`)
|
|
43
43
|
.join('\n')}
|
|
44
44
|
|
|
45
|
-
${frameworkHelperMessage(Array.from(options.buildTarget), executorName)}
|
|
46
45
|
This is most likely because the provided --build-target is not a build target for an application or framework.
|
|
47
46
|
For example, the provide build target, '${options.buildTarget}' is:
|
|
48
47
|
- the build target for a buildable/publishable library instead of an app.
|
|
@@ -55,29 +54,6 @@ If you do not have an app in the workspace to you can make a new app with 'nx g
|
|
|
55
54
|
const foundConfig = configuration || projectConfig?.targets?.[target]?.defaultConfiguration;
|
|
56
55
|
return (0, devkit_1.readTargetOptions)({ project, target, configuration: foundConfig }, createExecutorContext(graph, projectConfig.targets, project, target, foundConfig));
|
|
57
56
|
}
|
|
58
|
-
function frameworkHelperMessage(validExecutorNames, executorName) {
|
|
59
|
-
const executorsToFramework = {
|
|
60
|
-
'@nx/webpack:webpack': 'react',
|
|
61
|
-
'@nx/vite:build': 'react',
|
|
62
|
-
'@nrwl/webpack:webpack': 'react',
|
|
63
|
-
'@nrwl/vite:build': 'react',
|
|
64
|
-
'@nx/angular:webpack-browser': 'angular',
|
|
65
|
-
'@nrwl/angular:webpack-browser': 'angular',
|
|
66
|
-
'@angular-devkit/build-angular:browser': 'angular',
|
|
67
|
-
'@nx/next:build': 'next',
|
|
68
|
-
'@nrwl/next:build': 'next',
|
|
69
|
-
};
|
|
70
|
-
const buildTargetFramework = executorsToFramework[executorName];
|
|
71
|
-
const invokedGeneratorFramework = validExecutorNames.find((e) => !!executorsToFramework[e]);
|
|
72
|
-
if (buildTargetFramework &&
|
|
73
|
-
invokedGeneratorFramework &&
|
|
74
|
-
buildTargetFramework !== invokedGeneratorFramework) {
|
|
75
|
-
return `It looks like you're using a different plugin generator than the --build-target framework is set up for.
|
|
76
|
-
The provided build target is configured for ${buildTargetFramework} instead of ${invokedGeneratorFramework}.
|
|
77
|
-
Try using @nx/${buildTargetFramework} instead.`;
|
|
78
|
-
}
|
|
79
|
-
return '';
|
|
80
|
-
}
|
|
81
57
|
async function findInGraph(tree, graph, options) {
|
|
82
58
|
const parents = findParentsOfProject(graph, options.project);
|
|
83
59
|
const potentialTargets = [];
|
package/executors.json
CHANGED
package/migrations.json
CHANGED
|
@@ -104,10 +104,24 @@
|
|
|
104
104
|
"requires": {
|
|
105
105
|
"cypress": ">=15.0.0 <16.0.0"
|
|
106
106
|
},
|
|
107
|
+
"optionalUpdate": true,
|
|
107
108
|
"description": "Moves a Cypress 15 workspace to Cypress 16: bumps `cypress` and the declared `@cypress/*-dev-server` packages unless a Vite component testing config, or a config whose bundler cannot be determined statically, resolves a Vite below 8, applies the Cypress 16 config option, `overwriteQuery` and `cypress/angular` rewrites, and hands the remaining source changes to an AI prompt.",
|
|
108
109
|
"implementation": "./dist/src/migrations/update-23-3-0/upgrade-to-cypress-16",
|
|
109
110
|
"prompt": "./dist/src/migrations/update-23-3-0/ai-instructions-for-cypress-16.md",
|
|
110
111
|
"documentation": "./dist/src/migrations/update-23-3-0/upgrade-to-cypress-16.md"
|
|
112
|
+
},
|
|
113
|
+
"remove-deprecated-executors": {
|
|
114
|
+
"version": "24.0.0-beta.3",
|
|
115
|
+
"description": "Converts targets using the removed `@nx/cypress` executors to inferred tasks; an AI prompt finishes the targets the converter cannot convert safely and validates the project graph.",
|
|
116
|
+
"implementation": "./dist/src/migrations/update-24-0-0/remove-deprecated-executors",
|
|
117
|
+
"prompt": "./dist/src/migrations/update-24-0-0/finish-inferred-conversion.md",
|
|
118
|
+
"documentation": "./dist/src/migrations/update-24-0-0/remove-deprecated-executors.md"
|
|
119
|
+
},
|
|
120
|
+
"disable-wait-for-server-ready": {
|
|
121
|
+
"version": "24.0.0-beta.4",
|
|
122
|
+
"description": "Sets `waitForServerReady: false` on `@nx/cypress/plugin` entries in `nx.json` so existing Cypress e2e tasks keep starting without waiting for the dev server to report it is ready.",
|
|
123
|
+
"implementation": "./dist/src/migrations/update-24-0-0/disable-wait-for-server-ready",
|
|
124
|
+
"documentation": "./dist/src/migrations/update-24-0-0/disable-wait-for-server-ready.md"
|
|
111
125
|
}
|
|
112
126
|
},
|
|
113
127
|
"packageJsonUpdates": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/cypress",
|
|
3
|
-
"version": "24.0.0-beta.
|
|
3
|
+
"version": "24.0.0-beta.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"executors.json",
|
|
11
11
|
"generators.json"
|
|
12
12
|
],
|
|
13
|
-
"description": "The Nx Plugin for Cypress
|
|
13
|
+
"description": "The Nx Plugin for Cypress infers tasks and provides generators allowing your workspace to use the powerful Cypress integration testing capabilities.",
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
16
|
"url": "https://github.com/nrwl/nx.git",
|
|
@@ -84,17 +84,16 @@
|
|
|
84
84
|
"supportsOptionalMigrations": true
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@nx/devkit": "24.0.0-beta.
|
|
88
|
-
"@nx/eslint": "24.0.0-beta.
|
|
89
|
-
"@nx/js": "24.0.0-beta.
|
|
87
|
+
"@nx/devkit": "24.0.0-beta.4",
|
|
88
|
+
"@nx/eslint": "24.0.0-beta.4",
|
|
89
|
+
"@nx/js": "24.0.0-beta.4",
|
|
90
90
|
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
91
|
-
"detect-port": "^2.1.0",
|
|
92
91
|
"semver": "^7.6.3",
|
|
93
92
|
"tree-kill": "^1.2.2",
|
|
94
93
|
"tslib": "^2.3.0"
|
|
95
94
|
},
|
|
96
95
|
"devDependencies": {
|
|
97
|
-
"nx": "24.0.0-beta.
|
|
96
|
+
"nx": "24.0.0-beta.4"
|
|
98
97
|
},
|
|
99
98
|
"peerDependencies": {
|
|
100
99
|
"cypress": ">= 13 < 17"
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = cypressExecutor;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const fs_1 = require("fs");
|
|
6
|
-
const path_1 = require("path");
|
|
7
|
-
const ct_helpers_1 = require("../../utils/ct-helpers");
|
|
8
|
-
const deprecation_1 = require("../../utils/deprecation");
|
|
9
|
-
const start_dev_server_1 = require("../../utils/start-dev-server");
|
|
10
|
-
const Cypress = require('cypress'); // @NOTE: Importing via ES6 messes the whole test dependencies.
|
|
11
|
-
async function cypressExecutor(options, context) {
|
|
12
|
-
(0, deprecation_1.warnCypressExecutorDeprecation)();
|
|
13
|
-
options = normalizeOptions(options, context);
|
|
14
|
-
// this is used by cypress component testing presets to build the executor contexts with the correct configuration options.
|
|
15
|
-
process.env.NX_CYPRESS_TARGET_CONFIGURATION = context.configurationName;
|
|
16
|
-
let success;
|
|
17
|
-
const generatorInstance = (0, start_dev_server_1.startDevServer)(options, context);
|
|
18
|
-
for await (const devServerValues of generatorInstance) {
|
|
19
|
-
try {
|
|
20
|
-
success = await runCypress(devServerValues.baseUrl, {
|
|
21
|
-
...options,
|
|
22
|
-
portLockFilePath: devServerValues.portLockFilePath,
|
|
23
|
-
});
|
|
24
|
-
if (!options.watch) {
|
|
25
|
-
generatorInstance.return();
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
catch (e) {
|
|
30
|
-
devkit_1.logger.error(e.message);
|
|
31
|
-
success = false;
|
|
32
|
-
if (!options.watch)
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return { success };
|
|
37
|
-
}
|
|
38
|
-
function normalizeOptions(options, context) {
|
|
39
|
-
options.env = options.env || {};
|
|
40
|
-
options.testingType ??= 'e2e';
|
|
41
|
-
if (options.testingType === 'component') {
|
|
42
|
-
const project = context?.projectGraph?.nodes?.[context.projectName];
|
|
43
|
-
if (project?.data?.root) {
|
|
44
|
-
options.ctTailwindPath = (0, ct_helpers_1.getTempTailwindPath)(context);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return options;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* @whatItDoes Initialize the Cypress test runner with the provided project configuration.
|
|
51
|
-
* By default, Cypress will run tests from the CLI without the GUI and provide directly the results in the console output.
|
|
52
|
-
* If `watch` is `true`: Open Cypress in the interactive GUI to interact directly with the application.
|
|
53
|
-
*/
|
|
54
|
-
async function runCypress(baseUrl, opts) {
|
|
55
|
-
// Cypress expects the folder where a cypress config is present
|
|
56
|
-
const projectFolderPath = (0, path_1.dirname)(opts.cypressConfig);
|
|
57
|
-
const options = {
|
|
58
|
-
project: projectFolderPath,
|
|
59
|
-
configFile: (0, path_1.basename)(opts.cypressConfig),
|
|
60
|
-
};
|
|
61
|
-
// If not, will use the `baseUrl` normally from `cypress.json`
|
|
62
|
-
if (baseUrl) {
|
|
63
|
-
options.config = { baseUrl };
|
|
64
|
-
}
|
|
65
|
-
if (opts.browser) {
|
|
66
|
-
options.browser = opts.browser;
|
|
67
|
-
}
|
|
68
|
-
if (opts.env) {
|
|
69
|
-
options.env = {
|
|
70
|
-
...options.env,
|
|
71
|
-
...opts.env,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
if (opts.spec) {
|
|
75
|
-
options.spec = opts.spec;
|
|
76
|
-
}
|
|
77
|
-
options.tag = opts.tag;
|
|
78
|
-
options.exit = opts.exit;
|
|
79
|
-
options.headed = opts.headed;
|
|
80
|
-
options.runnerUi = opts.runnerUi;
|
|
81
|
-
if (opts.headless) {
|
|
82
|
-
options.headless = opts.headless;
|
|
83
|
-
}
|
|
84
|
-
options.record = opts.record;
|
|
85
|
-
options.key = opts.key;
|
|
86
|
-
options.parallel = opts.parallel;
|
|
87
|
-
options.ciBuildId = opts.ciBuildId?.toString();
|
|
88
|
-
options.group = opts.group;
|
|
89
|
-
// renamed in cy 10
|
|
90
|
-
options.config ??= {};
|
|
91
|
-
options.config[opts.testingType] = {
|
|
92
|
-
excludeSpecPattern: opts.ignoreTestFiles,
|
|
93
|
-
};
|
|
94
|
-
if (opts.reporter) {
|
|
95
|
-
options.reporter = opts.reporter;
|
|
96
|
-
}
|
|
97
|
-
if (opts.reporterOptions) {
|
|
98
|
-
options.reporterOptions = opts.reporterOptions;
|
|
99
|
-
}
|
|
100
|
-
if (opts.quiet) {
|
|
101
|
-
options.quiet = opts.quiet;
|
|
102
|
-
}
|
|
103
|
-
if (opts.autoCancelAfterFailures !== undefined) {
|
|
104
|
-
options.autoCancelAfterFailures = opts.autoCancelAfterFailures;
|
|
105
|
-
}
|
|
106
|
-
options.testingType = opts.testingType;
|
|
107
|
-
const result = await (opts.watch
|
|
108
|
-
? Cypress.open(options)
|
|
109
|
-
: Cypress.run(options));
|
|
110
|
-
cleanupTmpFile(opts.ctTailwindPath);
|
|
111
|
-
cleanupTmpFile(opts.portLockFilePath);
|
|
112
|
-
if (process.env.NX_VERBOSE_LOGGING === 'true' && opts.portLockFilePath) {
|
|
113
|
-
(0, fs_1.readdirSync)((0, path_1.dirname)(opts.portLockFilePath)).forEach((f) => {
|
|
114
|
-
if (f.endsWith('.txt')) {
|
|
115
|
-
devkit_1.logger.debug(`Lock file ${f} still present`);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* `cypress.open` is returning `0` and is not of the same type as `cypress.run`.
|
|
121
|
-
* `cypress.open` is the graphical UI, so it will be obvious to know what wasn't
|
|
122
|
-
* working. Forcing the build to success when `cypress.open` is used.
|
|
123
|
-
*/
|
|
124
|
-
return !result.totalFailed && !result.failures;
|
|
125
|
-
}
|
|
126
|
-
function cleanupTmpFile(path) {
|
|
127
|
-
try {
|
|
128
|
-
if (path && (0, fs_1.existsSync)(path)) {
|
|
129
|
-
(0, fs_1.unlinkSync)(path);
|
|
130
|
-
}
|
|
131
|
-
return true;
|
|
132
|
-
}
|
|
133
|
-
catch (err) {
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"title": "Cypress Target",
|
|
4
|
-
"description": "Run Cypress for e2e, integration and component testing.",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"outputCapture": "pipe",
|
|
7
|
-
"cli": "nx",
|
|
8
|
-
"x-deprecated": "The `@nx/cypress:cypress` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/cypress:convert-to-inferred` to migrate to the `@nx/cypress/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
|
|
9
|
-
"presets": [
|
|
10
|
-
{
|
|
11
|
-
"name": "Starting Dev Server",
|
|
12
|
-
"keys": ["cypressConfig", "devServerTarget"]
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"name": "Custom Base Url",
|
|
16
|
-
"keys": ["cypressConfig", "baseUrl"]
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"name": "Component Testing",
|
|
20
|
-
"keys": ["cypressConfig", "devServerTarget", "testingType", "skipServe"]
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
"properties": {
|
|
24
|
-
"cypressConfig": {
|
|
25
|
-
"type": "string",
|
|
26
|
-
"description": "The path of the Cypress configuration json file.",
|
|
27
|
-
"x-completion-type": "file",
|
|
28
|
-
"x-completion-glob": "cypress?(*)@(.js|.ts|.json)"
|
|
29
|
-
},
|
|
30
|
-
"watch": {
|
|
31
|
-
"type": "boolean",
|
|
32
|
-
"description": "Recompile and run tests when files change.",
|
|
33
|
-
"default": false
|
|
34
|
-
},
|
|
35
|
-
"devServerTarget": {
|
|
36
|
-
"type": "string",
|
|
37
|
-
"description": "Dev server target to run tests against."
|
|
38
|
-
},
|
|
39
|
-
"headed": {
|
|
40
|
-
"type": "boolean",
|
|
41
|
-
"description": "Displays the browser instead of running headlessly. Set this to `true` if your run depends on a Chrome extension being loaded.",
|
|
42
|
-
"default": false
|
|
43
|
-
},
|
|
44
|
-
"headless": {
|
|
45
|
-
"type": "boolean",
|
|
46
|
-
"description": "Hide the browser instead of running headed.",
|
|
47
|
-
"default": false,
|
|
48
|
-
"x-deprecated": "Cypress runs headless by default. Use the --watch flag to control head/headless behavior instead. It will be removed in Nx v23."
|
|
49
|
-
},
|
|
50
|
-
"exit": {
|
|
51
|
-
"type": "boolean",
|
|
52
|
-
"description": "Whether or not the Cypress Test Runner will stay open after running tests in a spec file.",
|
|
53
|
-
"default": true
|
|
54
|
-
},
|
|
55
|
-
"key": {
|
|
56
|
-
"type": "string",
|
|
57
|
-
"description": "The key cypress should use to run tests in parallel/record the run (CI only)."
|
|
58
|
-
},
|
|
59
|
-
"record": {
|
|
60
|
-
"type": "boolean",
|
|
61
|
-
"description": "Whether or not Cypress should record the results of the tests.",
|
|
62
|
-
"default": false
|
|
63
|
-
},
|
|
64
|
-
"parallel": {
|
|
65
|
-
"aliases": ["p"],
|
|
66
|
-
"type": "boolean",
|
|
67
|
-
"description": "Whether or not Cypress should run its tests in parallel (CI only).",
|
|
68
|
-
"default": false
|
|
69
|
-
},
|
|
70
|
-
"baseUrl": {
|
|
71
|
-
"type": "string",
|
|
72
|
-
"description": "The address (with the port) which your application is running on.",
|
|
73
|
-
"x-priority": "important"
|
|
74
|
-
},
|
|
75
|
-
"browser": {
|
|
76
|
-
"type": "string",
|
|
77
|
-
"description": "The browser to run tests in."
|
|
78
|
-
},
|
|
79
|
-
"env": {
|
|
80
|
-
"type": "object",
|
|
81
|
-
"description": "A key-value Pair of environment variables to pass to Cypress runner."
|
|
82
|
-
},
|
|
83
|
-
"spec": {
|
|
84
|
-
"type": "string",
|
|
85
|
-
"description": "A comma delimited glob string that is provided to the Cypress runner to specify which spec files to run. i.e. `**examples/**,**actions.spec**`."
|
|
86
|
-
},
|
|
87
|
-
"ciBuildId": {
|
|
88
|
-
"oneOf": [
|
|
89
|
-
{
|
|
90
|
-
"type": "string"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"type": "number"
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
"description": "A unique identifier for a run to enable grouping or parallelization."
|
|
97
|
-
},
|
|
98
|
-
"group": {
|
|
99
|
-
"type": "string",
|
|
100
|
-
"description": "A named group for recorded runs in the Cypress dashboard."
|
|
101
|
-
},
|
|
102
|
-
"ignoreTestFiles": {
|
|
103
|
-
"aliases": ["excludeSpecPattern"],
|
|
104
|
-
"oneOf": [
|
|
105
|
-
{
|
|
106
|
-
"type": "string"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"type": "array",
|
|
110
|
-
"items": {
|
|
111
|
-
"type": "string"
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
],
|
|
115
|
-
"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."
|
|
116
|
-
},
|
|
117
|
-
"reporter": {
|
|
118
|
-
"type": "string",
|
|
119
|
-
"description": "The reporter used during cypress run."
|
|
120
|
-
},
|
|
121
|
-
"reporterOptions": {
|
|
122
|
-
"oneOf": [
|
|
123
|
-
{
|
|
124
|
-
"type": "string"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"type": "object"
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
"description": "The reporter options used. Supported options depend on the reporter. https://docs.cypress.io/guides/tooling/reporters#Reporter-Options"
|
|
131
|
-
},
|
|
132
|
-
"skipServe": {
|
|
133
|
-
"type": "boolean",
|
|
134
|
-
"description": "Skip dev-server build.",
|
|
135
|
-
"default": false
|
|
136
|
-
},
|
|
137
|
-
"testingType": {
|
|
138
|
-
"type": "string",
|
|
139
|
-
"description": "Specify the type of tests to execute.",
|
|
140
|
-
"enum": ["component", "e2e"],
|
|
141
|
-
"default": "e2e"
|
|
142
|
-
},
|
|
143
|
-
"tag": {
|
|
144
|
-
"type": "string",
|
|
145
|
-
"description": "A comma delimited list to identify a run with.",
|
|
146
|
-
"aliases": ["t"]
|
|
147
|
-
},
|
|
148
|
-
"port": {
|
|
149
|
-
"oneOf": [
|
|
150
|
-
{
|
|
151
|
-
"type": "string",
|
|
152
|
-
"enum": ["cypress-auto"]
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"type": "number"
|
|
156
|
-
}
|
|
157
|
-
],
|
|
158
|
-
"description": "Pass a specified port value to the devServerTarget, if the value is 'cypress-auto' a free port will automatically be picked for the devServerTarget."
|
|
159
|
-
},
|
|
160
|
-
"quiet": {
|
|
161
|
-
"aliases": ["q"],
|
|
162
|
-
"type": "boolean",
|
|
163
|
-
"description": "If passed, Cypress output will not be printed to stdout. Only output from the configured Mocha reporter will print.",
|
|
164
|
-
"default": false
|
|
165
|
-
},
|
|
166
|
-
"runnerUi": {
|
|
167
|
-
"type": "boolean",
|
|
168
|
-
"description": "Displays the Cypress Runner UI. Useful for when Test Replay is enabled and you would still like the Cypress Runner UI to be displayed for screenshots and video."
|
|
169
|
-
},
|
|
170
|
-
"autoCancelAfterFailures": {
|
|
171
|
-
"oneOf": [
|
|
172
|
-
{
|
|
173
|
-
"type": "number"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"type": "boolean",
|
|
177
|
-
"const": false
|
|
178
|
-
}
|
|
179
|
-
],
|
|
180
|
-
"description": "Specify the number of failures to cancel a run being recorded to the Cypress Cloud or `false` to disable auto-cancellation."
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
"additionalProperties": true,
|
|
184
|
-
"required": ["cypressConfig"],
|
|
185
|
-
"examplesFile": "../../../docs/cypress-examples.md"
|
|
186
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const CYPRESS_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/cypress:cypress` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/cypress:convert-to-inferred` to migrate to the `@nx/cypress/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.";
|
|
2
|
-
export declare function warnCypressExecutorDeprecation(): void;
|
|
3
|
-
export declare function warnCypressExecutorGenerating(): void;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CYPRESS_EXECUTOR_DEPRECATION_MESSAGE = void 0;
|
|
4
|
-
exports.warnCypressExecutorDeprecation = warnCypressExecutorDeprecation;
|
|
5
|
-
exports.warnCypressExecutorGenerating = warnCypressExecutorGenerating;
|
|
6
|
-
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
// TODO(v24): Remove the @nx/cypress:cypress executor. The inferred plugin
|
|
8
|
-
// (@nx/cypress/plugin) and the convert-to-inferred generator stay supported.
|
|
9
|
-
exports.CYPRESS_EXECUTOR_DEPRECATION_MESSAGE = 'The `@nx/cypress:cypress` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/cypress:convert-to-inferred` to migrate to the `@nx/cypress/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.';
|
|
10
|
-
function warnCypressExecutorDeprecation() {
|
|
11
|
-
devkit_1.logger.warn(exports.CYPRESS_EXECUTOR_DEPRECATION_MESSAGE);
|
|
12
|
-
}
|
|
13
|
-
// Fired when the @nx/cypress:configuration or :component-configuration
|
|
14
|
-
// generator is about to generate a target that uses the deprecated executor —
|
|
15
|
-
// i.e. when @nx/cypress/plugin isn't registered in nx.json. Surfaces the
|
|
16
|
-
// deprecation at generation time rather than only when the user later runs the
|
|
17
|
-
// generated target.
|
|
18
|
-
function warnCypressExecutorGenerating() {
|
|
19
|
-
devkit_1.logger.warn('Generating a target that uses the deprecated `@nx/cypress:cypress` executor. The executor will be removed in Nx v24. Run `nx g @nx/cypress:convert-to-inferred` next to migrate this target to the `@nx/cypress/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
|
|
20
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
-
import { CypressExecutorOptions } from '../executors/cypress/cypress.impl';
|
|
3
|
-
export declare function startDevServer(opts: Omit<CypressExecutorOptions, 'cypressConfig'>, context: ExecutorContext): AsyncGenerator<{
|
|
4
|
-
baseUrl: any;
|
|
5
|
-
portLockFilePath?: undefined;
|
|
6
|
-
} | {
|
|
7
|
-
baseUrl: any;
|
|
8
|
-
portLockFilePath: string;
|
|
9
|
-
}, void, unknown>;
|