diff --git a/commands/utils/set_args.js b/commands/utils/set_args.js index 6d70fb6..258443e 100644 --- a/commands/utils/set_args.js +++ b/commands/utils/set_args.js @@ -461,6 +461,13 @@ function sync_args_from_cmd(args) { lt_config["run_settings"]["timezone"] = ""; } + //Check for region + if ("region" in args) { + lt_config["run_settings"]["region"] = args["region"]; + } else if (!lt_config["run_settings"]["region"]) { + lt_config["run_settings"]["region"] = ""; + } + if ("privateCloud" in args) { if (args["privateCloud"]=="true"){ lt_config["run_settings"]["privateCloud"] = true; diff --git a/commands/utils/validate.js b/commands/utils/validate.js index dc5d908..95310bc 100644 --- a/commands/utils/validate.js +++ b/commands/utils/validate.js @@ -205,6 +205,17 @@ module.exports = validate_config = function (lt_config, validation_configs) { } } + //validate if region field contains expected value + if ("region" in lt_config["run_settings"]) { + if ( + !( + typeof lt_config["run_settings"]["region"] === "string" + ) + ) { + reject("Error!! string value is expected in region key"); + } + } + //validate if accessibility field contains expected value if ("accessibility" in lt_config["run_settings"]) { if (![true, false].includes(lt_config["run_settings"]["accessibility"])) { diff --git a/index.js b/index.js index d573084..4df7f85 100644 --- a/index.js +++ b/index.js @@ -261,6 +261,11 @@ const argv = require("yargs") describe: "Set custom timezone in machine for cypress.", type: "string", }) + .option("reg",{ + alias: "region", + describe: "Set data center region (e.g., us, eu, ap)", + type: "string", + }) .option("pC",{ alias: "privateCloud", describe: "Set custom private Cloud", diff --git a/package.json b/package.json index 4b4678e..5261d80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lambdatest-cypress-cli", - "version": "3.0.43", + "version": "3.0.44", "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 ",