Skip to content

Commit 54dcd73

Browse files
add region capability
1 parent b1eccb0 commit 54dcd73

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

commands/utils/set_args.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,13 @@ function sync_args_from_cmd(args) {
461461
lt_config["run_settings"]["timezone"] = "";
462462
}
463463

464+
//Check for region
465+
if ("region" in args) {
466+
lt_config["run_settings"]["region"] = args["region"];
467+
} else if (!lt_config["run_settings"]["region"]) {
468+
lt_config["run_settings"]["region"] = "";
469+
}
470+
464471
if ("privateCloud" in args) {
465472
if (args["privateCloud"]=="true"){
466473
lt_config["run_settings"]["privateCloud"] = true;

commands/utils/validate.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,17 @@ module.exports = validate_config = function (lt_config, validation_configs) {
205205
}
206206
}
207207

208+
//validate if region field contains expected value
209+
if ("region" in lt_config["run_settings"]) {
210+
if (
211+
!(
212+
typeof lt_config["run_settings"]["region"] === "string"
213+
)
214+
) {
215+
reject("Error!! string value is expected in region key");
216+
}
217+
}
218+
208219
//validate if accessibility field contains expected value
209220
if ("accessibility" in lt_config["run_settings"]) {
210221
if (![true, false].includes(lt_config["run_settings"]["accessibility"])) {

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@ const argv = require("yargs")
261261
describe: "Set custom timezone in machine for cypress.",
262262
type: "string",
263263
})
264+
.option("reg",{
265+
alias: "region",
266+
describe: "Set data center region (e.g., us, eu)",
267+
type: "string",
268+
})
264269
.option("pC",{
265270
alias: "privateCloud",
266271
describe: "Set custom private Cloud",

0 commit comments

Comments
 (0)