-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update dependencies * run portman overrides before variations tests * update changelog * do not include nested folders when performing orderOfOperations * update changelog * use collectionVariables not environment * revert manipulation ordering in changelog * variation target with openApiResponse code (#55) * Added "variationTests" targeting for openApiResponse code * Added unit tests for the variations with "openApiResponse" target * Updated example * extend getting and setting by path * statusCode response default (#58) * Provided support for StatusCode tests based on the variation?.openApiResponse * Provided support for StatusCode tests based on the variation?.openApiResponse * Added unit tests * Provided support for StatusCode tests based on the variation?.openApiResponse * Corrected typo's * Clean-up unused tests * Updated readme Co-authored-by: thim81 <[email protected]>
- Loading branch information
Showing
23 changed files
with
42,927 additions
and
1,122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
{ | ||
"version": 1.0, | ||
"tests": { | ||
"contractTests": [ | ||
{ | ||
"openApiOperation": "*::/crm/*", | ||
"excludeForOperations": [ | ||
"GET::/crm/companies" | ||
], | ||
"statusSuccess": { | ||
"enabled": true | ||
} | ||
}, | ||
{ | ||
"openApiOperation": "*::/crm/*", | ||
"responseTime": { | ||
"enabled": true, | ||
"maxMs": 300 | ||
} | ||
}, | ||
{ | ||
"openApiOperation": "*::/crm/*", | ||
"contentType": { | ||
"enabled": true | ||
} | ||
}, | ||
{ | ||
"openApiOperation": "*::/crm/*", | ||
"jsonBody": { | ||
"enabled": true | ||
} | ||
}, | ||
{ | ||
"openApiOperation": "*::/crm/*", | ||
"schemaValidation": { | ||
"enabled": true | ||
} | ||
}, | ||
{ | ||
"openApiOperation": "*::/crm/*", | ||
"headersPresent": { | ||
"enabled": true | ||
} | ||
} | ||
], | ||
"contentTests": [ | ||
{ | ||
"openApiOperationId": "companiesAll", | ||
"responseBodyTests": [ | ||
{ | ||
"key": "data[0].company_name", | ||
"value": "Spacex" | ||
} | ||
] | ||
} | ||
], | ||
"extendTests": [ | ||
{ | ||
"openApiOperationId": "companiesAll", | ||
"tests": [ | ||
"pm.test('[GET] /crm/companies - Unify pagination limit', function(){pm.expect(pm.response.json().data.length).to.eql(3);});" | ||
] | ||
} | ||
], | ||
"variationTests": [ | ||
{ | ||
"openApiOperationId": "leadsAdd", | ||
"variations": [ | ||
{ | ||
"name": "missingParams", | ||
"openApiResponse": "402", | ||
"overwrites": [ | ||
{ | ||
"overwriteRequestBody": [ | ||
{ | ||
"key": "name", | ||
"value": "", | ||
"overwrite": true | ||
} | ||
] | ||
} | ||
], | ||
"tests": { | ||
"contractTests": [ | ||
{ | ||
"statusCode": { | ||
"enabled": true, | ||
"code": 400 | ||
} | ||
}, | ||
{ | ||
"jsonBody": { | ||
"enabled": true | ||
} | ||
}, | ||
{ | ||
"schemaValidation": { | ||
"enabled": true | ||
} | ||
} | ||
], | ||
"contentTests": [ | ||
{ | ||
"responseBodyTests": [ | ||
{ | ||
"key": "resource", | ||
"value": "leads" | ||
} | ||
] | ||
} | ||
], | ||
"extendTests": [ | ||
{ | ||
"tests": [ | ||
"\npm.test('say hello Portman', function(){ \n console.log('Hello Portman')\n});" | ||
] | ||
} | ||
] | ||
}, | ||
"assignVariables": [ | ||
{ | ||
"collectionVariables": [ | ||
{ | ||
"responseBodyProp": "data[0].id" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "400", | ||
"openApiResponse": "400", | ||
"tests": { | ||
"contractTests": [ | ||
{ | ||
"statusCode": { | ||
"enabled": true, | ||
"code": 333 | ||
} | ||
}, | ||
{ | ||
"jsonBody": { | ||
"enabled": true | ||
} | ||
}, | ||
{ | ||
"schemaValidation": { | ||
"enabled": true | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"assignVariables": [ | ||
{ | ||
"openApiOperationId": "companiesAll", | ||
"collectionVariables": [ | ||
{ | ||
"responseBodyProp": "data[0].id" | ||
} | ||
] | ||
} | ||
], | ||
"overwrites": [ | ||
{ | ||
"openApiOperationId": "companiesAdd", | ||
"overwriteRequestBody": [ | ||
{ | ||
"key": "name", | ||
"value": "Foo Inc. --{{$randomInt}}", | ||
"overwrite": true | ||
} | ||
] | ||
}, | ||
{ | ||
"openApiOperationId": "companiesAll", | ||
"overwriteRequestQueryParams": [ | ||
{ | ||
"key": "limit", | ||
"value": "4", | ||
"overwrite": true | ||
} | ||
] | ||
}, | ||
{ | ||
"openApiOperationId": "companiesUpdate", | ||
"overwriteRequestHeaders": [ | ||
{ | ||
"key": "x-apideck-consumer-id", | ||
"value": "portman-id-{{$randomInt}}", | ||
"overwrite": true | ||
} | ||
] | ||
}, | ||
{ | ||
"openApiOperationId": "companiesUpdate", | ||
"overwriteRequestPathVariables": [ | ||
{ | ||
"key": "id", | ||
"value": "123456789", | ||
"overwrite": true | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.