newman-parallel
Advanced tools
Comparing version
@@ -0,0 +0,0 @@ #!/usr/bin/env node |
{ | ||
"name": "newman-parallel", | ||
"version": "1.0.12", | ||
"version": "1.0.14", | ||
"description": "A framework to execute multiple Postman collections in parallel run with Newman.Includes Allure, HTML-extra and Junit reporters integrations", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,0 +0,0 @@ # Newman Parallel |
@@ -169,29 +169,36 @@ const async = require('async') | ||
} | ||
const collectionToRun = collections.map(collection => { | ||
// @ts-ignore | ||
const file_name = collection | ||
.split('/') | ||
.at(-1) | ||
.replace('.postman_collection.json', `_${env}`) | ||
return { | ||
collection: collection, | ||
environment: environment, | ||
insecure: true, | ||
iterationData: data, | ||
reporters: NewmanRunner.NEWMAN_REPORT_OPTIONS, | ||
reporter: { | ||
htmlextra: { | ||
export: `${NewmanRunner.NEWMAN_REPORT_PATH}${file_name}.html` | ||
}, | ||
junitfull: { | ||
export: `${NewmanRunner.NEWMAN_REPORT_PATH}${file_name}.xml` | ||
}, | ||
'@felipecrs/allure': { | ||
collectionAsParentSuite: true, | ||
export: NewmanRunner.ALLURE_REPORT_PATH | ||
let collectionsToRun | ||
try { | ||
collectionsToRun = collections.map(collection => { | ||
// @ts-ignore | ||
const file_name = collection | ||
.split('/') | ||
.at(-1) | ||
.replace('.postman_collection.json', `_${env}`) | ||
return { | ||
collection: collection, | ||
environment: environment, | ||
insecure: true, | ||
iterationData: data, | ||
reporters: NewmanRunner.NEWMAN_REPORT_OPTIONS, | ||
reporter: { | ||
htmlextra: { | ||
export: `${NewmanRunner.NEWMAN_REPORT_PATH}${file_name}.html` | ||
}, | ||
junitfull: { | ||
export: `${NewmanRunner.NEWMAN_REPORT_PATH}${file_name}.xml` | ||
}, | ||
'@felipecrs/allure': { | ||
collectionAsParentSuite: true, | ||
export: NewmanRunner.ALLURE_REPORT_PATH | ||
} | ||
} | ||
} | ||
} | ||
}) | ||
NewmanRunner.counter = collectionToRun.length | ||
}) | ||
NewmanRunner.counter = collectionsToRun.length | ||
} catch (err) { | ||
console.error(`Error parsing collection names from folder ${args[0]}`) | ||
console.log(`Files in folder: ${collections}`) | ||
process.exit() | ||
} | ||
@@ -205,5 +212,5 @@ /** | ||
const parallelCollectionRun = function (done) { | ||
for (let index = 0; index < collectionToRun.length; index++) { | ||
for (let index = 0; index < collectionsToRun.length; index++) { | ||
newman | ||
.run(collectionToRun[index], function (err) { | ||
.run(collectionsToRun[index], function (err) { | ||
if (err) { | ||
@@ -225,4 +232,16 @@ throw err | ||
'npx allure generate --clean && npx allure-patch ./allure-report && rm -r ./allure-results' | ||
exec(createHistory) | ||
exec(generateReport) | ||
exec(createHistory, (error, stdout, stderr) => { | ||
console.log(stdout) | ||
console.error(stderr) | ||
if (error) { | ||
console.error(error) | ||
} | ||
}) | ||
exec(generateReport, (error, stdout, stderr) => { | ||
console.log(stdout) | ||
console.error(stderr) | ||
if (error) { | ||
console.error(error) | ||
} | ||
}) | ||
} | ||
@@ -229,0 +248,0 @@ }) |
Sorry, the diff of this file is not supported yet
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
26372
-58.2%5
-75%264
-77.65%2
100%