Skip to content

Cheat sheet

Postman and Newman

Collections, variables, scripts and running them in CI.

Building blocks

Collection and folders
Group requests by feature; share them with the team.
Environments and variables
Keep base URLs and tokens per environment; use collection variables for shared values.
{{baseUrl}}/orders
Pre-request script
Runs before the call: build a signature, set a timestamp or fetch a token.
Tests tab
Assertions after the call.
pm.test('status is 200', () => pm.response.to.have.status(200));

Chaining and data

Pass values forward
Save a value from one response into a variable for the next request.
pm.environment.set('orderId', pm.response.json().id);
Data-driven runs
Run a collection against a CSV or JSON file, one iteration per row.

In CI

Newman
The command-line runner for collections.
newman run collection.json -e env.json --reporters cli,junit
Secrets
Inject tokens from the CI secret store, never commit them in an environment file.