@sum.cumo/cypress-testrail-reporter
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -23,2 +23,3 @@ import { TestrailReporterConfig, TestRailCypressResults, TestRailReference, TestRailRun } from '../types'; | ||
findOrCreateRunByName(runs: TestRailRun[]): Promise<TestRailRun>; | ||
private findOrCreateRun; | ||
private addResultsForCases; | ||
@@ -25,0 +26,0 @@ private addAttachmentsToTestRun; |
@@ -111,16 +111,21 @@ "use strict"; | ||
} | ||
addResultsForCases(closeRun) { | ||
findOrCreateRun() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
return this.client | ||
.getRuns(this.config.projectId) | ||
.then((response) => response.data) | ||
.then(this.findOrCreateRunByName.bind(this)) | ||
.catch(this.onError); | ||
} | ||
catch (e) { | ||
throw new Error(e); | ||
} | ||
}); | ||
} | ||
addResultsForCases() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (this.shouldPostResults()) { | ||
// Fetch Runs from testrail | ||
try { | ||
this.currentRun = yield this.client | ||
.getRuns(this.config.projectId) | ||
.then((response) => response.data) | ||
.then(this.findOrCreateRunByName.bind(this)) | ||
.catch(this.onError); | ||
} | ||
catch (e) { | ||
throw new Error(e); | ||
} | ||
this.currentRun = yield this.findOrCreateRun(); | ||
// Do we have a valid run? | ||
@@ -139,7 +144,2 @@ if (this.currentRun && this.currentRun.id) { | ||
} | ||
if (closeRun) { | ||
printer_1.default('Close RUN'); | ||
yield this.closeTestrailRun(); | ||
} | ||
return true; | ||
} | ||
@@ -171,3 +171,3 @@ catch (e) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield this.addResultsForCases(closeRun); | ||
yield this.addResultsForCases(); | ||
yield this.addAttachmentsToTestRun(attachments); | ||
@@ -177,2 +177,6 @@ if (assets.length > 0 && assetsArchiveName) { | ||
} | ||
if (closeRun) { | ||
printer_1.default('Close RUN'); | ||
yield this.closeTestrailRun(); | ||
} | ||
}); | ||
@@ -179,0 +183,0 @@ } |
{ | ||
"name": "@sum.cumo/cypress-testrail-reporter", | ||
"description": "Parse and Post your cypress results to testrail", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"bin": { | ||
@@ -6,0 +6,0 @@ "cypress-testrail-reporter": "dist/index.js" |
43890
684