Skip to content

Commit 81c7291

Browse files
Merge pull request #223 from LambdaTest/dev
3.0.9
2 parents 1b7e064 + 9d982dc commit 81c7291

File tree

6 files changed

+56
-52
lines changed

6 files changed

+56
-52
lines changed

commands/generate_reports.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ function generate_report(args) {
150150
if ("reject_unauthorized" in args) {
151151
if (
152152
args["reject_unauthorized"] != "false" &&
153-
args["reject_unauthorized"] != "true"
153+
args["reject_unauthorized"] != "true" &&
154+
args["reject_unauthorized"] != true &&
155+
args["reject_unauthorized"] != false
154156
) {
155157
console.log("reject_unauthorized has to boolean");
156158
return;

commands/utils/poller/poller.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const poller = require("./build_stats.js");
22
const async = require("async");
33
const build_stats = require("./build_stats.js");
4+
const reports = require("../../../commands/generate_reports.js");
45
var build_result = true;
56

67
function poll_build(lt_config, session_id, env) {
@@ -39,6 +40,18 @@ function poll_build(lt_config, session_id, env) {
3940
}
4041
console.table(status);
4142
console.log(stats);
43+
//Download the artefacts if downloads is passed
44+
if (lt_config.run_settings.downloads != "") {
45+
let args = {
46+
user: lt_config.lambdatest_auth.username,
47+
access_key: lt_config.lambdatest_auth.access_key,
48+
session_id: session_id,
49+
env: env,
50+
reject_unauthorized:
51+
lt_config.run_settings.reject_unauthorized,
52+
};
53+
reports(args);
54+
}
4255
if (
4356
Object.keys(stats).length == 1 &&
4457
(Object.keys(stats).includes("completed") ||

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: "Init config file name",
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) {

package-lock.json

Lines changed: 2 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lambdatest-cypress-cli",
3-
"version": "3.0.8",
3+
"version": "3.0.9",
44
"description": "The lambdatest-cypress-cli is LambdaTest's command-line interface (CLI) aimed to help you run your Cypress tests on LambdaTest platform.",
55
"homepage": "https://github.com/LambdaTest/lambdatest-cypress-cli",
66
"author": "LambdaTest <keys@lambdatest.com>",

0 commit comments

Comments
 (0)