API testing using Postman, node and newman (ServeRest documentation)
- Postman
- node v21.7.3
- newman 6.1.2
- newman-reporter-htmlextra
- Install node
# installs NVM (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# download and install Node.js
nvm install 21.7.3- Install newman
npm install -g newman- Install newman-reporter-htmlextra
npm install -g newman-reporter-htmlextra- Import the environment and collection
- Run tests manually or automatedly
- Results in CLI
newman run serveRest.postman_collection.json -e serveRest_env.postman_environment.json -r cli- Results in CLI and HTML page
newman run serveRest.postman_collection.json -e serveRest_env.postman_environment.json -r cli,htmlextra- To access the HTML page, simply access the "newman" folder generated in the root directory