Batch execution newman

  shell

Shell script

#!/bin/bash
for item in `ls collection_dir`
do
  col=${item%%.*}
  echo $col
newman run collection_dir/${item} --reporters cli,html,junit \
--environment dev.postman_environment.json \
--reporter-html-export ${col}-result.html \
--reporter-junit-export ${col}-result.xml
done

Where ${item%%.*} means delete from the right until the last. number, such as demo.postman_collection.json, becomes demo after processing

doc