@reportportal/newman-reporter-agent-js-postman
Advanced tools
Comparing version 5.0.2 to 5.0.3
@@ -17,3 +17,3 @@ /* | ||
const testPatterns = [/[\s]*pm.test\("(.*?)",/, /[\s]*tests\["(.*?)"\]/]; | ||
const testPatterns = [/[\s]*pm.test\("(.*?)",/, /[\s]*pm.test.skip\("(.*?)",/, /[\s]*tests\["(.*?)"\]/]; | ||
const pmVariablesTestCaseIdPatterns = | ||
@@ -20,0 +20,0 @@ [/[\s]*pm.variables.set\("rp.testCaseId", "(.*?)"\)/, /[\s]*pm.variables.set\("rp.testCaseId","(.*?)"\)/]; |
@@ -41,8 +41,10 @@ /* | ||
PASSED: 'PASSED', | ||
FAILED: 'FAILED' | ||
FAILED: 'FAILED', | ||
SKIPPED: 'SKIPPED' | ||
}); | ||
class Reporter { | ||
constructor (emitter, options, collectionRunOptions) { | ||
this.client = new RPClient(utils.getClientInitObject(options), utils.getAgentInfo()); | ||
constructor (emitter, options, collectionRunOptions, rpClient) { | ||
const client = rpClient || RPClient; | ||
this.client = new client(utils.getClientInitObject(options), utils.getAgentInfo()); | ||
this.launchObj = this.client.startLaunch(utils.getStartLaunchObj(options)); | ||
@@ -254,5 +256,14 @@ this.collectionMap = new Map(); | ||
const additionalData = {}; | ||
if (testAssertion.skipped) { | ||
additionalData.status = TestStatus.SKIPPED; | ||
if (this.options.skippedIssue === false) { | ||
additionalData.issue = { issueType: 'NOT_ISSUE' }; | ||
} | ||
} | ||
this.client | ||
.finishTestItem(currentStep.stepId, { | ||
status: currentStep.status || (actualError ? TestStatus.FAILED : TestStatus.PASSED) | ||
status: currentStep.status || (actualError ? TestStatus.FAILED : TestStatus.PASSED), | ||
...additionalData | ||
}) | ||
@@ -339,3 +350,3 @@ .promise.catch(errorHandler); | ||
.finishLaunch(this.launchObj.tempId, { | ||
status: status || (result.run.failures ? TestStatus.FAILED : TestStatus.PASSED) | ||
status: status || ((result.run.failures || []).length ? TestStatus.FAILED : TestStatus.PASSED) | ||
}) | ||
@@ -342,0 +353,0 @@ .promise.catch(errorHandler); |
@@ -121,2 +121,3 @@ /* | ||
mode: options.mode || options.reportportalAgentJsPostmanMode, | ||
skippedIssue: options.skippedIssue || options.reportportalAgentJsPostmanSkippedIssue, | ||
restClientConfig: options.restClientConfig | ||
@@ -123,0 +124,0 @@ }; |
{ | ||
"name": "@reportportal/newman-reporter-agent-js-postman", | ||
"version": "5.0.2", | ||
"version": "5.0.3", | ||
"description": "ReportPortal reporter for newman", | ||
"keywords": [ | ||
"reportportal", | ||
"reporters", | ||
"postman", | ||
"newman", | ||
"epam" | ||
], | ||
"contributors": [ | ||
{ | ||
"name": "Ilya Koshaleu", | ||
"email": "" | ||
} | ||
], | ||
"homepage": "https://github.com/reportportal/agent-js-postman", | ||
"main": "index", | ||
@@ -27,2 +13,22 @@ "author": "ReportPortal.io", | ||
}, | ||
"dependencies": { | ||
"@reportportal/client-javascript": "^5.0.8", | ||
"lodash": "^4.17.21", | ||
"string_decoder": "^1.3.0" | ||
}, | ||
"engines": { | ||
"node": ">=10.x" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^8.35.0", | ||
"eslint-plugin-jsdoc": "^4.8.4", | ||
"eslint-plugin-lodash": "^7.4.0", | ||
"jest": "^27.5.1" | ||
}, | ||
"directories": { | ||
"lib": "lib" | ||
}, | ||
"files": [ | ||
"/lib" | ||
], | ||
"repository": { | ||
@@ -32,22 +38,19 @@ "type": "git", | ||
}, | ||
"dependencies": { | ||
"@reportportal/client-javascript": "^5.0.5", | ||
"lodash": "^4.17.15", | ||
"string_decoder": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^5.16.0", | ||
"eslint-plugin-jsdoc": "^4.8.1", | ||
"eslint-plugin-lodash": "^5.1.0", | ||
"jest": "^25.3.0" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/reportportal/agent-js-postman/issues" | ||
}, | ||
"directories": { | ||
"lib": "lib" | ||
}, | ||
"engines": { | ||
"node": ">= 8.0.x" | ||
} | ||
"homepage": "https://github.com/reportportal/agent-js-postman", | ||
"keywords": [ | ||
"reportportal", | ||
"reporters", | ||
"postman", | ||
"newman", | ||
"epam" | ||
], | ||
"contributors": [ | ||
{ | ||
"name": "Ilya Koshaleu", | ||
"email": "" | ||
} | ||
] | ||
} |
# @reportportal/agent-js-postman | ||
Newman runtime reporter for ReportPortal which provides information about collection run. | ||
[ReportPortal](http://reportportal.io/)<br> | ||
[ReportPortal on GitHub](https://github.com/reportportal) | ||
Agent to integrate Postman (based on Newman collection runner) with ReportPortal. | ||
* More about [Postman](https://www.postman.com/) | ||
* More about [Newman](https://github.com/postmanlabs/newman) | ||
* More about [ReportPortal](http://reportportal.io/) | ||
@@ -74,2 +75,13 @@ ### How to use | ||
); | ||
// To run several collections | ||
// Note, this will create multiple launches that you can merge into one manually via the UI | ||
fs.readdir('./collections_folder_path', (err, files) => { | ||
if (err) { | ||
throw err; | ||
} | ||
files.forEach((file) => { | ||
// setup newman.run() | ||
}); | ||
}); | ||
``` | ||
@@ -92,5 +104,5 @@ | ||
| debug | Determines whether newman's run should be logged in details. | | ||
| mode | Launch mode. Allowable values *DEFAULT* (by default) or *DEBUG*. | ||
| mode | Launch mode. Allowable values *DEFAULT* (by default) or *DEBUG*. | ||
| restClientConfig | The object with `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, may contain other client options eg. `timeout`. | | ||
skippedIssue | *Default: true.* ReportPortal provides feature to mark skipped tests as not 'To Investigate' items on WS side.<br> Parameter could be equal boolean values:<br> *TRUE* - skipped tests considered as issues and will be marked as 'To Investigate' on Report Portal.<br> *FALSE* - skipped tests will not be marked as 'To Investigate' on application. | ||
### Report static attributes | ||
@@ -97,0 +109,0 @@ * To report attributes for suite you should use collection variables. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
202
47964
7
625
1
Updatedlodash@^4.17.21
Updatedstring_decoder@^1.3.0