Skip to content

Commit

Permalink
Merge pull request #462 from apideck-libraries/361-folder
Browse files Browse the repository at this point in the history
Bugfix for integrationTests - merge folders/suites into one
  • Loading branch information
thim81 authored Feb 26, 2023
2 parents c618b5d + b5eb3e7 commit d61f401
Show file tree
Hide file tree
Showing 6 changed files with 177 additions and 52 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## [Unreleased]

- Bumped openapi-to-postman to 4.9.0 which support OpenAPI 3.1
- Bugfix for integrationTests - merge folders/suites into one (#361)
- Bugfix for overwriteRequestBaseUrl - overwrite value with path parameters excludes parameters (#446)
- Bugfix for handling Postman variables in the path when targeting (#445)
- Bugfix for handling null values safer for analyzeFuzzJsonSchema (#443)
Expand Down
94 changes: 94 additions & 0 deletions __tests__/fixtures/portman-config.integration-tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"version": 1.0,
"tests": {
"integrationTests": [
{
"name": "suites_no1",
"operations": [
{
"openApiOperationId": "leadsAdd",
"variations": [
{
"name": "Add in SUITE 01",
"tests": {
"contractTests": [
{
"statusSuccess": {
"enabled": true
}
},
{
"responseTime": {
"enabled": true,
"maxMs": 1000
}
},
{
"schemaValidation": {
"enabled": true
}
}
]
}
}
]
}
]
},
{
"name": "suites_no2",
"operations": [
{
"openApiOperationId": "leadsAll",
"variations": [
{
"name": "All in SUITE 02",
"tests": {
"contractTests": [
{
"statusSuccess": {
"enabled": true
}
},
{
"responseTime": {
"enabled": true,
"maxMs": 1000
}
},
{
"schemaValidation": {
"enabled": true
}
}
]
}
}
]
}
]
}
]
},
"globals": {
"stripResponseExamples": true,
"collectionPreRequestScripts": [
"pm.collectionVariables.set('status', pm.iterationData.get('status') || 'open')"
],
"collectionTestScripts": [
"pm.collectionVariables.set('applicationId', pm.iterationData.get('applicationId') || '1111');"
],
"keyValueReplacements": {
"x-apideck-app-id": "{{applicationId}}"
},
"valueReplacements": {
"<Bearer Token>": "{{bearerToken}}"
},
"rawReplacements": [
{
"searchFor": "Unify",
"replaceWith": "Unify ApiDeck"
}
]
}
}
23 changes: 3 additions & 20 deletions examples/portman-globals/crm.openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -785,12 +785,6 @@ components:
type: string
description: A human-readable message providing more details about the error.
example: Unauthorized Request
detail:
anyOf:
- type: string
- type: object
description: Contains parameter or domain specific information related to the error and why it occured.
example: Failed to generate valid JWT Session. Verify applicationId is correct
ref:
type: string
description: Link to documentation of error type
Expand Down Expand Up @@ -839,14 +833,6 @@ components:
type: string
description: A human-readable message providing more details about the error.
example: Invalid Params
detail:
anyOf:
- type: string
- type: object
description: Contains parameter or domain specific information related to the error and why it occured.
example:
missing:
- - foobar: required
ref:
type: string
description: Link to documentation of error type
Expand Down Expand Up @@ -923,12 +909,6 @@ components:
type: string
description: A human-readable message providing more details about the error.
example: Invalid Params
detail:
anyOf:
- type: string
- type: object
description: Contains parameter or domain specific information related to the error and why it occured.
example: 'Missing Header: x-apideck-consumer-id'
ref:
type: string
description: Link to documentation of error type
Expand Down Expand Up @@ -1645,19 +1625,22 @@ components:
description: The ID of your Unify application
schema:
type: string
example: 1234567890
serviceId:
name: x-apideck-service-id
in: header
description: 'Provide the service id you want to call (e.g., pipedrive). [See the full list in the connector section.](#section/Connectors) Only needed when a consumer has activated multiple integrations for a Unified API.'
schema:
type: string
example: salesforce
consumerId:
name: x-apideck-consumer-id
in: header
required: true
description: ID of the consumer which you want to get or push data from
schema:
type: string
example: test-consumer
raw:
name: raw
in: query
Expand Down
61 changes: 35 additions & 26 deletions examples/portman-globals/crm.postman.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"_": {
"postman_id": "a6e3456c-b159-494a-92c1-c9251cf70420"
"postman_id": "5b8e8173-b0ed-42b4-b65e-3f15fab1ff50"
},
"item": [
{
"id": "c1ac6154-1e94-41b7-8d0d-ed4b48b482b7",
"id": "2089d121-cd49-4d14-aa5b-b4d399a10486",
"name": "Leads",
"description": {
"content": "",
"type": "text/plain"
},
"item": [
{
"id": "b066ba4c-756a-4fd9-b19f-369d53859f61",
"id": "6435ee81-50ba-4b13-9e4f-3bea50691e0d",
"name": "List leads",
"request": {
"name": "List leads",
Expand Down Expand Up @@ -67,7 +67,7 @@
"type": "text/plain"
},
"key": "x-apideck-consumer-id",
"value": "do"
"value": "test-consumer"
},
{
"disabled": false,
Expand All @@ -85,7 +85,7 @@
"type": "text/plain"
},
"key": "x-apideck-service-id",
"value": "do"
"value": "salesforce"
},
{
"key": "Accept",
Expand All @@ -105,10 +105,13 @@
}
},
"response": [],
"event": []
"event": [],
"protocolProfileBehavior": {
"disableBodyPruning": true
}
},
{
"id": "e48d0ae3-dc85-440a-a606-85c83f4165e1",
"id": "e0fe45e4-a36f-4d96-bb48-340bf6f2c889",
"name": "Create lead",
"request": {
"name": "Create lead",
Expand Down Expand Up @@ -145,7 +148,7 @@
"type": "text/plain"
},
"key": "x-apideck-consumer-id",
"value": "do"
"value": "test-consumer"
},
{
"disabled": false,
Expand All @@ -163,7 +166,7 @@
"type": "text/plain"
},
"key": "x-apideck-service-id",
"value": "do"
"value": "salesforce"
},
{
"key": "Content-Type",
Expand Down Expand Up @@ -202,7 +205,7 @@
}
},
{
"id": "efb3c4ad-0b48-41de-bd5d-f806e5239a39",
"id": "82e522ff-b1c0-4916-8784-2988584928f2",
"name": "Get lead",
"request": {
"name": "Get lead",
Expand Down Expand Up @@ -238,7 +241,7 @@
"type": "text/plain"
},
"type": "any",
"value": "do",
"value": "ut ullamco",
"key": "id"
}
]
Expand All @@ -251,7 +254,7 @@
"type": "text/plain"
},
"key": "x-apideck-consumer-id",
"value": "do"
"value": "test-consumer"
},
{
"disabled": false,
Expand All @@ -269,7 +272,7 @@
"type": "text/plain"
},
"key": "x-apideck-service-id",
"value": "do"
"value": "salesforce"
},
{
"key": "Accept",
Expand All @@ -289,10 +292,13 @@
}
},
"response": [],
"event": []
"event": [],
"protocolProfileBehavior": {
"disableBodyPruning": true
}
},
{
"id": "2b6e1b7e-eb37-4119-9cbf-d6bfc639556c",
"id": "d29a85e5-ed8f-407f-9280-3b7690b2ddbf",
"name": "Update lead",
"request": {
"name": "Update lead",
Expand Down Expand Up @@ -328,7 +334,7 @@
"type": "text/plain"
},
"type": "any",
"value": "do",
"value": "ut ullamco",
"key": "id"
}
]
Expand All @@ -341,7 +347,7 @@
"type": "text/plain"
},
"key": "x-apideck-consumer-id",
"value": "do"
"value": "test-consumer"
},
{
"disabled": false,
Expand All @@ -359,7 +365,7 @@
"type": "text/plain"
},
"key": "x-apideck-service-id",
"value": "do"
"value": "salesforce"
},
{
"key": "Content-Type",
Expand Down Expand Up @@ -398,7 +404,7 @@
}
},
{
"id": "ed0127b8-4fb5-413f-9899-239f44793c6a",
"id": "7ba3db2a-d53f-403a-965f-50a0db6e293d",
"name": "Delete lead",
"request": {
"name": "Delete lead",
Expand Down Expand Up @@ -434,7 +440,7 @@
"type": "text/plain"
},
"type": "any",
"value": "do",
"value": "ut ullamco",
"key": "id"
}
]
Expand All @@ -447,7 +453,7 @@
"type": "text/plain"
},
"key": "x-apideck-consumer-id",
"value": "do"
"value": "test-consumer"
},
{
"disabled": false,
Expand All @@ -465,7 +471,7 @@
"type": "text/plain"
},
"key": "x-apideck-service-id",
"value": "do"
"value": "salesforce"
},
{
"key": "Accept",
Expand All @@ -485,7 +491,10 @@
}
},
"response": [],
"event": []
"event": [],
"protocolProfileBehavior": {
"disableBodyPruning": true
}
}
],
"event": []
Expand All @@ -505,7 +514,7 @@
{
"listen": "prerequest",
"script": {
"id": "3e9ac6a3-70f2-4c7c-9c17-75803e6fe42e",
"id": "6bc84d59-683c-4111-bb01-0b7bdebe3030",
"type": "text/javascript",
"exec": [
"pm.collectionVariables.set('status', pm.iterationData.get('status') || 'open')"
Expand All @@ -515,7 +524,7 @@
{
"listen": "test",
"script": {
"id": "82f02f96-4b4f-4efe-898e-fc69ac14d519",
"id": "7ff99f0a-7aa0-4692-a580-fb84e02dcf37",
"type": "text/javascript",
"exec": [
"pm.collectionVariables.set('applicationId', pm.iterationData.get('applicationId') || '1111');"
Expand Down Expand Up @@ -556,7 +565,7 @@
}
],
"info": {
"_postman_id": "a6e3456c-b159-494a-92c1-c9251cf70420",
"_postman_id": "5b8e8173-b0ed-42b4-b65e-3f15fab1ff50",
"name": "CRM API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"description": {
Expand Down
Loading

0 comments on commit d61f401

Please sign in to comment.