Skip to content

Commit 071f6e7

Browse files
committed
do not allow usage of ip geolocation in conjunction with local mode
1 parent ae9ab92 commit 071f6e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/helpers/capabilityHelper.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ const validate = (bsConfig, args) => {
164164

165165
if( Utils.searchForOption('--async') && ( !Utils.isUndefined(args.async) && bsConfig["connection_settings"]["local"])) reject(Constants.validationMessages.INVALID_LOCAL_ASYNC_ARGS);
166166

167-
if (bsConfig.run_settings.userProvidedGeoLocation && bsConfig.run_settings.geolocation.match(/^[A-Z]{2}$/g)) reject(Constants.validationMessages.INVALID_GEO_LOCATION);
167+
if (bsConfig.run_settings.userProvidedGeoLocation && !bsConfig.run_settings.geolocation.match(/^[A-Z]{2}$/g)) reject(Constants.validationMessages.INVALID_GEO_LOCATION);
168+
169+
if (bsConfig["connection_settings"]["local"] && bsConfig.run_settings.userProvidedGeoLocation) reject(Constants.validationMessages.INVALID_GEO_LOCATION_AND_LOCAL_MODE);
168170

169171
// validate if config file provided exists or not when cypress_config_file provided
170172
// validate the cypressProjectDir key otherwise.

0 commit comments

Comments
 (0)