Skip to content

Commit 006ab64

Browse files
authored
Merge pull request #98 from browserstack/move_cyp_version
Move Cypress version into run_settings
2 parents 962f7ff + f279883 commit 006ab64

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

bin/commands/runs.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ module.exports = function run(args) {
6868
logger.warn(Constants.userMessages.NO_PARALLELS);
6969
}
7070

71-
if (bsConfig.cypress_version && bsConfig.cypress_version !== data.cypress_version) {
72-
let versionMessage = utils.versionChangedMessage(bsConfig.cypress_version, data.cypress_version)
71+
if (bsConfig.run_settings.cypress_version && bsConfig.run_settings.cypress_version !== data.cypress_version) {
72+
let versionMessage = utils.versionChangedMessage(bsConfig.run_settings.cypress_version, data.cypress_version)
7373
logger.warn(versionMessage);
7474
}
7575

bin/helpers/capabilityHelper.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,11 @@ const caps = (bsConfig, zip) => {
8181
if (!Utils.isUndefined(bsConfig.run_settings.env)){
8282
obj.env = bsConfig.run_settings.env;
8383
}
84+
if (!Utils.isUndefined(bsConfig.run_settings.cypress_version)){
85+
obj.cypress_version = bsConfig.run_settings.cypress_version;
86+
}
8487
}
8588

86-
if (bsConfig.cypress_version) obj.cypress_version = bsConfig.cypress_version;
87-
8889
if(obj.parallels === Constants.cliMessages.RUN.DEFAULT_PARALLEL_MESSAGE) obj.parallels = undefined
8990

9091
if (obj.project) logger.log(`Project name is: ${obj.project}`);

test/unit/bin/helpers/capabilityHelper.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ describe("capabilityHelper.js", () => {
5959
versions: ["78", "77"],
6060
},
6161
],
62-
cypress_version: cypress_version,
62+
run_settings: {
63+
cypress_version: cypress_version
64+
},
6365
connection_settings: {
6466
local: true
6567
}
@@ -113,6 +115,9 @@ describe("capabilityHelper.js", () => {
113115
versions: ["78", "77"],
114116
},
115117
],
118+
run_settings: {
119+
cypress_version: "cypress_version"
120+
},
116121
connection_settings: {
117122
local: true
118123
}

0 commit comments

Comments
 (0)