diff --git a/README.md b/README.md index 58a72698d..9de397666 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,9 @@ For more details on [Reporters](#reporters) and writing your own [External Repor Allows the specification of global variables via the command line, in a key=value format. Multiple CLI global variables can be added by using `--global-var` multiple times, like so: `--global-var "foo=bar" --global-var "alpha=beta"`. +- `--verbose`
+ Show detailed information of collection run and each request sent. + ### SSL Client Certificates Client certificates are an alternative to traditional authentication mechanisms. These allow their users to make authenticated requests to a server, using a public certificate, and an optional private key that verifies certificate ownership. In some cases, the private key may also be protected by a secret passphrase, providing an additional layer of authentication security. diff --git a/lib/reporters/cli/index.js b/lib/reporters/cli/index.js index 66d5db9ec..c1d155e2d 100644 --- a/lib/reporters/cli/index.js +++ b/lib/reporters/cli/index.js @@ -162,6 +162,7 @@ PostmanCLIReporter = function (emitter, reporterOptions, options) { } var timingTable, + timings, timingPhases, size = o.response && o.response.size(), timingHeaders = { @@ -181,9 +182,13 @@ PostmanCLIReporter = function (emitter, reporterOptions, options) { print.lf(colors.gray('[%d %s, %s, %s]'), o.response.code, o.response.reason(), util.filesize(size), util.prettyms(o.response.responseTime)); + // if there are redirects, get timings for the last request sent + timings = _.last(_.get(o, 'history.execution.data')); + timings = timings && timings.timings; + // print timing info of the request - if (options.verbose && o.response && o.response.timings) { - timingPhases = util.beautifyTime(sdk.Response.timingPhases(o.response.timings)); + if (options.verbose && timings) { + timingPhases = util.beautifyTime(sdk.Response.timingPhases(timings)); timingTable = new Table({ chars: _.defaults({ mid: '', middle: '' }, cliUtils.cliTableTemplate_Blank), diff --git a/lib/run/index.js b/lib/run/index.js index 0be24ce19..4c5605941 100644 --- a/lib/run/index.js +++ b/lib/run/index.js @@ -23,7 +23,7 @@ var fs = require('fs'), beforePrerequest: ['events', 'item'], prerequest: ['executions', 'item'], beforeRequest: ['request', 'item'], - request: ['response', 'request', 'item', 'cookies'], + request: ['response', 'request', 'item', 'cookies', 'history'], beforeTest: ['events', 'item'], test: ['executions', 'item'], item: ['item'], diff --git a/lib/run/summary.js b/lib/run/summary.js index 8099f9ae6..5abf6abe7 100644 --- a/lib/run/summary.js +++ b/lib/run/summary.js @@ -305,12 +305,18 @@ _.assign(RunSummary, { var size = _.isFunction(o.response.size) && o.response.size(), time = o.response.responseTime, - timingPhases = sdk.Response.timingPhases(o.response.timings), - requestCount = summary.run.stats.requests.total; + requestCount = summary.run.stats.requests.total, + timings, + timingPhases; // compute the response size total size && (summary.run.transfers.responseTotal += (size.body || 0 + size.headers || 0)); + // if there are redirects, get timings for the last request sent + timings = _.last(_.get(o, 'history.execution.data')); + timings = timings && timings.timings; + timingPhases = timings && sdk.Response.timingPhases(timings); + (timingPhases || time) && _.forEach([ 'dns', 'firstByte', diff --git a/package-lock.json b/package-lock.json index 9604095d1..8a56b9d4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4493,9 +4493,9 @@ } }, "postman-collection": { - "version": "3.4.5", - "resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-3.4.5.tgz", - "integrity": "sha512-XyllgkcepkE6DnTGZXExBZO7yjiCf+ltil7WLFVfZxVLzvHeSyY52/j/cgG5CKT+xpLI3BCROLY3xfO1OhkDOA==", + "version": "3.4.6-beta.2", + "resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-3.4.6-beta.2.tgz", + "integrity": "sha512-DLvmmt5Hh+IP/uk4fsi2ycUc2bLJzE5F0TRB/y7XKFgfQt2/FYqxb2XI7WzHaJZS6iWHqxJaFrePetMBiRmz8w==", "requires": { "escape-html": "1.0.3", "file-type": "3.9.0", @@ -4532,9 +4532,9 @@ "dev": true }, "postman-request": { - "version": "2.88.1-postman.7.1", - "resolved": "https://registry.npmjs.org/postman-request/-/postman-request-2.88.1-postman.7.1.tgz", - "integrity": "sha512-DxnOWO8B4R2Z3XjCTJOB8sTUFl1q41BtWmkSQtoJegBOx2QWwLXnoU3oky9dM0Hyhx6/smxpAJmTk39WtGGLBw==", + "version": "2.88.1-postman.8-beta.1", + "resolved": "https://registry.npmjs.org/postman-request/-/postman-request-2.88.1-postman.8-beta.1.tgz", + "integrity": "sha512-deC5UZlM1VimFhQdPN1NcbQMvLEtpUCTHZHMXWNv6vyNW7H98O3MJGTlk2xTlzB9BOpU2MCCgXNOPeNP2SU6iA==", "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -4561,9 +4561,9 @@ } }, "postman-runtime": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/postman-runtime/-/postman-runtime-7.10.0.tgz", - "integrity": "sha512-tuT83HDLffvccMvwieyGZtySsVk3AIROj4TJbyTPjT9BNhrbGe8haeaO4vzOjD73VG5fDomq4y3iRgDe5phqwQ==", + "version": "7.11.0-beta.1", + "resolved": "https://registry.npmjs.org/postman-runtime/-/postman-runtime-7.11.0-beta.1.tgz", + "integrity": "sha512-ZYxSxG59dS0BQbUonX0CjsYnYsYjUS6zzhdaQKK3G9bCZ4+YdLVtNx2Eir5i0WfrmZFMnaJgSbqwcdNKOgy1Iw==", "requires": { "async": "2.6.1", "aws4": "1.8.0", @@ -4576,12 +4576,63 @@ "lodash": "4.17.11", "node-oauth1": "1.2.2", "performance-now": "2.1.0", - "postman-collection": "3.4.5", - "postman-request": "2.88.1-postman.7.1", + "postman-collection": "3.4.6-beta.2", + "postman-request": "2.88.1-postman.8-beta.1", "postman-sandbox": "3.2.5", "resolve-from": "4.0.0", "serialised-error": "1.1.3", "uuid": "3.3.2" + }, + "dependencies": { + "postman-collection": { + "version": "3.4.6-beta.2", + "resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-3.4.6-beta.2.tgz", + "integrity": "sha512-DLvmmt5Hh+IP/uk4fsi2ycUc2bLJzE5F0TRB/y7XKFgfQt2/FYqxb2XI7WzHaJZS6iWHqxJaFrePetMBiRmz8w==", + "requires": { + "escape-html": "1.0.3", + "file-type": "3.9.0", + "http-reasons": "0.1.0", + "iconv-lite": "0.4.24", + "liquid-json": "0.3.1", + "lodash": "4.17.11", + "marked": "0.6.1", + "mime-format": "2.0.0", + "mime-types": "2.1.22", + "postman-url-encoder": "1.0.1", + "sanitize-html": "1.20.0", + "semver": "5.6.0", + "uuid": "3.3.2" + } + }, + "postman-request": { + "version": "2.88.1-postman.8-beta.1", + "resolved": "https://registry.npmjs.org/postman-request/-/postman-request-2.88.1-postman.8-beta.1.tgz", + "integrity": "sha512-deC5UZlM1VimFhQdPN1NcbQMvLEtpUCTHZHMXWNv6vyNW7H98O3MJGTlk2xTlzB9BOpU2MCCgXNOPeNP2SU6iA==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "postman-url-encoder": "1.0.1", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "stream-length": "^1.0.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + } } }, "postman-sandbox": { diff --git a/package.json b/package.json index 5b6b23003..cbc73774d 100644 --- a/package.json +++ b/package.json @@ -50,10 +50,10 @@ "filesize": "4.1.2", "lodash": "4.17.11", "mkdirp": "0.5.1", - "postman-collection": "3.4.5", + "postman-collection": "3.4.6-beta.2", "postman-collection-transformer": "3.0.0", - "postman-request": "2.88.1-postman.7.1", - "postman-runtime": "7.10.0", + "postman-request": "2.88.1-postman.8-beta.1", + "postman-runtime": "7.11.0-beta.1", "pretty-ms": "4.0.0", "semver": "5.6.0", "serialised-error": "1.1.3",