Skip to content

Commit

Permalink
Merge pull request #98 from browserstack/move_cyp_version
Browse files Browse the repository at this point in the history
Move Cypress version into run_settings
  • Loading branch information
SagarGaniga authored Dec 8, 2020
2 parents 962f7ff + f279883 commit 006ab64
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bin/commands/runs.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ module.exports = function run(args) {
logger.warn(Constants.userMessages.NO_PARALLELS);
}

if (bsConfig.cypress_version && bsConfig.cypress_version !== data.cypress_version) {
let versionMessage = utils.versionChangedMessage(bsConfig.cypress_version, data.cypress_version)
if (bsConfig.run_settings.cypress_version && bsConfig.run_settings.cypress_version !== data.cypress_version) {
let versionMessage = utils.versionChangedMessage(bsConfig.run_settings.cypress_version, data.cypress_version)
logger.warn(versionMessage);
}

Expand Down
5 changes: 3 additions & 2 deletions bin/helpers/capabilityHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ const caps = (bsConfig, zip) => {
if (!Utils.isUndefined(bsConfig.run_settings.env)){
obj.env = bsConfig.run_settings.env;
}
if (!Utils.isUndefined(bsConfig.run_settings.cypress_version)){
obj.cypress_version = bsConfig.run_settings.cypress_version;
}
}

if (bsConfig.cypress_version) obj.cypress_version = bsConfig.cypress_version;

if(obj.parallels === Constants.cliMessages.RUN.DEFAULT_PARALLEL_MESSAGE) obj.parallels = undefined

if (obj.project) logger.log(`Project name is: ${obj.project}`);
Expand Down
7 changes: 6 additions & 1 deletion test/unit/bin/helpers/capabilityHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ describe("capabilityHelper.js", () => {
versions: ["78", "77"],
},
],
cypress_version: cypress_version,
run_settings: {
cypress_version: cypress_version
},
connection_settings: {
local: true
}
Expand Down Expand Up @@ -113,6 +115,9 @@ describe("capabilityHelper.js", () => {
versions: ["78", "77"],
},
],
run_settings: {
cypress_version: "cypress_version"
},
connection_settings: {
local: true
}
Expand Down

0 comments on commit 006ab64

Please sign in to comment.