Skip to content

Commit 9003abf

Browse files
Merge pull request #149 from LambdaTest/master
Back sync
2 parents 242b31f + f77eebb commit 9003abf

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

commands/utils/set_args.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,21 @@ function sync_args_from_cmd(args) {
280280
} else if (!lt_config["run_settings"]["stop_on_failure"]) {
281281
lt_config["run_settings"]["stop_on_failure"] = false;
282282
}
283-
283+
if (
284+
lt_config.run_settings.project_name &&
285+
!lt_config.run_settings.project_key
286+
) {
287+
lt_config.run_settings.project_key = lt_config.run_settings.project_name;
288+
}
289+
if (
290+
!lt_config.run_settings.project_name &&
291+
lt_config.run_settings.project_key
292+
) {
293+
lt_config.run_settings.project_name = lt_config.run_settings.project_key;
294+
}
295+
if (lt_config.run_settings.project_autocreate == undefined) {
296+
lt_config.run_settings.project_autocreate = true;
297+
}
284298
//get specs from current directory if specs are not passed in config or cli
285299
if (
286300
(lt_config["run_settings"]["specs"] == undefined ||

commands/utils/validate.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,25 @@ module.exports = validate_config = function (lt_config, validation_configs) {
244244
reject("Type of stop_on_failure flag is not bool");
245245
}
246246

247+
//Check for project capability
248+
if (
249+
lt_config.run_settings.project_name &&
250+
lt_config.run_settings.project_key
251+
) {
252+
if (lt_config.run_settings.project_name == "") {
253+
reject("Project name can not blank");
254+
}
255+
if (lt_config.run_settings.project_name == "") {
256+
reject("Project key can not blank");
257+
}
258+
}
259+
if (
260+
lt_config.run_settings.project_autocreate &&
261+
typeof lt_config.run_settings.project_autocreate != "boolean"
262+
) {
263+
reject("Type of project_autocreate capability is not bool");
264+
}
265+
247266
//Check for browsers and platforms
248267
let browsers = validation_configs.supportedBrowserAlias;
249268
let platforms = validation_configs.supportedPlatformAlias;

0 commit comments

Comments
 (0)