@@ -197,24 +197,26 @@ const validate = (bsConfig, args) => {
197
197
198
198
logger . debug ( `Validating ${ bsConfig . run_settings . cypress_config_filename } ` ) ;
199
199
try {
200
- if ( bsConfig . run_settings . cypressTestSuiteType === Constants . CYPRESS_V10_AND_ABOVE_TYPE ) {
201
- const completeCypressConfigFile = readCypressConfigFile ( bsConfig )
202
- if ( ! Utils . isUndefined ( completeCypressConfigFile ) ) {
203
- // check if cypress config was exported using export default
204
- cypressConfigFile = ! Utils . isUndefined ( completeCypressConfigFile . default ) ? completeCypressConfigFile . default : completeCypressConfigFile
205
- }
200
+ if ( bsConfig . run_settings . cypress_config_filename !== 'false' ) {
201
+ if ( bsConfig . run_settings . cypressTestSuiteType === Constants . CYPRESS_V10_AND_ABOVE_TYPE ) {
202
+ const completeCypressConfigFile = readCypressConfigFile ( bsConfig )
203
+ if ( ! Utils . isUndefined ( completeCypressConfigFile ) ) {
204
+ // check if cypress config was exported using export default
205
+ cypressConfigFile = ! Utils . isUndefined ( completeCypressConfigFile . default ) ? completeCypressConfigFile . default : completeCypressConfigFile
206
+ }
206
207
207
- // TODO: add validations for cypress_config_filename
208
- } else {
209
- let cypressJsonContent = fs . readFileSync ( cypressConfigFilePath ) ;
210
- cypressConfigFile = JSON . parse ( cypressJsonContent ) ;
211
- }
208
+ // TODO: add validations for cypress_config_filename
209
+ } else {
210
+ let cypressJsonContent = fs . readFileSync ( cypressConfigFilePath ) ;
211
+ cypressConfigFile = JSON . parse ( cypressJsonContent ) ;
212
+ }
212
213
213
- // Cypress Json Base Url & Local true check
214
- if ( ! Utils . isUndefined ( cypressConfigFile . baseUrl ) && cypressConfigFile . baseUrl . includes ( "localhost" ) && ! Utils . getLocalFlag ( bsConfig . connection_settings ) ) reject ( Constants . validationMessages . LOCAL_NOT_SET . replace ( "<baseUrlValue>" , cypressConfigFile . baseUrl ) ) ;
214
+ // Cypress Json Base Url & Local true check
215
+ if ( ! Utils . isUndefined ( cypressConfigFile . baseUrl ) && cypressConfigFile . baseUrl . includes ( "localhost" ) && ! Utils . getLocalFlag ( bsConfig . connection_settings ) ) reject ( Constants . validationMessages . LOCAL_NOT_SET . replace ( "<baseUrlValue>" , cypressConfigFile . baseUrl ) ) ;
215
216
216
- // Detect if the user is not using the right directory structure, and throw an error
217
- if ( ! Utils . isUndefined ( cypressConfigFile . integrationFolder ) && ! Utils . isCypressProjDirValid ( bsConfig . run_settings . cypressProjectDir , cypressConfigFile . integrationFolder ) ) reject ( Constants . validationMessages . INCORRECT_DIRECTORY_STRUCTURE ) ;
217
+ // Detect if the user is not using the right directory structure, and throw an error
218
+ if ( ! Utils . isUndefined ( cypressConfigFile . integrationFolder ) && ! Utils . isCypressProjDirValid ( bsConfig . run_settings . cypressProjectDir , cypressConfigFile . integrationFolder ) ) reject ( Constants . validationMessages . INCORRECT_DIRECTORY_STRUCTURE ) ;
219
+ }
218
220
} catch ( error ) {
219
221
reject ( Constants . validationMessages . INVALID_CYPRESS_JSON )
220
222
}
0 commit comments