@nx/cypress 23.0.0-beta.21 → 23.0.0-beta.23
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/src/migrations/update-20-8-0/remove-experimental-fetch-polyfill.md +52 -0
- package/dist/src/migrations/update-20-8-0/replace-experimental-just-in-time-compile.md +105 -0
- package/dist/src/migrations/update-20-8-0/set-inject-document-domain.md +157 -0
- package/dist/src/migrations/update-20-8-0/update-component-testing-mount-imports.md +134 -0
- package/dist/src/migrations/update-21-0-0/remove-tsconfig-and-copy-files-options-from-cypress-executor.md +103 -0
- package/dist/src/migrations/update-22-1-0/rename-cy-exec-code-property.md +19 -0
- package/dist/src/migrations/update-22-1-0/update-angular-component-testing-support.md +19 -0
- package/dist/src/migrations/update-22-1-0/update-selector-playground-api.md +24 -0
- package/dist/src/migrations/update-23-0-0/remove-experimental-prompt-command.md +55 -0
- package/dist/src/plugins/plugin.d.ts +3 -3
- package/migrations.json +18 -9
- package/package.json +5 -5
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#### Remove `experimentalFetchPolyfill` Configuration Option
|
|
2
|
+
|
|
3
|
+
Removes the `experimentalFetchPolyfill` configuration option that was removed in Cypress v14. Read more at the [migration notes](<https://docs.cypress.io/app/references/changelog#:~:text=The%20experimentalFetchPolyfill%20configuration%20option%20was,cy.intercept()%20for%20handling%20fetch%20requests>).
|
|
4
|
+
|
|
5
|
+
#### Examples
|
|
6
|
+
|
|
7
|
+
##### Before
|
|
8
|
+
|
|
9
|
+
```ts title="apps/app1-e2e/cypress.config.ts"
|
|
10
|
+
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
|
|
11
|
+
import { defineConfig } from 'cypress';
|
|
12
|
+
|
|
13
|
+
export default defineConfig({
|
|
14
|
+
e2e: {
|
|
15
|
+
...nxE2EPreset(__filename, {
|
|
16
|
+
cypressDir: 'src',
|
|
17
|
+
bundler: 'vite',
|
|
18
|
+
webServerCommands: {
|
|
19
|
+
default: 'pnpm exec nx run app1:dev',
|
|
20
|
+
production: 'pnpm exec nx run app1:dev',
|
|
21
|
+
},
|
|
22
|
+
ciWebServerCommand: 'pnpm exec nx run app1:dev',
|
|
23
|
+
ciBaseUrl: 'http://localhost:4200',
|
|
24
|
+
}),
|
|
25
|
+
baseUrl: 'http://localhost:4200',
|
|
26
|
+
experimentalFetchPolyfill: true,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
##### After
|
|
32
|
+
|
|
33
|
+
```ts title="apps/app1-e2e/cypress.config.ts"
|
|
34
|
+
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
|
|
35
|
+
import { defineConfig } from 'cypress';
|
|
36
|
+
|
|
37
|
+
export default defineConfig({
|
|
38
|
+
e2e: {
|
|
39
|
+
...nxE2EPreset(__filename, {
|
|
40
|
+
cypressDir: 'src',
|
|
41
|
+
bundler: 'vite',
|
|
42
|
+
webServerCommands: {
|
|
43
|
+
default: 'pnpm exec nx run app1:dev',
|
|
44
|
+
production: 'pnpm exec nx run app1:dev',
|
|
45
|
+
},
|
|
46
|
+
ciWebServerCommand: 'pnpm exec nx run app1:dev',
|
|
47
|
+
ciBaseUrl: 'http://localhost:4200',
|
|
48
|
+
}),
|
|
49
|
+
baseUrl: 'http://localhost:4200',
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
```
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#### Replace the `experimentalJustInTimeCompile` Configuration Option with `justInTimeCompile`
|
|
2
|
+
|
|
3
|
+
Replaces the `experimentalJustInTimeCompile` configuration option with the new `justInTimeCompile` configuration option. Read more at the [migration notes](https://docs.cypress.io/app/references/migration-guide#CT-Just-in-Time-Compile-changes).
|
|
4
|
+
|
|
5
|
+
#### Examples
|
|
6
|
+
|
|
7
|
+
If the `experimentalJustInTimeCompile` configuration option is present and set to `true`, the migration will remove it. This is to account for the fact that JIT compilation is the default behavior in Cypress v14.
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```ts title="apps/app1/cypress.config.ts"
|
|
12
|
+
import { defineConfig } from 'cypress';
|
|
13
|
+
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
component: {
|
|
16
|
+
devServer: {
|
|
17
|
+
framework: 'angular',
|
|
18
|
+
bundler: 'webpack',
|
|
19
|
+
},
|
|
20
|
+
experimentalJustInTimeCompile: true,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
##### After
|
|
26
|
+
|
|
27
|
+
```ts title="apps/app1/cypress.config.ts"
|
|
28
|
+
import { defineConfig } from 'cypress';
|
|
29
|
+
|
|
30
|
+
export default defineConfig({
|
|
31
|
+
component: {
|
|
32
|
+
devServer: {
|
|
33
|
+
framework: 'angular',
|
|
34
|
+
bundler: 'webpack',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
If the `experimentalJustInTimeCompile` configuration option is set to `false` and it is using webpack, the migration will rename it to `justInTimeCompile`.
|
|
41
|
+
|
|
42
|
+
##### Before
|
|
43
|
+
|
|
44
|
+
```ts title="apps/app1/cypress.config.ts"
|
|
45
|
+
import { defineConfig } from 'cypress';
|
|
46
|
+
|
|
47
|
+
export default defineConfig({
|
|
48
|
+
component: {
|
|
49
|
+
devServer: {
|
|
50
|
+
framework: 'angular',
|
|
51
|
+
bundler: 'webpack',
|
|
52
|
+
},
|
|
53
|
+
experimentalJustInTimeCompile: false,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
##### After
|
|
59
|
+
|
|
60
|
+
```ts title="apps/app1/cypress.config.ts" {9}
|
|
61
|
+
import { defineConfig } from 'cypress';
|
|
62
|
+
|
|
63
|
+
export default defineConfig({
|
|
64
|
+
component: {
|
|
65
|
+
devServer: {
|
|
66
|
+
framework: 'angular',
|
|
67
|
+
bundler: 'webpack',
|
|
68
|
+
},
|
|
69
|
+
justInTimeCompile: false,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
If the `experimentalJustInTimeCompile` configuration is set to any value and it is using Vite, the migration will remove it. This is to account for the fact that JIT compilation no longer applies to Vite.
|
|
75
|
+
|
|
76
|
+
##### Before
|
|
77
|
+
|
|
78
|
+
```ts title="apps/app1/cypress.config.ts"
|
|
79
|
+
import { defineConfig } from 'cypress';
|
|
80
|
+
|
|
81
|
+
export default defineConfig({
|
|
82
|
+
component: {
|
|
83
|
+
devServer: {
|
|
84
|
+
framework: 'react',
|
|
85
|
+
bundler: 'vite',
|
|
86
|
+
},
|
|
87
|
+
experimentalJustInTimeCompile: false,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
##### After
|
|
93
|
+
|
|
94
|
+
```ts title="apps/app1/cypress.config.ts"
|
|
95
|
+
import { defineConfig } from 'cypress';
|
|
96
|
+
|
|
97
|
+
export default defineConfig({
|
|
98
|
+
component: {
|
|
99
|
+
devServer: {
|
|
100
|
+
framework: 'react',
|
|
101
|
+
bundler: 'vite',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
```
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
#### Set `injectDocumentDomain` Configuration Option
|
|
2
|
+
|
|
3
|
+
Replaces the removed `experimentalSkipDomainInjection` configuration option with the new `injectDocumentDomain` configuration option when needed. Skipping domain injection is the default behavior in Cypress v14 and therefore, it is required to use the `cy.origin()` command when navigating between domains. The `injectDocumentDomain` option was introduced to ease the transition to v14, but it is deprecated and will be removed in Cypress v15. Read more at the [migration notes](https://docs.cypress.io/app/references/migration-guide#Changes-to-cyorigin).
|
|
4
|
+
|
|
5
|
+
#### Examples
|
|
6
|
+
|
|
7
|
+
If the `experimentalSkipDomainInjection` configuration option is present, the migration will remove it. This is to account for the fact that skipping domain injection is the default behavior in Cypress v14.
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```ts title="apps/app1-e2e/cypress.config.ts"
|
|
12
|
+
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
|
|
13
|
+
import { defineConfig } from 'cypress';
|
|
14
|
+
|
|
15
|
+
export default defineConfig({
|
|
16
|
+
e2e: {
|
|
17
|
+
...nxE2EPreset(__filename, {
|
|
18
|
+
cypressDir: 'src',
|
|
19
|
+
bundler: 'vite',
|
|
20
|
+
webServerCommands: {
|
|
21
|
+
default: 'pnpm exec nx run app1:dev',
|
|
22
|
+
production: 'pnpm exec nx run app1:dev',
|
|
23
|
+
},
|
|
24
|
+
ciWebServerCommand: 'pnpm exec nx run app1:dev',
|
|
25
|
+
ciBaseUrl: 'http://localhost:4200',
|
|
26
|
+
}),
|
|
27
|
+
baseUrl: 'http://localhost:4200',
|
|
28
|
+
experimentalSkipDomainInjection: ['https://example.com'],
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
##### After
|
|
34
|
+
|
|
35
|
+
```ts title="apps/app1-e2e/cypress.config.ts"
|
|
36
|
+
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
|
|
37
|
+
import { defineConfig } from 'cypress';
|
|
38
|
+
|
|
39
|
+
export default defineConfig({
|
|
40
|
+
e2e: {
|
|
41
|
+
...nxE2EPreset(__filename, {
|
|
42
|
+
cypressDir: 'src',
|
|
43
|
+
bundler: 'vite',
|
|
44
|
+
webServerCommands: {
|
|
45
|
+
default: 'pnpm exec nx run app1:dev',
|
|
46
|
+
production: 'pnpm exec nx run app1:dev',
|
|
47
|
+
},
|
|
48
|
+
ciWebServerCommand: 'pnpm exec nx run app1:dev',
|
|
49
|
+
ciBaseUrl: 'http://localhost:4200',
|
|
50
|
+
}),
|
|
51
|
+
baseUrl: 'http://localhost:4200',
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
If the `experimentalSkipDomainInjection` configuration option is present and set to an empty array (no domain injection is skipped), the migration will remove it and will set the `injectDocumentDomain` option to `true`.
|
|
57
|
+
|
|
58
|
+
##### Before
|
|
59
|
+
|
|
60
|
+
```ts title="apps/app1-e2e/cypress.config.ts"
|
|
61
|
+
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
|
|
62
|
+
import { defineConfig } from 'cypress';
|
|
63
|
+
|
|
64
|
+
export default defineConfig({
|
|
65
|
+
e2e: {
|
|
66
|
+
...nxE2EPreset(__filename, {
|
|
67
|
+
cypressDir: 'src',
|
|
68
|
+
bundler: 'vite',
|
|
69
|
+
webServerCommands: {
|
|
70
|
+
default: 'pnpm exec nx run app1:dev',
|
|
71
|
+
production: 'pnpm exec nx run app1:dev',
|
|
72
|
+
},
|
|
73
|
+
ciWebServerCommand: 'pnpm exec nx run app1:dev',
|
|
74
|
+
ciBaseUrl: 'http://localhost:4200',
|
|
75
|
+
}),
|
|
76
|
+
baseUrl: 'http://localhost:4200',
|
|
77
|
+
experimentalSkipDomainInjection: [],
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
##### After
|
|
83
|
+
|
|
84
|
+
```ts title="apps/app1-e2e/cypress.config.ts" {17-19}
|
|
85
|
+
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
|
|
86
|
+
import { defineConfig } from 'cypress';
|
|
87
|
+
|
|
88
|
+
export default defineConfig({
|
|
89
|
+
e2e: {
|
|
90
|
+
...nxE2EPreset(__filename, {
|
|
91
|
+
cypressDir: 'src',
|
|
92
|
+
bundler: 'vite',
|
|
93
|
+
webServerCommands: {
|
|
94
|
+
default: 'pnpm exec nx run app1:dev',
|
|
95
|
+
production: 'pnpm exec nx run app1:dev',
|
|
96
|
+
},
|
|
97
|
+
ciWebServerCommand: 'pnpm exec nx run app1:dev',
|
|
98
|
+
ciBaseUrl: 'http://localhost:4200',
|
|
99
|
+
}),
|
|
100
|
+
baseUrl: 'http://localhost:4200',
|
|
101
|
+
// Please ensure you use `cy.origin()` when navigating between domains and remove this option.
|
|
102
|
+
// See https://docs.cypress.io/app/references/migration-guide#Changes-to-cyorigin
|
|
103
|
+
injectDocumentDomain: true,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
If the `experimentalSkipDomainInjection` configuration option is not present (no domain injection is skipped), the migration will set the `injectDocumentDomain` option to `true`.
|
|
109
|
+
|
|
110
|
+
##### Before
|
|
111
|
+
|
|
112
|
+
```ts title="apps/app1-e2e/cypress.config.ts"
|
|
113
|
+
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
|
|
114
|
+
import { defineConfig } from 'cypress';
|
|
115
|
+
|
|
116
|
+
export default defineConfig({
|
|
117
|
+
e2e: {
|
|
118
|
+
...nxE2EPreset(__filename, {
|
|
119
|
+
cypressDir: 'src',
|
|
120
|
+
bundler: 'vite',
|
|
121
|
+
webServerCommands: {
|
|
122
|
+
default: 'pnpm exec nx run app1:dev',
|
|
123
|
+
production: 'pnpm exec nx run app1:dev',
|
|
124
|
+
},
|
|
125
|
+
ciWebServerCommand: 'pnpm exec nx run app1:dev',
|
|
126
|
+
ciBaseUrl: 'http://localhost:4200',
|
|
127
|
+
}),
|
|
128
|
+
baseUrl: 'http://localhost:4200',
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
##### After
|
|
134
|
+
|
|
135
|
+
```ts title="apps/app1-e2e/cypress.config.ts" {17-19}
|
|
136
|
+
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
|
|
137
|
+
import { defineConfig } from 'cypress';
|
|
138
|
+
|
|
139
|
+
export default defineConfig({
|
|
140
|
+
e2e: {
|
|
141
|
+
...nxE2EPreset(__filename, {
|
|
142
|
+
cypressDir: 'src',
|
|
143
|
+
bundler: 'vite',
|
|
144
|
+
webServerCommands: {
|
|
145
|
+
default: 'pnpm exec nx run app1:dev',
|
|
146
|
+
production: 'pnpm exec nx run app1:dev',
|
|
147
|
+
},
|
|
148
|
+
ciWebServerCommand: 'pnpm exec nx run app1:dev',
|
|
149
|
+
ciBaseUrl: 'http://localhost:4200',
|
|
150
|
+
}),
|
|
151
|
+
baseUrl: 'http://localhost:4200',
|
|
152
|
+
// Please ensure you use `cy.origin()` when navigating between domains and remove this option.
|
|
153
|
+
// See https://docs.cypress.io/app/references/migration-guide#Changes-to-cyorigin
|
|
154
|
+
injectDocumentDomain: true,
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
```
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
#### Update Component Testing `mount` Imports
|
|
2
|
+
|
|
3
|
+
Updates the relevant module specifiers when importing the `mount` function and using the Angular or React frameworks. Read more at the [Angular migration notes](https://docs.cypress.io/app/references/migration-guide#Angular-1720-CT-no-longer-supported) and the [React migration notes](https://docs.cypress.io/app/references/migration-guide#React-18-CT-no-longer-supported).
|
|
4
|
+
|
|
5
|
+
#### Examples
|
|
6
|
+
|
|
7
|
+
If using the Angular framework with a version greater than or equal to v17.2.0 and importing the `mount` function from the `cypress/angular-signals` module, the migration will update the import to use the `cypress/angular` module.
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```ts title="apps/app1/cypress/support/component.ts"
|
|
12
|
+
import { mount } from 'cypress/angular-signals';
|
|
13
|
+
import './commands';
|
|
14
|
+
|
|
15
|
+
declare global {
|
|
16
|
+
namespace Cypress {
|
|
17
|
+
interface Chainable<Subject> {
|
|
18
|
+
mount: typeof mount;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
Cypress.Commands.add('mount', mount);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
##### After
|
|
27
|
+
|
|
28
|
+
```ts title="apps/app1/cypress/support/component.ts" {1}
|
|
29
|
+
import { mount } from 'cypress/angular';
|
|
30
|
+
import './commands';
|
|
31
|
+
|
|
32
|
+
declare global {
|
|
33
|
+
namespace Cypress {
|
|
34
|
+
interface Chainable<Subject> {
|
|
35
|
+
mount: typeof mount;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
Cypress.Commands.add('mount', mount);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
If using the Angular framework with a version lower than v17.2.0 and importing the `mount` function from the `cypress/angular` module, the migration will install the `@cypress/angular@2` package and update the import to use the `@cypress/angular` module.
|
|
44
|
+
|
|
45
|
+
##### Before
|
|
46
|
+
|
|
47
|
+
```json title="package.json"
|
|
48
|
+
{
|
|
49
|
+
"name": "@my-repo/source",
|
|
50
|
+
"dependencies": {
|
|
51
|
+
...
|
|
52
|
+
"cypress": "^14.2.1"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```ts title="apps/app1/cypress/support/component.ts"
|
|
58
|
+
import { mount } from 'cypress/angular';
|
|
59
|
+
import './commands';
|
|
60
|
+
|
|
61
|
+
declare global {
|
|
62
|
+
namespace Cypress {
|
|
63
|
+
interface Chainable<Subject> {
|
|
64
|
+
mount: typeof mount;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
Cypress.Commands.add('mount', mount);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
##### After
|
|
73
|
+
|
|
74
|
+
```json title="package.json" {6}
|
|
75
|
+
{
|
|
76
|
+
"name": "@my-repo/source",
|
|
77
|
+
"dependencies": {
|
|
78
|
+
...
|
|
79
|
+
"cypress": "^14.2.1",
|
|
80
|
+
"@cypress/angular": "^2.1.0"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```ts title="apps/app1/cypress/support/component.ts" {1}
|
|
86
|
+
import { mount } from '@cypress/angular';
|
|
87
|
+
import './commands';
|
|
88
|
+
|
|
89
|
+
declare global {
|
|
90
|
+
namespace Cypress {
|
|
91
|
+
interface Chainable<Subject> {
|
|
92
|
+
mount: typeof mount;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
Cypress.Commands.add('mount', mount);
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
If using the React framework and importing the `mount` function from the `cypress/react18` module, the migration will update the import to use the `cypress/react` module.
|
|
101
|
+
|
|
102
|
+
##### Before
|
|
103
|
+
|
|
104
|
+
```ts title="apps/app1/cypress/support/component.ts"
|
|
105
|
+
import { mount } from 'cypress/react18';
|
|
106
|
+
import './commands';
|
|
107
|
+
|
|
108
|
+
declare global {
|
|
109
|
+
namespace Cypress {
|
|
110
|
+
interface Chainable<Subject> {
|
|
111
|
+
mount: typeof mount;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
Cypress.Commands.add('mount', mount);
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
##### After
|
|
120
|
+
|
|
121
|
+
```ts title="apps/app1/cypress/support/component.ts" {1}
|
|
122
|
+
import { mount } from 'cypress/react';
|
|
123
|
+
import './commands';
|
|
124
|
+
|
|
125
|
+
declare global {
|
|
126
|
+
namespace Cypress {
|
|
127
|
+
interface Chainable<Subject> {
|
|
128
|
+
mount: typeof mount;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
Cypress.Commands.add('mount', mount);
|
|
134
|
+
```
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#### Remove `tsConfig` and `copyFiles` Options from Cypress Executor
|
|
2
|
+
|
|
3
|
+
Removes the previously deprecated and unused `tsConfig` and `copyFiles` options from the `@nx/cypress:cypress` executor configuration in all projects.
|
|
4
|
+
|
|
5
|
+
#### Examples
|
|
6
|
+
|
|
7
|
+
Remove the options from the project configuration:
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```json title="apps/app1-e2e/project.json" {7-8}
|
|
12
|
+
{
|
|
13
|
+
"targets": {
|
|
14
|
+
"e2e": {
|
|
15
|
+
"executor": "@nx/cypress:cypress",
|
|
16
|
+
"options": {
|
|
17
|
+
"cypressConfig": "apps/app1-e2e/cypress.config.ts",
|
|
18
|
+
"tsConfig": "apps/app1-e2e/tsconfig.json",
|
|
19
|
+
"copyFiles": "**/*.spec.ts",
|
|
20
|
+
"devServerTarget": "app1:serve"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
##### After
|
|
28
|
+
|
|
29
|
+
```json title="apps/app1-e2e/project.json"
|
|
30
|
+
{
|
|
31
|
+
"targets": {
|
|
32
|
+
"e2e": {
|
|
33
|
+
"executor": "@nx/cypress:cypress",
|
|
34
|
+
"options": {
|
|
35
|
+
"cypressConfig": "apps/app1-e2e/cypress.config.ts",
|
|
36
|
+
"devServerTarget": "app1:serve"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Remove the options from a target default using the `@nx/cypress:cypress` executor:
|
|
44
|
+
|
|
45
|
+
##### Before
|
|
46
|
+
|
|
47
|
+
```json title="nx.json" {7-8}
|
|
48
|
+
{
|
|
49
|
+
"targetDefaults": {
|
|
50
|
+
"e2e": {
|
|
51
|
+
"cache": true,
|
|
52
|
+
"executor": "@nx/cypress:cypress",
|
|
53
|
+
"options": {
|
|
54
|
+
"tsConfig": "{projectRoot}/tsconfig.json",
|
|
55
|
+
"copyFiles": "**/*.spec.ts"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
##### After
|
|
63
|
+
|
|
64
|
+
```json title="nx.json"
|
|
65
|
+
{
|
|
66
|
+
"targetDefaults": {
|
|
67
|
+
"e2e": {
|
|
68
|
+
"cache": true,
|
|
69
|
+
"executor": "@nx/cypress:cypress"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Remove the options from a target default using the `@nx/cypress:cypress` executor as the key:
|
|
76
|
+
|
|
77
|
+
##### Before
|
|
78
|
+
|
|
79
|
+
```json title="nx.json" {6-7}
|
|
80
|
+
{
|
|
81
|
+
"targetDefaults": {
|
|
82
|
+
"@nx/cypress:cypress": {
|
|
83
|
+
"cache": true,
|
|
84
|
+
"options": {
|
|
85
|
+
"tsConfig": "{projectRoot}/tsconfig.json",
|
|
86
|
+
"copyFiles": "**/*.spec.ts"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
##### After
|
|
94
|
+
|
|
95
|
+
```json title="nx.json"
|
|
96
|
+
{
|
|
97
|
+
"targetDefaults": {
|
|
98
|
+
"@nx/cypress:cypress": {
|
|
99
|
+
"cache": true
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#### Rename `cy.exec().its('code')` to `cy.exec().its('exitCode')`
|
|
2
|
+
|
|
3
|
+
Cypress v15 renamed the result property exposed by `cy.exec()` from `code` to `exitCode`. This migration updates Cypress spec files managed by Nx so that assertions such as `cy.exec(...).its('code')` use the new `exitCode` property.
|
|
4
|
+
|
|
5
|
+
Read more in the [migration guide](https://docs.cypress.io/app/references/migration-guide#cyexec-code-property-renamed).
|
|
6
|
+
|
|
7
|
+
#### Examples
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```ts title="apps/app-e2e/src/e2e/sample.cy.ts"
|
|
12
|
+
cy.exec('echo 0').its('code').should('eq', 0);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### After
|
|
16
|
+
|
|
17
|
+
```ts title="apps/app-e2e/src/e2e/sample.cy.ts"
|
|
18
|
+
cy.exec('echo 0').its('exitCode').should('eq', 0);
|
|
19
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#### Use the fallback Angular component testing harness for Cypress v15
|
|
2
|
+
|
|
3
|
+
Cypress v15 requires Angular component testing projects running Angular versions below 18 to migrate from the built-in `cypress/angular` helper to the `@cypress/angular` harness (v3). This migration updates component testing imports and ensures the correct dependency is installed.
|
|
4
|
+
|
|
5
|
+
Read more in the [migration guide](https://docs.cypress.io/app/references/migration-guide#Angular-17-CT-no-longer-supported).
|
|
6
|
+
|
|
7
|
+
#### Examples
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```ts title="apps/dashboard/src/app/app.component.cy.ts"
|
|
12
|
+
import { mount } from 'cypress/angular';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### After
|
|
16
|
+
|
|
17
|
+
```ts title="apps/dashboard/src/app/app.component.cy.ts"
|
|
18
|
+
import { mount } from '@cypress/angular';
|
|
19
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#### Update the Selector Playground API
|
|
2
|
+
|
|
3
|
+
Cypress v15 renamed `Cypress.SelectorPlayground` to `Cypress.ElementSelector` and removed the deprecated `onElement` option when calling `Cypress.ElementSelector.defaults()`. This migration updates existing Cypress support files to use the new API.
|
|
4
|
+
|
|
5
|
+
Read more in the [migration guide](https://docs.cypress.io/app/references/migration-guide#Selector-Playground-API-changes).
|
|
6
|
+
|
|
7
|
+
#### Examples
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```ts title="apps/web-e2e/src/support/selector.ts"
|
|
12
|
+
Cypress.SelectorPlayground.defaults({
|
|
13
|
+
selectorPriority: ['data-cy'],
|
|
14
|
+
onElement: (el) => el,
|
|
15
|
+
});
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
##### After
|
|
19
|
+
|
|
20
|
+
```ts title="apps/web-e2e/src/support/selector.ts"
|
|
21
|
+
Cypress.ElementSelector.defaults({
|
|
22
|
+
selectorPriority: ['data-cy'],
|
|
23
|
+
});
|
|
24
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#### Remove the `experimentalPromptCommand` Flag from Cypress Config
|
|
2
|
+
|
|
3
|
+
Removes the `experimentalPromptCommand` flag from `cypress.config.{ts,js,mjs,cjs}` files. The flag was removed in [Cypress 15.13.0](https://github.com/cypress-io/cypress/releases/tag/v15.13.0); `cy.prompt` is now in beta without configuration. Leaving the flag in place causes Cypress to error at startup.
|
|
4
|
+
|
|
5
|
+
#### Sample Code Changes
|
|
6
|
+
|
|
7
|
+
Remove `experimentalPromptCommand` from the top level of `defineConfig`.
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```ts title="apps/myapp-e2e/cypress.config.ts" {5}
|
|
12
|
+
import { defineConfig } from 'cypress';
|
|
13
|
+
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
e2e: { baseUrl: 'http://localhost:4200' },
|
|
16
|
+
experimentalPromptCommand: true,
|
|
17
|
+
});
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
##### After
|
|
21
|
+
|
|
22
|
+
```ts title="apps/myapp-e2e/cypress.config.ts"
|
|
23
|
+
import { defineConfig } from 'cypress';
|
|
24
|
+
|
|
25
|
+
export default defineConfig({
|
|
26
|
+
e2e: { baseUrl: 'http://localhost:4200' },
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The flag is also removed when nested inside `e2e` or `component`.
|
|
31
|
+
|
|
32
|
+
##### Before
|
|
33
|
+
|
|
34
|
+
```ts title="apps/myapp-e2e/cypress.config.ts" {5}
|
|
35
|
+
import { defineConfig } from 'cypress';
|
|
36
|
+
|
|
37
|
+
export default defineConfig({
|
|
38
|
+
e2e: {
|
|
39
|
+
experimentalPromptCommand: true,
|
|
40
|
+
baseUrl: 'http://localhost:4200',
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
##### After
|
|
46
|
+
|
|
47
|
+
```ts title="apps/myapp-e2e/cypress.config.ts"
|
|
48
|
+
import { defineConfig } from 'cypress';
|
|
49
|
+
|
|
50
|
+
export default defineConfig({
|
|
51
|
+
e2e: {
|
|
52
|
+
baseUrl: 'http://localhost:4200',
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CreateNodes } from '@nx/devkit';
|
|
2
2
|
export interface CypressPluginOptions {
|
|
3
3
|
ciTargetName?: string;
|
|
4
4
|
targetName?: string;
|
|
@@ -6,5 +6,5 @@ export interface CypressPluginOptions {
|
|
|
6
6
|
componentTestingTargetName?: string;
|
|
7
7
|
ciComponentTestingTargetName?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const createNodes:
|
|
10
|
-
export declare const createNodesV2:
|
|
9
|
+
export declare const createNodes: CreateNodes<CypressPluginOptions>;
|
|
10
|
+
export declare const createNodesV2: CreateNodes<CypressPluginOptions>;
|
package/migrations.json
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
"cypress": ">=14.0.0"
|
|
8
8
|
},
|
|
9
9
|
"description": "Replaces the `experimentalSkipDomainInjection` configuration option with the new `injectDocumentDomain` configuration option.",
|
|
10
|
-
"implementation": "./dist/src/migrations/update-20-8-0/set-inject-document-domain"
|
|
10
|
+
"implementation": "./dist/src/migrations/update-20-8-0/set-inject-document-domain",
|
|
11
|
+
"documentation": "./dist/src/migrations/update-20-8-0/set-inject-document-domain.md"
|
|
11
12
|
},
|
|
12
13
|
"remove-experimental-fetch-polyfill": {
|
|
13
14
|
"cli": "nx",
|
|
@@ -16,7 +17,8 @@
|
|
|
16
17
|
"cypress": ">=14.0.0"
|
|
17
18
|
},
|
|
18
19
|
"description": "Removes the `experimentalFetchPolyfill` configuration option.",
|
|
19
|
-
"implementation": "./dist/src/migrations/update-20-8-0/remove-experimental-fetch-polyfill"
|
|
20
|
+
"implementation": "./dist/src/migrations/update-20-8-0/remove-experimental-fetch-polyfill",
|
|
21
|
+
"documentation": "./dist/src/migrations/update-20-8-0/remove-experimental-fetch-polyfill.md"
|
|
20
22
|
},
|
|
21
23
|
"replace-experimental-just-in-time-compile": {
|
|
22
24
|
"cli": "nx",
|
|
@@ -25,7 +27,8 @@
|
|
|
25
27
|
"cypress": ">=14.0.0"
|
|
26
28
|
},
|
|
27
29
|
"description": "Replaces the `experimentalJustInTimeCompile` configuration option with the new `justInTimeCompile` configuration option.",
|
|
28
|
-
"implementation": "./dist/src/migrations/update-20-8-0/replace-experimental-just-in-time-compile"
|
|
30
|
+
"implementation": "./dist/src/migrations/update-20-8-0/replace-experimental-just-in-time-compile",
|
|
31
|
+
"documentation": "./dist/src/migrations/update-20-8-0/replace-experimental-just-in-time-compile.md"
|
|
29
32
|
},
|
|
30
33
|
"update-component-testing-mount-imports": {
|
|
31
34
|
"cli": "nx",
|
|
@@ -34,12 +37,14 @@
|
|
|
34
37
|
"cypress": ">=14.0.0"
|
|
35
38
|
},
|
|
36
39
|
"description": "Updates the module specifier for the Component Testing `mount` function.",
|
|
37
|
-
"implementation": "./dist/src/migrations/update-20-8-0/update-component-testing-mount-imports"
|
|
40
|
+
"implementation": "./dist/src/migrations/update-20-8-0/update-component-testing-mount-imports",
|
|
41
|
+
"documentation": "./dist/src/migrations/update-20-8-0/update-component-testing-mount-imports.md"
|
|
38
42
|
},
|
|
39
43
|
"remove-tsconfig-and-copy-files-options-from-cypress-executor": {
|
|
40
44
|
"version": "21.0.0-beta.10",
|
|
41
45
|
"description": "Removes the `tsConfig` and `copyFiles` options from the `@nx/cypress:cypress` executor.",
|
|
42
|
-
"implementation": "./dist/src/migrations/update-21-0-0/remove-tsconfig-and-copy-files-options-from-cypress-executor"
|
|
46
|
+
"implementation": "./dist/src/migrations/update-21-0-0/remove-tsconfig-and-copy-files-options-from-cypress-executor",
|
|
47
|
+
"documentation": "./dist/src/migrations/update-21-0-0/remove-tsconfig-and-copy-files-options-from-cypress-executor.md"
|
|
43
48
|
},
|
|
44
49
|
"rename-cy-exec-code-property": {
|
|
45
50
|
"version": "22.1.0-beta.6",
|
|
@@ -47,7 +52,8 @@
|
|
|
47
52
|
"cypress": ">=15.0.0"
|
|
48
53
|
},
|
|
49
54
|
"description": "Renames `cy.exec().its('code')` usages to the new `exitCode` property introduced in Cypress v15.",
|
|
50
|
-
"implementation": "./dist/src/migrations/update-22-1-0/rename-cy-exec-code-property"
|
|
55
|
+
"implementation": "./dist/src/migrations/update-22-1-0/rename-cy-exec-code-property",
|
|
56
|
+
"documentation": "./dist/src/migrations/update-22-1-0/rename-cy-exec-code-property.md"
|
|
51
57
|
},
|
|
52
58
|
"update-selector-playground-api": {
|
|
53
59
|
"version": "22.1.0-beta.6",
|
|
@@ -55,7 +61,8 @@
|
|
|
55
61
|
"cypress": ">=15.0.0"
|
|
56
62
|
},
|
|
57
63
|
"description": "Updates the deprecated `Cypress.SelectorPlayground` API to `Cypress.ElementSelector` and removes the unsupported `onElement` option.",
|
|
58
|
-
"implementation": "./dist/src/migrations/update-22-1-0/update-selector-playground-api"
|
|
64
|
+
"implementation": "./dist/src/migrations/update-22-1-0/update-selector-playground-api",
|
|
65
|
+
"documentation": "./dist/src/migrations/update-22-1-0/update-selector-playground-api.md"
|
|
59
66
|
},
|
|
60
67
|
"update-angular-component-testing-support": {
|
|
61
68
|
"version": "22.1.0-beta.6",
|
|
@@ -63,7 +70,8 @@
|
|
|
63
70
|
"cypress": ">=15.0.0"
|
|
64
71
|
},
|
|
65
72
|
"description": "For Angular component testing projects below v18, switches to the fallback `@cypress/angular` harness required by Cypress v15.",
|
|
66
|
-
"implementation": "./dist/src/migrations/update-22-1-0/update-angular-component-testing-support"
|
|
73
|
+
"implementation": "./dist/src/migrations/update-22-1-0/update-angular-component-testing-support",
|
|
74
|
+
"documentation": "./dist/src/migrations/update-22-1-0/update-angular-component-testing-support.md"
|
|
67
75
|
},
|
|
68
76
|
"remove-experimental-prompt-command": {
|
|
69
77
|
"version": "23.0.0-beta.10",
|
|
@@ -71,7 +79,8 @@
|
|
|
71
79
|
"cypress": ">=15.13.0"
|
|
72
80
|
},
|
|
73
81
|
"description": "Removes the `experimentalPromptCommand` flag from `cypress.config.{ts,js,mjs,cjs}`. The flag was removed in Cypress 15.13.0; `cy.prompt` is now in beta without configuration.",
|
|
74
|
-
"implementation": "./dist/src/migrations/update-23-0-0/remove-experimental-prompt-command"
|
|
82
|
+
"implementation": "./dist/src/migrations/update-23-0-0/remove-experimental-prompt-command",
|
|
83
|
+
"documentation": "./dist/src/migrations/update-23-0-0/remove-experimental-prompt-command.md"
|
|
75
84
|
},
|
|
76
85
|
"rewrite-internal-subpath-imports": {
|
|
77
86
|
"version": "23.0.0-beta.19",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/cypress",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.23",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
"semver": "^7.6.3",
|
|
90
90
|
"tree-kill": "^1.2.2",
|
|
91
91
|
"tslib": "^2.3.0",
|
|
92
|
-
"@nx/devkit": "23.0.0-beta.
|
|
93
|
-
"@nx/eslint": "23.0.0-beta.
|
|
94
|
-
"@nx/js": "23.0.0-beta.
|
|
92
|
+
"@nx/devkit": "23.0.0-beta.23",
|
|
93
|
+
"@nx/eslint": "23.0.0-beta.23",
|
|
94
|
+
"@nx/js": "23.0.0-beta.23"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"nx": "23.0.0-beta.
|
|
97
|
+
"nx": "23.0.0-beta.23"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"cypress": ">= 13 < 16"
|