Skip to content

Commit

Permalink
Added support for HTTP/2 (#3263)
Browse files Browse the repository at this point in the history
  • Loading branch information
parthverma1 authored Aug 6, 2024
1 parent aaaaf9c commit f7c9e93
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 36 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
unreleased:
new features:
- GH-3263 Added support for HTTP/2
chores:
- >-
GH-3258 Converted the deprecated `apikey` parameter in Postman API urls
Expand Down
1 change: 1 addition & 0 deletions lib/run/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ module.exports = function (options, callback) {
requester: {
useWhatWGUrlParser: true,
cookieJar: cookieJar,
protocolVersion: _.has(options, 'protocolVersion') ? options.protocolVersion : 'auto',
followRedirects: _.has(options, 'ignoreRedirects') ? !options.ignoreRedirects : undefined,
strictSSL: _.has(options, 'insecure') ? !options.insecure : undefined,
timings: Boolean(options.verbose),
Expand Down
76 changes: 46 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"mkdirp": "3.0.1",
"postman-collection": "4.5.0",
"postman-collection-transformer": "4.1.8",
"postman-request": "2.88.1-postman.37",
"postman-runtime": "7.41.0",
"postman-request": "2.88.1-postman.38",
"postman-runtime": "7.41.1",
"pretty-ms": "7.0.1",
"semver": "7.6.3",
"serialised-error": "1.1.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,41 @@
"listen": "test",
"script": {
"type": "text/javascript",
"exec": "tests[\"Content-Type is present\"] = responseHeaders.hasOwnProperty(\"Content-Type\");var data1 = JSON.parse(responseBody);\ntests[\"testGlobalSetFromPRScript\"] = data1.args.prsG === \"prsG\";\ntests[\"Read global var correctly\"] = globals.prsG === \"prsG\";\n\ntests[\"testEnvSetFromPRScript\"] = data1.args.prsE === \"prsE\";\ntests[\"Read env var correctly\"] = environment.prsE === \"prsE\";\ntests[\"Read data var correctly\"] = data.dataVar === \"dataValue\";\n\npostman.setGlobalVariable(\"prsG\", \"prsG1\");\n\npostman.setEnvironmentVariable(\"prsE\", \"prsE1\");"
"exec": [
"pm.test(\"Content-Type is present\", () => {",
" pm.expect(pm.response.headers.has(\"content-type\")).true;",
"})",
"var data1 = pm.response.json();",
"pm.test(\"testGlobalSetFromPRScript\", () => {",
" pm.expect(data1.args.prsG).equal('prsG');",
"})",
"pm.test(\"Read global var correctly\", () => {",
" pm.expect(pm.globals.get(\"prsG\")).equal('prsG');",
"})",
"pm.test(\"testEnvSetFromPRScript\", () => {",
" pm.expect(data1.args.prsE).equal('prsE');",
"})",
"pm.test(\"Read env var correctly\", () => {",
" pm.expect(pm.environment.get(\"prsE\")).equal('prsE');",
"})",
"pm.test(\"Read data var correctly\", () => {",
" pm.expect(pm.variables.get(\"prsE\")).equal('prsE');",
"})",
"pm.globals.set(\"prsG\", \"prsG\");",
"pm.environment.set(\"prsE\", \"prsE\");"
]
}
},
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": "postman.setGlobalVariable(\"prsG\", \"prsG\");\npostman.setGlobalVariable(\"prsE\", \"prsEaRDDDROR\");\npostman.setEnvironmentVariable(\"prsE\", \"prsE\");\n"
"exec": [
"pm.globals.set(\"prsG\", \"prsG\");",
"pm.globals.set(\"prsE\", \"prsEaRDDDROR\");",
"pm.environment.set(\"prsE\", \"prsE\");",
""
]
}
}
],
Expand All @@ -44,7 +71,19 @@
"listen": "test",
"script": {
"type": "text/javascript",
"exec": "var data1 = JSON.parse(responseBody);\ntests[\"Read global var correctly\"] = globals.prsG === \"prsG1\";\ntests[\"Read env var correctly\"] = environment.prsE === \"prsE1\";\ntests[\"Read data var correctly\"] = data.dataVar === \"dataValue\";"
"exec": [
"var data1 = pm.response.json();",
"",
"pm.test(\"Read global var correctly\", () => {",
" pm.expect(pm.globals.get(\"prsG\")).equal('prsG');",
"})",
"pm.test(\"Read env var correctly\", () => {",
" pm.expect(pm.environment.get(\"prsE\")).equal('prsE');",
"})",
"pm.test(\"Read data var correctly\", () => {",
" pm.expect(pm.variables.get(\"prsE\")).equal('prsE');",
"})"
]
}
}
],
Expand Down
9 changes: 8 additions & 1 deletion test/integration/semicolon-tests.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@
"listen": "test",
"script": {
"type": "text/javascript",
"exec": "tests[\"Test1: Content-Type is 'application/json; charset=utf-8'\"] = responseHeaders[\"Content-Type\"] === \"application/json; charset=utf-8\";\ntests[\"Test2: Content-Type is 'application/json; charset=utf-8'\"] = responseHeaders.hasOwnProperty(\"Content-Type\") && 'application/json; charset=utf-8' === responseHeaders[\"Content-Type\"];\n\n\n\ntests[\"Test3: Content-Type is 'application/json; charset=utf-8'\"] = responseHeaders[\"Content-Type\"] === \"application/json;\\ charset=utf-8\";\ntests[\"Test4: Content-Type is 'application/json; charset=utf-8'\"] = responseHeaders.hasOwnProperty(\"Content-Type\") && 'application/json;\\ charset=utf-8' === responseHeaders[\"Content-Type\"];\n\n"
"exec": [
"pm.test(\"Test1: Content-Type is 'application/json; charset=utf-8'\", ()=>{",
" pm.expect(pm.response.headers.get('Content-Type')).equal('application/json; charset=utf-8') ",
"})",
"pm.test(\"Test2: Content-Type is 'application/json; charset=utf-8'\", ()=>{",
" pm.expect(pm.response.headers.get('Content-type')).equal('application/json;\\ charset=utf-8') ",
"})"
]
}
}
],
Expand Down

0 comments on commit f7c9e93

Please sign in to comment.