I have different collections on a branch that runs on jenkins, I won’t be able to access the server where jenkins is set up, so I won’t be able to alter the newman script on jenkins.
So far I’ve had to declare a new script per collection because I use an specfic iterationData per collection (I’m using the router logic) like this
newman run “postman-automation/tests/collection1” --iteration-data “postman-automation/testsRoutes/collection1-routes.json”
newman run “postman-automation/tests/collection2” --iteration-data “postman-automation/testsRoutes/collection2-routes.json”
I need to know if there’s a more scalable solution where I just set up the newman script where the tests are and the iteration data is, without having to specify which iterationData belongs to which collection on the newman script, that’s why I was wondering if it can be done from the collection:
to have something more like:
newman run “postman-automation/tests/" --iteration-data "postman-automation/testsRoutes/”
I understand what you would like to achieve is to batch process using newman command.
That would be a nice feature to have. I also found a similar feature request here.
You are encouraged to subscribe to this issue and please feel free to add your contexts and comments to weigh in.
Our product managers use that feedback to prioritize and add items to our development roadmap
This sounds like something you can be doing in the script itself, not really having anything to do with Postman.
Jenkins scripts are written in groovy, so you should be able to write a function to get the files in the working directory and pass them off to newman.
This is what I currently have to do, if you notice I run a new command batch per collection because each collection has it’s own iteration data so it doesn’t run a collection with an iteration file it doesn’t belong to (sorry if it’s in spanish)
yes but that will require me to add that directory on the jenkins script each time I add a new collection and a new iteration data file, I won’t have access to the server where jekins is stored, on my previous answer I enter what I’m trying to run locally, but the server where my collections are going to be run is not something I’ll have access to. So it’ll be dificult to request an script change every time I add a collection to the repository, if I end up creating 100 collections more, someone will have to modify that script a 100 times
The only missing thing here is, how can I add all the results into a single report? I know it’s too much asking lol, but I was wondering if you knew any solutions for this.
Single report is not posible as of now , as each collection run is viewed as individual runs . But as you are using newman as a library you can write your own code to combine all the reports and display as single html.