Skip to content

Commit b8e9649

Browse files
Merge pull request #651 from browserstack/modify_cypress_geolocation_regex
Modify validations for geolocation to support state codes
2 parents da4a96e + 6f5c86c commit b8e9649

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/helpers/capabilityHelper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ const validate = (bsConfig, args) => {
183183

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

186-
if (bsConfig.run_settings.userProvidedGeolocation && !bsConfig.run_settings.geolocation.match(/^[A-Z]{2}$/g)) reject(Constants.validationMessages.INVALID_GEO_LOCATION);
186+
if (bsConfig.run_settings.userProvidedGeolocation && !bsConfig.run_settings.geolocation.match(/^[A-Z]{2}(-[A-Z0-9]{2,3})?$/g)) reject(Constants.validationMessages.INVALID_GEO_LOCATION);
187187

188188
if (bsConfig["connection_settings"]["local"] && bsConfig.run_settings.userProvidedGeolocation) reject(Constants.validationMessages.NOT_ALLOWED_GEO_LOCATION_AND_LOCAL_MODE);
189189

0 commit comments

Comments
 (0)