Read-only smoke tests
Test only safe GET operations, for example against production.
targetingsmokewildcards
What it does
Targets only GET operations under /crm with a path wildcard and excludes one operation that should not be checked. Write operations stay in the collection but get no tests, which makes this a safe smoke test for shared environments.
portman-config.json
{ "version": 1, "tests": { "contractTests": [ { "openApiOperation": "GET::/crm/*", "excludeForOperations": [ "GET::/crm/leads/{id}" ], "statusSuccess": { "enabled": true }, "contentType": { "enabled": true }, "jsonBody": { "enabled": true }, "schemaValidation": { "enabled": true } }, { "openApiOperation": "GET::/crm/*", "responseTime": { "enabled": true, "maxMs": 500 } } ] }}Run it
terminal
$ npx @apideck/portman -l ./openapi.yaml -c ./portman-config.json -b http://localhost:3050 -n trueNotes
- Targeting controls which requests get tests; Newman still sends every request in the collection.
- To remove write operations from the collection entirely, add --filterFile with an openapi-format filter that lists the post, put, patch and delete methods.