-
Hi. A few weeks back we had a discussion that resulted in a PR to allow this type of configuration in a variation test: - name: noAuthHeader
overwrites:
- overwriteRequestHeaders:
- key: Authorization
remove: true to generate a request which is has no authorization header. Can Portman have the same behavior for a configuration in an Integration test as well? In my project, I have been writing a bunch of variation tests for each endpoint to validate that the APIs handle various invalid input scenarios. As I began work on my 3rd endpoint, I realized that the configuration file was getting a bit monolithic, so I had hoped to use the My original idea was to create a unique configuration file for each endpoint, including the array of operationIds to perform various tests on. Basically I'd have one configuration file for each of the folders that Portman generates under the "Variation Tests" folder. tests:
contractTests:
$ref: portman/tests/contracts/generic-contract-tests.yaml
variationTests:
$ref: portman/tests/variations/me-variations.yaml
$ref: portman/tests/variations/categories-variations.yaml Only the tests in the final referenced configuration file are generated. I discovered that the tests:
contractTests:
$ref: portman/tests/contracts/generic-contract-tests.yaml
# variationTests:
# $ref: portman/tests/variations/me-variations.yaml
# $ref: portman/tests/variations/categories-variations.yaml
integrationTests:
- name: /me tests
$ref: portman/tests/variations/me-variations.yaml
- name: /categories tests
$ref: portman/tests/variations/categories-variations.yaml
- name: /transactions tests
$ref: portman/tests/variations/transactions-variations.yaml The only thing that doesn't work in this case is the test that removes the "authorization" header. Is this an appropriate use of integrationTests? They are discussed only lightly in the documentation. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
hi @jpjpjp The integration tests re-use the regular directives, so normally it should work. |
Beta Was this translation helpful? Give feedback.
-
hi @jpjpjp Any chance you can zip your files and config, so I can reproduce it locally? |
Beta Was this translation helpful? Give feedback.
hi @jpjpjp
I found the reason and created a PR that solves the issue, which contains the BEFORE/AFTER results.