Skip to content

Commit

Permalink
Merge pull request #226 from LambdaTest/dev
Browse files Browse the repository at this point in the history
3.0.10
  • Loading branch information
japneetlambdatest authored Feb 9, 2023
2 parents 81c7291 + 3743a88 commit 5ed78d0
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
15 changes: 15 additions & 0 deletions commands/utils/set_args.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ function sync_args_from_cmd(args) {
lt_config["tunnel_settings"]["tunnel_name"] = "";
}

// to avoid passing tunnel name to upstream service if tunnel is false
if (lt_config["tunnel_settings"]["tunnel"]==false){
lt_config["tunnel_settings"]["tunnel_name"]=null
}


//add browsers from cli
if ("browsers" in args) {
browsers = args["browsers"].split(",");
Expand Down Expand Up @@ -401,6 +407,15 @@ function sync_args_from_cmd(args) {
console.log("resolution set to ", args.res);
lt_config.run_settings.resolution = args.res;
}
//Set values for Dedicated proxy
if ("dedicated_proxy" in args) {
lt_config["run_settings"]["dedicated_proxy"] = true
? args["dedicated_proxy"] == "true"
: false;
} else if (!lt_config["run_settings"]["dedicated_proxy"]) {
lt_config["run_settings"]["dedicated_proxy"] = false;
}

//get specs from current directory if specs are not passed in config or cli
if (
(lt_config["run_settings"]["specs"] == undefined ||
Expand Down
21 changes: 21 additions & 0 deletions commands/utils/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,27 @@ module.exports = validate_config = function (lt_config, validation_configs) {
});
}

//validate if dedicated proxy field contains expected value
if ("dedicated_proxy" in lt_config["run_settings"]) {
if (!(typeof lt_config["run_settings"]["dedicated_proxy"] === "boolean")) {
reject("Error!! boolean value is expected in dedicated_proxy key");
}
}

//validate if dedicatedproxy and tunnel are not passed simultaniously
if (lt_config["run_settings"]["dedicated_proxy"]==true && lt_config["run_settings"]["geo_location"] !=""){
reject("Error!! Dedicated Proxy and Geolocation can not be passed in same run")
}
//validate if tunnel and geo are not passed simultaniously
if (lt_config["tunnel_settings"]["tunnel"]==true && lt_config["run_settings"]["geo_location"] !=""){
reject("Error!! Tunnel and Geolocation can not be passed in same run")
}
//validate if dedicatedproxy and geo are not passed simultaniously
if (lt_config["tunnel_settings"]["tunnel"]==true && lt_config["run_settings"]["dedicated_proxy"]==true){
reject("Error!! Tunnel and Dedicated Proxy can not be passed in same run")
}

if(lt_config)
resolve(cypress_version);
});
};
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ const argv = require("yargs")
alias: "resolution",
describe: "machine resolution",
type: "string",
})
.option("dp", {
alias: "dedicated_proxy",
describe: "dedicated proxy",
type: "bool",
});
},
function (argv) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lambdatest-cypress-cli",
"version": "3.0.9",
"version": "3.0.10",
"description": "The lambdatest-cypress-cli is LambdaTest's command-line interface (CLI) aimed to help you run your Cypress tests on LambdaTest platform.",
"homepage": "https://github.com/LambdaTest/lambdatest-cypress-cli",
"author": "LambdaTest <[email protected]>",
Expand Down

0 comments on commit 5ed78d0

Please sign in to comment.