Manuals / API Testing / Chapter 6

C · Automation & CI · intermediate · Week 3–4 · Chapter 6 of 11

Newman — CLI & GitHub Actions

Collections that only run in Postman GUI are hobbies. Newman runs them headless in CI on every PR.

Path progress
48%

Step 1 of 4

Newman local

npm install -g newman (or npx newman). newman run collection.json -e environment.json.

Newman localDrag stickies · tap for tips
Study mapDrag stickies · tap for tipsKeep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Assert the UIdrag · tap →Retry wiselydrag · tap →Seed datadrag · tap →Close the loopdrag · tap →Keep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Pathwise hackdrag · tap →Newman localdrag · tap →Try thisdrag · tap →Follow the dashed drag · tap →

Example

npm install newman newman-reporter-htmlextra --save-dev
npx newman run postman/collection.json -e postman/environment.json

Do this now

Run collection locally via Newman. Fix any failures Postman runner hid.

Was this step clear?
Chapter learning outcomes
  • newman run
  • Reporters (cli, htmlextra)
  • CI integration
  • Secrets in CI

Clear these before you leave

Side quest

Break and fix CI

Intentional test failure on branch. Confirm CI fails and uploads report.