Skip to content

Commit

Permalink
Fix testrail check stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
schipiga committed Mar 22, 2018
1 parent beffba5 commit f845a22
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions lib/tools.js
Expand Up @@ -128,6 +128,7 @@ self.checkTestrail = cb => {

load();

console.log("TestRail connecting...".yellow);
var testrail = new Testrail({
host: conf.testrail.host,
user: conf.testrail.user,
Expand Down Expand Up @@ -159,35 +160,38 @@ self.checkTestrail = cb => {

if (testrailDups.length) {
noErrors = false;
console.log("TestRail duplicated cases:".magenta);
console.log("\nTestRail duplicated cases:".magenta.bold);
for (t of testrailDups) {
console.log(` - ${t}`.cyan);
console.log(` - ${t}`.cyan.bold);
}
}

var testNames = conf.testCase.map(t => t.name);
var testNames = conf.testCases.map(t => t.name);
var absentTests = _.difference(testrailNames, testNames);
var absentCases = _.difference(testNames, testrailNames);

if (absentTests.length) {
noErrors = false;
console.log("Not implemented TestRail cases:".magenta);
console.log("\nNot implemented TestRail cases:".magenta.bold);
for (t of absentTests) {
console.log(` - ${t}`.cyan);
console.log(` - ${t}`.cyan.bold);
}
}

if (absentCases.length) {
noErrors = false;
console.log("Absent TestRail cases:".magenta);
console.log("\nAbsent TestRail cases:".magenta.bold);
for (t of absentCases) {
console.log(` - ${t}`.cyan);
console.log(` - ${t}`.cyan.bold);
}
}

if (noErrors) {
console.log("TestRail cases correspond current tests");
console.log("TestRail cases correspond current tests".green.bold);
}
console.log(
"\nTestRail suite is",
`${conf.testrail.host}/index.php?/suites/view/${conf.testrail.suiteId}`.yellow);
cb(noErrors ? 0 : 1);
});
};
Expand Down

0 comments on commit f845a22

Please sign in to comment.