better-cypress-testrail-reporter
Advanced tools
Comparing version 1.3.10 to 1.3.11
@@ -35,3 +35,2 @@ "use strict"; | ||
_this.suiteId = []; | ||
_this.serverTestCaseIds = []; | ||
_this.reporterOptions = options.reporterOptions; | ||
@@ -76,3 +75,2 @@ if (process.env.CYPRESS_TESTRAIL_REPORTER_USERNAME) { | ||
runner.on('start', function () { | ||
_this.serverTestCaseIds = _this.testRailApi.getCases(_this.suiteId); | ||
/** | ||
@@ -166,6 +164,2 @@ * runCounter is used to count how many spec files we have during one run | ||
var caseIds = (0, shared_1.titleToCaseIds)(test.title); | ||
var invalidCaseIds = caseIds.filter(function (caseId) { return !_this.serverTestCaseIds.includes(caseId); }); | ||
caseIds = caseIds.filter(function (caseId) { return _this.serverTestCaseIds.includes(caseId); }); | ||
if (invalidCaseIds.length > 0) | ||
TestRailLogger.log("The following test IDs were found in Cypress tests, but not found in Testrail: " + invalidCaseIds); | ||
if (caseIds.length) { | ||
@@ -172,0 +166,0 @@ var caseResults = caseIds.map(function (caseId) { |
@@ -86,33 +86,4 @@ "use strict"; | ||
}; | ||
TestRail.prototype.getCases = function (suiteId) { | ||
var url = this.base + "/get_cases/" + this.options.projectId + "&suite_id=" + suiteId; | ||
if (this.options.groupId) { | ||
url += "§ion_id=" + this.options.groupId; | ||
} | ||
if (this.options.filter) { | ||
url += "&filter=" + this.options.filter; | ||
} | ||
if (this.options.typeId) { | ||
url += "&type_id=" + this.options.typeId; | ||
} | ||
return this.makeSync(axios({ | ||
method: 'get', | ||
url: url, | ||
headers: { 'Content-Type': 'application/json' }, | ||
auth: { | ||
username: this.options.username, | ||
password: this.options.password | ||
} | ||
}) | ||
.then(function (response) { | ||
return response.data.cases.map(function (item) { return item.id; }); | ||
}) | ||
.catch(function (error) { return console.error(error); })); | ||
}; | ||
TestRail.prototype.createRun = function (name, description, suiteId) { | ||
var _this = this; | ||
if (this.options.includeAllInTestRun === false) { | ||
this.includeAll = false; | ||
this.caseIds = this.getCases(suiteId); | ||
} | ||
this.makeSync(axios({ | ||
@@ -119,0 +90,0 @@ method: 'post', |
{ | ||
"name": "better-cypress-testrail-reporter", | ||
"version": "1.3.10", | ||
"version": "1.3.11", | ||
"description": "A Testrail reporter for cypress including TestRail API basic library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
34361
565