Complete reference for every module, assertion operator, and tool in Hephaestus v3.8.
Per-field assertion rules using a shorthand map. Supports all operators below. Each field can have multiple operators. Conditional logic via when.
soft: true per-rule to log warning instead of failingwhen: "expression" to conditionally skipsoftFail: true applies soft behavior to all assertionsSimple key existence check. Specify a dot-notation path โ the engine walks the response body and confirms the key exists (or is absent with ! prefix).
assertions: { "data.id": { exists: true, type: "number" }, "data.email": { matches: "@" }, "data.score": { gte: 0, lte: 100 }, "data.name": { minLen: 1, maxLen: 100 }, "data.active": { eq: true, soft: true, // warning only when: "ctx.response.code === 200" }, "data.items": { type: "array", minLen: 1 }, "error": { absent: true }, }, keysToFind: ["data.id", "data.name", "!error"],
existsKey exists in response
absentKey must NOT be present
eqStrict equality
neNot equal
gtGreater than (number)
gteGreater than or equal
ltLess than (number)
lteLess than or equal
typetypeof check
minLenMin string/array length
maxLenMax string/array length
includesString/array includes
matchesRegex or substring match
softLog warning, don't fail
whenConditional skip expression
absentMust not exist
Quick one-liner per field: declare the expected type. Options:
"string" "number" "boolean""object" "array""absent" โ field must NOT exist"any" โ field must exist, any typeChecks that an array is sorted by a field in the given direction ("asc" or "desc"). Specify type: "number" or "string".
Checks that all values in an array (or sub-field values) are unique. Set by to check a nested field (e.g. "id").
assertShape: { "data": "object", "data.id": "number", "data.name": "string", "data.items": "array", "data.active": "boolean", "error": "absent", "meta": "any", }, assertOrder: { path: "data.items", by: "price", direction: "asc", type: "number", }, assertUnique: { path: "data.items", by: "id", // check item.id uniqueness },
Validates every element of an array against a set of rules. Same operator syntax as assertions map. Supports minCount / maxCount for array length, and per-rule soft mode.
Global softFail: true makes all rule violations non-fatal.
assertEach: { path: "data.products", minCount: 1, maxCount: 200, rules: { "id": { type: "number", gt: 0 }, "name": { type: "string", minLen: 1 }, "price": { gte: 0 }, "category": { exists: true }, "active": { eq: true, soft: true, // warn only per item }, } },
On first run, response body is saved as a baseline in a collection variable. On subsequent runs, the current response is compared against that baseline.
ignorePaths โ skip dynamic fields (timestamps, IDs)checkPaths โ only compare specific sub-pathssnapshot: { enabled: true, mode: "non-strict", ignorePaths: [ "data.updatedAt", "data.requestId", "meta.timestamp" ], checkPaths: ["data.status", "data.type"], update: false, // set true to reset baseline },
auth: { enabled: true, type: "basic", basic: { username: "{{user}}", password: "{{pass}}" } },
auth: { enabled: true, type: "bearer", bearer: { token: "{{access_token}}" } },
auth: { enabled: true, type: "oauth2cc", oauth2cc: { tokenUrl: "{{tokenUrl}}", clientId: "{{clientId}}", clientSecret: "{{secret}}", scope: "read write", } },
// Option 1: use ctx.random directly in scripts ctx.random.uuid() // โ "a7f3..." ctx.random.email() // โ "test42@example.com" ctx.random.str(8) // โ "xK9mPqRt" ctx.random.int(1, 100) // โ 42 ctx.random.bool() // โ true/false ctx.random.pick(['a','b']) // โ "a" ctx.random.date() // โ "2026-04-07" // Option 2: auto-inject into pm.variables randomData: { "email": "random.email", "userId": "random.int:1:9999", "orderId": "random.uuid", "name": "random.str:10", } // โ {{email}}, {{userId}}, {{orderId}} in URL/Body
// Configure in hephaestus.defaults or override dates: { today: "today", tomorrow: "today+1d", yesterday: "today-1d", nextWeek: "today+7d", lastMonth: "today-1m", startOfMonth: "startOfMonth", endOfMonth: "endOfMonth", q1Start: "startOfQuarter", } // โ {{today}}, {{tomorrow}} injected as pm.variables
// Auto-retry on 503 (service unavailable) or 429 (rate limit) retryOnStatus: { statuses: [503, 429], maxRetries: 3, } // Uses pm.setNextRequest to loop. // Assertion pipeline is skipped on intermediate retries. // Counter auto-cleaned on success.
// Pre-flight: halt collection if required vars missing envRequired: [ "BASE_URL", "API_KEY", "CLIENT_SECRET" ] // Fails fast with clear error message: // [Hephaestus] โ Required env var missing: API_KEY
No console output. Only CI JSON if ci: true. Good for data-driven runs with thousands of iterations.
Single-line summary per request: method, URL, status, time. Compact output for watch mode or large test suites.
Default. Full bordered summary box with response preview, all assertion results, saved variables.
Normal + response headers. Useful for debugging auth, CORS, and caching issues.
Global flag. All assertion failures log as warnings instead of failing the Postman test. Overrides per-rule soft.
Outputs structured JSON to console alongside human-readable output. Consumed by ci-to-junit.js.
Generate Markdown API docs from a Postman collection. Your tests become your documentation.
npm run docs -- col.json -o API.md
Rich Newman run summary: per-folder stats, slowest endpoints, most-failed assertions.
npm run summary -- results.json --md
Diff two Newman runs. Detect regressions, new failures, performance changes. Exit 1 on regression.
npm run compare -- before.json after.json
Auto re-run Newman when collection or env changes. Press R to force rerun. Debounced.
npm run watch -- -c col.json
Beautiful self-contained HTML report from Newman JSON. Charts, pass rates, details.
npm run report -- results.json
Convert Newman JSON to JUnit XML for Jenkins, GitLab CI, and other tools.
npm run ci-to-junit -- results.json
Interactive setup wizard. Generates defaults.json and environment template.
npm run init
Scan existing Postman collection and classify which requests need migration to Hephaestus.
npm run migrate -- col.json
Run full Newman + report pipeline in Docker. No local Node.js needed.
bash scripts/docker-run.sh -c col.json