Skip to content

Commit

Permalink
Merge pull request #8 from thim81/pr-openapi-to-postman-examples
Browse files Browse the repository at this point in the history
PR openapi to postman examples
  • Loading branch information
nicklloyd authored May 25, 2021
2 parents 0780908 + c0821c6 commit 53df2a9
Show file tree
Hide file tree
Showing 21 changed files with 11,114 additions and 12,809 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ postman-testsuite.json
.idea
/examples/testsuite-default-checks/tmp/
/examples/testsuite-content-checks/tmp/
/examples/testsuite-overwrites/tmp/
/examples/testsuite-assign-variables/tmp/
8 changes: 8 additions & 0 deletions CHANEGLOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
## v0.0.x - (2021-xx-xx)

### OpenApi-to-postman
Bumped openapi-to-postman to the latest version, which includes extended assignPmVariables test capabilities
Added examples for the test suite assignPmVariables function
Added examples for the test suite overwriteRequests function

## v0.0.4 - (2021-05-18)

### OpenApi-to-postman
Bumped openapi-to-postman to version 2.7.0, which includes ContentCheck test capabilities
Added examples for the test suite generation
Added examples for the test suite contentChecks function
Made the "orderOfOperations" property optional

### CLI options
Expand Down
2,067 changes: 2,067 additions & 0 deletions examples/testsuite-assign-variables/crm.openapi.yml

Large diffs are not rendered by default.

2,970 changes: 2,970 additions & 0 deletions examples/testsuite-assign-variables/crm.postman.json

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions examples/testsuite-assign-variables/portman-cli-options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"local": "./examples/testsuite-assign-variables/crm.openapi.yml",
"baseUrl": "http://localhost:3050",
"output": "./examples/testsuite-assign-variables/crm.postman.json",
"portmanConfigFile": "./examples/testsuite-assign-variables/portman-config.crm.json",
"postmanConfigFile": "./examples/testsuite-assign-variables/postman-config.crm.json",
"includeTests": true,
"testSuiteConfigFile": "./examples/testsuite-assign-variables/postman-testsuite.crm.json",
"syncPostman": true,
"runNewman": false
}
12 changes: 12 additions & 0 deletions examples/testsuite-assign-variables/portman-config.crm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"preRequestScripts": [],
"variableOverwrites": {
"application_id": "{{applicationId}}"
},
"globalReplacements": [
{
"searchFor": "\"maxItems\":2,",
"replaceWith": ""
}
]
}
5 changes: 5 additions & 0 deletions examples/testsuite-assign-variables/postman-config.crm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"folderStrategy": "Tags",
"requestParametersResolution": "Example",
"exampleParametersResolution": "Example"
}
101 changes: 101 additions & 0 deletions examples/testsuite-assign-variables/postman-testsuite.crm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"version": 1.0,
"generateTests": {
"responseChecks": {
"StatusSuccess": {
"enabled": true
},
"responseTime": {
"enabled": true,
"maxMs": 300
},
"contentType": {
"enabled": true
},
"jsonBody": {
"enabled": true
},
"schemaValidation": {
"enabled": true
},
"headersPresent": {
"enabled": true
}
}
},
"assignPmVariables": [
{
"openApiOperationId": "GET::/crm/leads/{id}",
"environmentVariables": [
{
"responseBodyProp": "data.company_name"
}
]
},
{
"openApiOperationId": "leadsAdd",
"environmentVariables": [
{
"requestBodyProp": "company_name",
"name": "leadsAdd.company_name"
},
{
"responseBodyProp": "data.id",
"name": "leadsAdd.id"
}
]
}
],
"contentChecks": [
{
"openApiOperationId": "leadsOne",
"checkRequestBody": [
{
"key": "data.company_name",
"value": "{{leadsAdd.company_name}}"
}
]
}
],
"overwriteRequests": [
{
"openApiOperationId": "leadsAdd",
"overwriteRequestBody": [
{
"key": "name",
"value": "{{leadsAdd.name}}"
}
]
},
{
"openApiOperation": "GET::/crm/leads/{id}",
"overwriteRequestPathVariables": [
{
"key": "id",
"value": "{{leadsAdd.id}}",
"overwrite": true
}
]
},
{
"openApiOperation": "PATCH::/crm/leads/{id}",
"overwriteRequestPathVariables": [
{
"key": "id",
"value": "{{leadsAdd.id}}",
"overwrite": true
}
]
},
{
"openApiOperation": "DELETE::/crm/leads/{id}",
"overwriteRequestPathVariables": [
{
"key": "id",
"value": "{{leadsAdd.id}}",
"overwrite": true
}
]
}
]
}
Loading

0 comments on commit 53df2a9

Please sign in to comment.