Skip to content

Commit 1ea3fcb

Browse files
Japneet Singh ChawlaJapneet Singh Chawla
authored andcommitted
CLI validations
1 parent fc278ca commit 1ea3fcb

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

commands/utils/validate.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,27 @@ module.exports = validate_config = function (lt_config, validation_configs) {
243243
) {
244244
reject("Type of stop_on_failure flag is not bool");
245245
}
246+
247+
//Check for browsers and platforms
248+
let browsers = validation_configs.supportedBrowserAlias;
249+
let platforms = validation_configs.supportedPlatformAlias;
250+
for (let i = 0; i < lt_config.browsers.length; i++) {
251+
if (browsers.indexOf(lt_config.browsers[i].browser.toLowerCase()) == -1) {
252+
reject(
253+
"Browser not supported!!! Please pass from following list: " +
254+
validation_configs.supportedBrowsers
255+
);
256+
}
257+
if (
258+
platforms.indexOf(lt_config.browsers[i].platform.toLowerCase()) == -1
259+
) {
260+
reject(
261+
"Platform not supported!!! Please pass from following list: " +
262+
validation_configs.supportedPlatforms
263+
);
264+
}
265+
}
266+
246267
resolve("Validated the Config");
247268
});
248269
};

0 commit comments

Comments
 (0)