From c4609532f961dc98caddb365e8fa527bb680f925 Mon Sep 17 00:00:00 2001 From: hariharanbrowserstack Date: Mon, 11 Dec 2023 18:16:41 +0530 Subject: [PATCH 1/2] Fix Specs Array Case for Enforce_Settings MAC --- bin/helpers/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/helpers/utils.js b/bin/helpers/utils.js index cff2f06b..11f7c52a 100644 --- a/bin/helpers/utils.js +++ b/bin/helpers/utils.js @@ -1327,7 +1327,7 @@ exports.setEnforceSettingsConfig = (bsConfig) => { if(specConfigs && specConfigs.includes(',')) { specConfigs = JSON.stringify(specConfigs.split(',')); } - let spec_pattern_args = 'specPattern="'+specConfigs+'"'; + let spec_pattern_args = `specPattern=${specConfigs}`; config_args = this.isUndefined(config_args) ? spec_pattern_args : config_args + ',' + spec_pattern_args; } if ( this.isNotUndefined(config_args) ) bsConfig["run_settings"]["config"] = config_args; From e12b0431311427dd04bf2d0c28d22060459320ce Mon Sep 17 00:00:00 2001 From: hariharanbrowserstack Date: Mon, 11 Dec 2023 18:33:14 +0530 Subject: [PATCH 2/2] Fix UT --- test/unit/bin/helpers/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/bin/helpers/utils.js b/test/unit/bin/helpers/utils.js index eebf5b14..a52e7b11 100644 --- a/test/unit/bin/helpers/utils.js +++ b/test/unit/bin/helpers/utils.js @@ -3107,7 +3107,7 @@ describe('utils', () => { run_settings: { specs: 'somerandomspecs', cypressTestSuiteType: 'CYPRESS_V10_AND_ABOVE_TYPE' }, }; let args = { - config: 'video=false,videoUploadOnPasses=false,specPattern="somerandomspecs"' + config: 'video=false,videoUploadOnPasses=false,specPattern=somerandomspecs' } utils.setEnforceSettingsConfig(bsConfig); expect(args.config).to.be.eql(bsConfig.run_settings.config); @@ -3117,7 +3117,7 @@ describe('utils', () => { run_settings: { specs: 'somerandomspecs1,somerandomspecs2', cypressTestSuiteType: 'CYPRESS_V10_AND_ABOVE_TYPE' }, }; let args = { - config: 'video=false,videoUploadOnPasses=false,specPattern="["somerandomspecs1","somerandomspecs2"]"' + config: 'video=false,videoUploadOnPasses=false,specPattern=["somerandomspecs1","somerandomspecs2"]' } utils.setEnforceSettingsConfig(bsConfig); expect(args.config).to.be.eql(bsConfig.run_settings.config);