Skip to content

Commit e04d7d0

Browse files
Japneet Singh ChawlaJapneet Singh Chawla
authored andcommitted
validations added form api
1 parent f733262 commit e04d7d0

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

commands/run.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module.exports = function (args) {
4949
.sync_args_from_cmd(args)
5050
.then(function (lt_config) {
5151
//validate the config options
52-
validate(lt_config)
52+
validate(lt_config, resp)
5353
.then(function () {
5454
batcher
5555
.make_batches(lt_config)

commands/utils/set_args.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,13 @@ function sync_args_from_cmd(args) {
262262
if (!("downloads" in lt_config["run_settings"])) {
263263
lt_config["run_settings"]["downloads"] = "";
264264
}
265+
//Check for cypress settings
266+
if ("cypress_settings" in args) {
267+
lt_config["run_settings"]["cypress_settings"] = args["cypress_settings"];
268+
} else if (!lt_config["run_settings"]["cypress_settings"]) {
269+
lt_config["run_settings"]["cypress_settings"] = "";
270+
}
271+
265272
//get specs from current directory if specs are not passed in config or cli
266273
if (
267274
(lt_config["run_settings"]["specs"] == undefined ||

commands/utils/validate.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const fs = require("fs");
22
const constants = require("./constants.js");
3-
module.exports = validate_config = function (lt_config) {
3+
module.exports = validate_config = function (lt_config, validation_configs) {
44
return new Promise(function (resolve, reject) {
55
//validate auth keys are present
66
if (
@@ -166,7 +166,9 @@ module.exports = validate_config = function (lt_config) {
166166
let setting_param = "";
167167
for (let i = 0; i < settings.length; i++) {
168168
if (
169-
constants.BLACKLISTED_SETTINGS.includes(settings[i].split(" ")[0])
169+
validation_configs.blacklistCommands.includes(
170+
settings[i].split(" ")[0]
171+
)
170172
) {
171173
settings_flag = false;
172174
setting_param = settings[i].split(" ")[0];

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ const argv = require("yargs")
101101
alias: "exit-on-failure",
102102
describe: "Exit With Code 1 on failure",
103103
type: "string",
104+
})
105+
.option("cy", {
106+
alias: "cypress_settings",
107+
describe: "Pass Cypress Settings",
108+
type: "string",
104109
});
105110
},
106111
function (argv) {

0 commit comments

Comments
 (0)