Skip to content

Commit b2761d5

Browse files
authored
Merge pull request #219 from japneetlambdatest/CYP-571
[CYP-571] Resolution support added
2 parents e610f86 + 168d0f5 commit b2761d5

File tree

2 files changed

+37
-23
lines changed

2 files changed

+37
-23
lines changed

commands/utils/set_args.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function sync_args_from_cmd(args) {
2727
process.env.LT_USERNAME
2828
);
2929
lt_config["lambdatest_auth"]["username"] = process.env.LT_USERNAME;
30-
}
30+
}
3131
} else if (
3232
process.env.LT_USERNAME &&
3333
(!("lambdatest_auth" in lt_config) ||
@@ -41,9 +41,9 @@ function sync_args_from_cmd(args) {
4141
lt_config["lambdatest_auth"] = {};
4242
}
4343
lt_config["lambdatest_auth"]["username"] = process.env.LT_USERNAME;
44-
}else if ("username" in args && args["username"]!=""){
44+
} else if ("username" in args && args["username"] != "") {
4545
lt_config["lambdatest_auth"]["username"] = args["username"];
46-
}
46+
}
4747

4848
if (
4949
"lambdatest_auth" in lt_config &&
@@ -65,7 +65,7 @@ function sync_args_from_cmd(args) {
6565
}
6666
console.log("Setting access key from environment");
6767
lt_config["lambdatest_auth"]["access_key"] = process.env.LT_ACCESS_KEY;
68-
}else if ("access_key" in args && args["access_key"]!=""){
68+
} else if ("access_key" in args && args["access_key"] != "") {
6969
lt_config["lambdatest_auth"]["access_key"] = args["access_key"];
7070
}
7171

@@ -375,10 +375,10 @@ function sync_args_from_cmd(args) {
375375
if ("exclude_specs" in lt_config["run_settings"]) {
376376
lt_config["run_settings"]["exclude_specs"] =
377377
lt_config["run_settings"]["exclude_specs"].split(",");
378-
console.log(
379-
"specs to exclude are",
380-
lt_config["run_settings"]["exclude_specs"]
381-
);
378+
console.log(
379+
"specs to exclude are",
380+
lt_config["run_settings"]["exclude_specs"]
381+
);
382382
} else {
383383
lt_config["run_settings"]["exclude_specs"] == [];
384384
}
@@ -397,6 +397,10 @@ function sync_args_from_cmd(args) {
397397
lt_config.run_settings.npmlpd = false;
398398
}
399399
}
400+
if ("res" in args) {
401+
console.log("resolution set to ", args.res);
402+
lt_config.run_settings.resolution = args.res;
403+
}
400404
//get specs from current directory if specs are not passed in config or cli
401405
if (
402406
(lt_config["run_settings"]["specs"] == undefined ||

index.js

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,26 @@ const { init } = require("./commands/init");
44

55
const argv = require("yargs")
66
.usage("Usage: $0 <command> [options]")
7-
.command("init", "create an intial config file", function(yargs){
8-
return yargs
9-
.option("cv",{
10-
alias: "cypress-version",
11-
describe: "Cypress version",
12-
type: "int",
13-
})
14-
.option("f",{
15-
alias: "config-file-name",
16-
describe: "Cypress version",
17-
type: "string",
18-
})
19-
}, function (argv) {
20-
require("./commands/init")(argv);
21-
})
7+
.command(
8+
"init",
9+
"create an intial config file",
10+
function (yargs) {
11+
return yargs
12+
.option("cv", {
13+
alias: "cypress-version",
14+
describe: "Cypress version",
15+
type: "int",
16+
})
17+
.option("f", {
18+
alias: "config-file-name",
19+
describe: "Cypress version",
20+
type: "string",
21+
});
22+
},
23+
function (argv) {
24+
require("./commands/init")(argv);
25+
}
26+
)
2227
.command(
2328
"run",
2429
"run tests on lambdatest",
@@ -169,6 +174,11 @@ const argv = require("yargs")
169174
alias: "vi-project",
170175
describe: "visual ui project name",
171176
type: "string",
177+
})
178+
.option("res", {
179+
alias: "resolution",
180+
describe: "machine resolution",
181+
type: "string",
172182
});
173183
},
174184
function (argv) {

0 commit comments

Comments
 (0)