Skip to content

Commit

Permalink
#15 fixed links to the examples/testsuite-default-checksAdded example…
Browse files Browse the repository at this point in the history
… to overwriteRequestQueryParams to disable a query param (#17)

Co-authored-by: Tim <>
  • Loading branch information
thim81 authored May 26, 2021
1 parent 5ac7581 commit a25f2cc
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/testsuite-assign-variables/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenApi Postman test suite generation - assignPmVariables

In the "[examples/testsuite-default-checks](examples/testsuite-default-checks)" example, we explained the default generated Postman contract tests.
In the "[examples/testsuite-default-checks](https://github.com/apideck-libraries/portman/tree/main/examples/testsuite-default-checks)" example, we explained the default generated Postman contract tests.

This example focusses on assigning Postman variables based on the response of an API request, with the goal to be able to reuse them in other requests.

Expand Down Expand Up @@ -172,7 +172,7 @@ These target options are both supported for defining a target. In case both are

## Example explained

In this example, we are zooming in on only the overwriteRequests usage. For the basics on the testsuite configuration and usage in Portman, have a look at ["examples/testsuite-default-checks"]("examples/testsuite-default-checks")
In this example, we are zooming in on only the overwriteRequests usage. For the basics on the testsuite configuration and usage in Portman, have a look at ["examples/testsuite-default-checks"]("https://github.com/apideck-libraries/portman/tree/main/examples/testsuite-default-checks")

file: examples/testsuite-assign-variables/postman-testsuite.crm.json >>

Expand Down
4 changes: 2 additions & 2 deletions examples/testsuite-content-checks/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenApi Postman test suite generation - Content checks

In the "[examples/testsuite-default-checks](examples/testsuite-default-checks)" example, we explained the default generated Postman contract tests.
In the "[examples/testsuite-default-checks](https://github.com/apideck-libraries/portman/tree/main/examples/testsuite-default-checks)" example, we explained the default generated Postman contract tests.

This example focusses on the extension of the contract test suite with specific content checks. While the contract tests focusses on the validation of the request/response properties, the "content checks" focusses on validating the actual values of the API.

Expand Down Expand Up @@ -105,7 +105,7 @@ These target options are both supported for defining a target. In case both are

## Example explained

In this example, we are zooming in on only the contenChecks usage. For the basics on the testsuite configuration and usage in Portman, have a look at ["examples/testsuite-default-checks"]("examples/testsuite-default-checks")
In this example, we are zooming in on only the contenChecks usage. For the basics on the testsuite configuration and usage in Portman, have a look at ["examples/testsuite-default-checks"]("https://github.com/apideck-libraries/portman/tree/main/examples/testsuite-default-checks")

file: examples/testsuite-content-checks/postman-testsuite.crm.json >>

Expand Down
4 changes: 2 additions & 2 deletions examples/testsuite-overwrites/crm.postman.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"value": ""
},
{
"disabled": false,
"disabled": true,
"description": {
"content": "Number of records to return",
"type": "text/plain"
Expand Down Expand Up @@ -2973,4 +2973,4 @@
"type": "text/plain"
}
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions examples/testsuite-overwrites/postman-testsuite.crm.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@
"overwrite": true
}
]
},
{
"openApiOperationId": "leadsAll",
"overwriteRequestQueryParams": [
{
"key": "limit",
"disable": true
}
]
}
]
}
58 changes: 53 additions & 5 deletions examples/testsuite-overwrites/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenApi Postman test suite generation - overwriteRequests

In the "[examples/testsuite-default-checks](examples/testsuite-default-checks)" example, we explained the default generated Postman contract tests.
In the "[examples/testsuite-default-checks](https://github.com/apideck-libraries/portman/tree/main/examples/testsuite-default-checks)" example, we explained the default generated Postman contract tests.

This example focusses on the manipulation of the Postman collection to make it possible to setup automation, by manipulating

Expand Down Expand Up @@ -59,7 +59,7 @@ file: examples/testsuite-overwrites/postman-testsuite.crm.json
},
"contentType": {
"enabled": true
},
},
"jsonBody": {
"enabled": true
},
Expand Down Expand Up @@ -89,10 +89,17 @@ file: examples/testsuite-overwrites/postman-testsuite.crm.json
},
{
"openApiOperation": "DELETE::/crm/leads/{id}",
"overwriteRequestQueryParams": [
{
"key": "raw",
"value": false,
"overwrite": true
}
],
"overwriteRequestPathVariables": [
{
"key": "id",
"value": "{{leadsAdd.id}}",
"value": "123456789",
"overwrite": true
}
]
Expand All @@ -106,6 +113,15 @@ file: examples/testsuite-overwrites/postman-testsuite.crm.json
"overwrite": true
}
]
},
{
"openApiOperationId": "leadsAll",
"overwriteRequestQueryParams": [
{
"key": "limit",
"disable": true
}
]
}
]
}
Expand Down Expand Up @@ -166,12 +182,12 @@ These target options are both supported for defining a target. In case both are

## Example explained

In this example, we are zooming in on only the overwriteRequests usage. For the basics on the testsuite configuration and usage in Portman, have a look at ["examples/testsuite-default-checks"]("examples/testsuite-default-checks")
In this example, we are zooming in on only the overwriteRequests usage. For the basics on the testsuite configuration and usage in Portman, have a look at ["examples/testsuite-default-checks"]("https://github.com/apideck-libraries/portman/tree/main/examples/testsuite-default-checks")

file: examples/testsuite-overwrites/postman-testsuite.crm.json >>

```json
"overwriteRequests": [
"overwriteRequests": [
{
"openApiOperationId": "leadsAdd",
"overwriteRequestBody": [
Expand Down Expand Up @@ -213,6 +229,15 @@ file: examples/testsuite-overwrites/postman-testsuite.crm.json >>
"overwrite": true
}
]
},
{
"openApiOperationId": "leadsAll",
"overwriteRequestQueryParams": [
{
"key": "limit",
"disable": true
}
]
}
]
```
Expand Down Expand Up @@ -291,6 +316,29 @@ Postman request "Leads" >> "Delete lead" Request query params:

![](./images/overwriteRequestQueryParams.png)

The example below will showcase the "disable" setting.

```json
{
"openApiOperationId": "leadsAll",
"overwriteRequestQueryParams": [
{
"key": "limit",
"disable": true
}
]
}
```

This will target the OpenApi `"openApiOperationId": "leadsAll"` and will modify the request query params to set the `limit`property as **disabled** (because disable:true) in Postman.

file: examples/testsuite-overwrites/crm.postman.json >>

Postman request "Leads" >> "Get leads" Request query params:

![](./images/overwriteRequestQueryParamsDisable.png)


## overwriteRequestPathVariables

```json
Expand Down

0 comments on commit a25f2cc

Please sign in to comment.