apideck-libraries / portman

Port OpenAPI Specs to Postman Collections, inject test suite and run via Newman 👨🏽‍🚀
http://getportman.com/
Apache License 2.0
632 stars 60 forks source link

Skip DELETE operation in all the controllers #653

Closed PraveenSuryaNarayanaMoorthy closed 3 weeks ago

PraveenSuryaNarayanaMoorthy commented 3 weeks ago

Hi All ,

I have the below operations by default when I'm running portman it run for all the controllers in the the list, how I can skip the DELETE operartion for all the controllers and execute DELETE once other operations in all the controllers are over.

orderOfOperations:

thim81 commented 3 weeks ago

hi @PraveenSuryaNarayanaMoorthy

That is not straight forward.The easiest way would be to generate 2 postman, using the filtering option.

PraveenSuryaNarayanaMoorthy commented 3 weeks ago

Hi @thim81 , using tags we can filters the controllers/entities but how can we filter the HTTP methods??

tmpCollection.json

below is my oas-format-filter file

methods: []
tags: []
operationIds: []

operations:
 - *::/v2/regulations*
 - *::/v1/vehicle-types*
 - *::/v2/systems*
 - *::/v2/ecus*
thim81 commented 3 weeks ago

@PraveenSuryaNarayanaMoorthy

That is simple:

methods: 
 - delete
tags: []
operationIds: []

operations:
 - *::/v2/regulations*
 - *::/v1/vehicle-types*
 - *::/v2/systems*
 - *::/v2/ecus*

The whole list of supported options can be found here

This will filter out the OpenAPI operations with the delete methods

PraveenSuryaNarayanaMoorthy commented 3 weeks ago

@thim81 , thanks it works.

Also, is there any way to execute a certain methods twice in a controller execution?

thim81 commented 3 weeks ago

You can use Newman iterations, which will run the sequence of all Postman requests.

I assume you want to execute a certain request multiple times, first a POST > GET > PUT > GET

thim81 commented 3 weeks ago

Or another way is to use https://learning.postman.com/docs/collections/running-collections/building-workflows/