Hi
I would like to follow up on this. Postman team suggested to use folders. That worked really well for the above scenario. I have separate folders for each feature. Some folders reads data from the CSV file, other folders do not use data file. Data file is specified at the folder level. Each folder uses different data file.
Now the challenge is each folder creates junit report separately when executing using newman. Same thing is happening with Jenkins execution.
I would like to get consolidated report instead of each folder creating separate report.
Requirement: some tests uses data file some do not. Is there a better way to get consolidated report?. Folders are working fine for this requirement. However it creates separate test report.
Appreciate your input.
Here are the details:
Command line execution - Works fine. No issues
newman run collections/tests.json --folder setup -e newenvstage.json --reporter-junit-export results1.xml --reporters cli,junit
newman run collections/tests.json --folder folder2 -e newenvstage.json --reporter-junit-export results2.xml --reporters cli,junit
newman run collections/tests.json --folder folder3 -e newenvstage.json -d data/data.csv --reporter-junit-export results3.xml --reporters cli,junit
newman run collections/tests.json --folder foler4 -e newenvstage.json --reporter-junit-export results4.xml --reporters cli,junit
newman run collections/tests.json --folder folder5 -e newenvstage.json -d data/data.csv --reporter-junit-export results5.xml --reporters cli,junit
newman run collections/tests.json --folder folder6 -e newenvstage.json --reporter-junit-export result6.xml --reporters cli,junit
newman run collections/tests.json --folder folder7 -e newenvstage.json --reporter-junit-export results7.xml --reporters cli,junit
newman run collections/tests.json --folder folder8 -e newenvstage.json --reporter-junit-export results8.xml --reporters cli,junit
Here is my package.json to run the tests via Jenkins (pasted partially)
{
“name”: "nxxxxx,
“version”: “1.0.0”,
“description”: “yyyy Project for Postman tests”,
“scripts”: {
“api-tests-stage1”: “newman run collections/tests.json --folder setup -e collections/stage_Env.json --export-environment newenvstage.json --reporter-junit-export results1.xml --reporters cli,junit”,
“api-tests-stage2”: “newman run collections/tests.json --folder folder2 -d data/testdata.csv -e newenvstage.json --reporter-junit-export results2.xml --reporters cli,junit”,
“api-tests-stage3”: “newman run collections/tests.json --folder folder3 -e newenvstage.json --reporter-junit-export results3.xml --reporters cli,junit”
},
Here is the Jenkins execute shell step:
npm run api-tests-stage1
npm run api-tests-stage2
npm run api-tests-stage3