Skip to content

3.0.9 #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 10, 2023
Merged

3.0.9 #223

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion commands/generate_reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ function generate_report(args) {
if ("reject_unauthorized" in args) {
if (
args["reject_unauthorized"] != "false" &&
args["reject_unauthorized"] != "true"
args["reject_unauthorized"] != "true" &&
args["reject_unauthorized"] != true &&
args["reject_unauthorized"] != false
) {
console.log("reject_unauthorized has to boolean");
return;
Expand Down
13 changes: 13 additions & 0 deletions commands/utils/poller/poller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const poller = require("./build_stats.js");
const async = require("async");
const build_stats = require("./build_stats.js");
const reports = require("../../../commands/generate_reports.js");
var build_result = true;

function poll_build(lt_config, session_id, env) {
Expand Down Expand Up @@ -39,6 +40,18 @@ function poll_build(lt_config, session_id, env) {
}
console.table(status);
console.log(stats);
//Download the artefacts if downloads is passed
if (lt_config.run_settings.downloads != "") {
let args = {
user: lt_config.lambdatest_auth.username,
access_key: lt_config.lambdatest_auth.access_key,
session_id: session_id,
env: env,
reject_unauthorized:
lt_config.run_settings.reject_unauthorized,
};
reports(args);
}
if (
Object.keys(stats).length == 1 &&
(Object.keys(stats).includes("completed") ||
Expand Down
20 changes: 12 additions & 8 deletions commands/utils/set_args.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function sync_args_from_cmd(args) {
process.env.LT_USERNAME
);
lt_config["lambdatest_auth"]["username"] = process.env.LT_USERNAME;
}
}
} else if (
process.env.LT_USERNAME &&
(!("lambdatest_auth" in lt_config) ||
Expand All @@ -41,9 +41,9 @@ function sync_args_from_cmd(args) {
lt_config["lambdatest_auth"] = {};
}
lt_config["lambdatest_auth"]["username"] = process.env.LT_USERNAME;
}else if ("username" in args && args["username"]!=""){
} else if ("username" in args && args["username"] != "") {
lt_config["lambdatest_auth"]["username"] = args["username"];
}
}

if (
"lambdatest_auth" in lt_config &&
Expand All @@ -65,7 +65,7 @@ function sync_args_from_cmd(args) {
}
console.log("Setting access key from environment");
lt_config["lambdatest_auth"]["access_key"] = process.env.LT_ACCESS_KEY;
}else if ("access_key" in args && args["access_key"]!=""){
} else if ("access_key" in args && args["access_key"] != "") {
lt_config["lambdatest_auth"]["access_key"] = args["access_key"];
}

Expand Down Expand Up @@ -375,10 +375,10 @@ function sync_args_from_cmd(args) {
if ("exclude_specs" in lt_config["run_settings"]) {
lt_config["run_settings"]["exclude_specs"] =
lt_config["run_settings"]["exclude_specs"].split(",");
console.log(
"specs to exclude are",
lt_config["run_settings"]["exclude_specs"]
);
console.log(
"specs to exclude are",
lt_config["run_settings"]["exclude_specs"]
);
} else {
lt_config["run_settings"]["exclude_specs"] == [];
}
Expand All @@ -397,6 +397,10 @@ function sync_args_from_cmd(args) {
lt_config.run_settings.npmlpd = false;
}
}
if ("res" in args) {
console.log("resolution set to ", args.res);
lt_config.run_settings.resolution = args.res;
}
//get specs from current directory if specs are not passed in config or cli
if (
(lt_config["run_settings"]["specs"] == undefined ||
Expand Down
40 changes: 25 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,26 @@ const { init } = require("./commands/init");

const argv = require("yargs")
.usage("Usage: $0 <command> [options]")
.command("init", "create an intial config file", function(yargs){
return yargs
.option("cv",{
alias: "cypress-version",
describe: "Cypress version",
type: "int",
})
.option("f",{
alias: "config-file-name",
describe: "Cypress version",
type: "string",
})
}, function (argv) {
require("./commands/init")(argv);
})
.command(
"init",
"create an intial config file",
function (yargs) {
return yargs
.option("cv", {
alias: "cypress-version",
describe: "Cypress version",
type: "int",
})
.option("f", {
alias: "config-file-name",
describe: "Init config file name",
type: "string",
});
},
function (argv) {
require("./commands/init")(argv);
}
)
.command(
"run",
"run tests on lambdatest",
Expand Down Expand Up @@ -169,6 +174,11 @@ const argv = require("yargs")
alias: "vi-project",
describe: "visual ui project name",
type: "string",
})
.option("res", {
alias: "resolution",
describe: "machine resolution",
type: "string",
});
},
function (argv) {
Expand Down
29 changes: 2 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.8",
"version": "3.0.9",
"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