File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,18 @@ setupNodeEvents(on, config) {
90
90
91
91
## Configuration
92
92
93
+ ### Project Flag
94
+
95
+ If you are using the ` --project ` flag when starting Cypress, you will need to set the Cypress environment variable ` PROJECT ` to your project name.
96
+
97
+ In cypress.config.ts:
98
+
99
+ ``` ts
100
+ env : {
101
+ PROJECT : ' my-project' ;
102
+ }
103
+ ```
104
+
93
105
### Javascript
94
106
95
107
The IntelliSense codegen feature is enabled by default.
@@ -100,12 +112,10 @@ You will still get the benefit of the custom commands being loaded automatically
100
112
CYPRESS_CODEGEN=false npx cypress run
101
113
```
102
114
103
- or in ` cypress.json ` :
115
+ or in ` cypress.config.js ` :
104
116
105
- ``` json
106
- {
107
- "env" : {
108
- "CODEGEN" : false
109
- }
117
+ ``` ts
118
+ env : {
119
+ CODEGEN : false ;
110
120
}
111
121
```
Original file line number Diff line number Diff line change @@ -17,8 +17,9 @@ before('Import Custom Commands', () => {
17
17
cy . task ( 'importCustomCommands' ) . then (
18
18
( { filePaths, commandsDirectory } : { filePaths : string [ ] ; commandsDirectory : string } ) => {
19
19
filePaths . forEach ( filePath => {
20
+ const projectName = Cypress . env ( 'PROJECT' ) ? `${ Cypress . env ( 'PROJECT' ) } /` : '' ;
20
21
// This relative file path is extremely particular and for some unknown reason must be exactly this.
21
- const customCommandObject = require ( `../../../cypress/commands/${ filePath . replace (
22
+ const customCommandObject = require ( `../../../${ projectName } cypress/commands/${ filePath . replace (
22
23
commandsDirectory ,
23
24
''
24
25
) } `) ;
You can’t perform that action at this time.
0 commit comments