Skip to content

Commit f69335e

Browse files
committed
added changes for build tags
1 parent cce1a30 commit f69335e

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

bin/helpers/constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ const cliMessages = {
153153
RECORD: "Pass the --record flag to record your Cypress runs on Cypress.io dashboard. Note: You also need to specify '--record-key' and '--projectId' arguments either in CLI or in browserstack.json.",
154154
RECORD_KEY: "You can specify the 'key' that is needed to record your runs on Cypress.io dashboard using the '--record-key' argument. Alternatively, you can also pass it on browserstack.json",
155155
PROJECT_ID: "You can pass the 'projectId' of your Cypress.io project where you want to record your runs if specifying the '--record' key. You can also specify this in your cypress.json or in your browserstack.json.",
156-
NODE_VERSION: "Pass the node version that you want BrowserStack to use to run your Cypress tests on."
156+
NODE_VERSION: "Pass the node version that you want BrowserStack to use to run your Cypress tests on.",
157+
BUILD_TAG: "Add a tag to your build to filter builds based on tag values on the Dashboard."
157158
},
158159
COMMON: {
159160
DISABLE_USAGE_REPORTING: "Disable usage reporting",

bin/helpers/utils.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,17 @@ exports.setTestEnvs = (bsConfig, args) => {
445445
}
446446

447447
exports.setBuildTags = (bsConfig, args) => {
448-
if(!this.isUndefined(args.buildTag)) {
449-
bsConfig.run_settings.build_tag = args.buildTag;
448+
let buildTag = undefined;
449+
if(!this.isUndefined(args["build-tag"])) {
450+
buildTag = args["build-tag"];
451+
} else {
452+
buildTag = bsConfig.run_settings.build_tag;
453+
}
454+
if(!this.isUndefined(buildTag)) {
455+
buildTag = buildTag.toString();
450456
}
451-
logger.debug(`Setting build tag = ${bsConfig.run_settings.build_tag}`);
457+
bsConfig.run_settings.build_tag = buildTag;
458+
logger.debug(`Setting the build tag = ${bsConfig.run_settings.build_tag}`);
452459
};
453460

454461
exports.setSystemEnvs = (bsConfig) => {

bin/runner.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ var argv = yargs
271271
default: undefined,
272272
describe: Constants.cliMessages.RUN.NODE_VERSION,
273273
type: "string"
274+
},
275+
'build-tag': {
276+
default: undefined,
277+
describe: Constants.cliMessages.RUN.BUILD_TAG,
278+
type: "string"
274279
}
275280
})
276281
.help('help')

0 commit comments

Comments
 (0)