Skip to content

Complex logic in assignVariables and overwrites #588

Answered by thim81
jpjpjp asked this question in Q&A
Discussion options

You must be logged in to vote

There is no option to assign variables based on certain conditions, except for the "openApiOperation".
The objective was to let Portman generate static scripts, tests, variables,... based on the OpenAPI content

Your best option would be using the "extendTests", which can be used to inject any custom script (you can even put them in JS files and file: reference, for easier management of the scripts of "extendTests").

Both mentioned cases (isMockServer or color) are very specific and best scenario's for "extendTests".

However, you can assign a specific response property, based on if exist or not. But it will not evaluate the content of the response property.

For validation of the content of…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jpjpjp
Comment options

@thim81
Comment options

Answer selected by jpjpjp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants