The thing is that all request 1 use the same test (same for request 2 and request 3). The reason for this is that there are some little differences on the bodies, but the structure of the responses is similar.
The problem here is that I need to duplicate all those tests for all the folders, and if I make some change replicate it in all the instances of the tests.
Isn´t there any way to write this code only once, encapsulate like functions and then call these functions from the Test area of the request??
Once it has been loaded once into the global variable pool, the test200 function can now be called from any of your “requests” in the pre-request or test scripts.
eval( pm.globals.get('test200') );
test200();
Or, you can load “test200” into the “global variables” file (globals.postman_globals.json) that will be automatically loaded when each collection is run and you can skip the “pm.globals.set”.