frmscoe / postman

Used for different rule testing and populating the arangodb
0 stars 0 forks source link

Use global variables for transient information in Postman #44

Closed Justus-at-Tazama closed 3 months ago

Justus-at-Tazama commented 3 months ago

Postman contains two kinds of variables: there are environment variables and global variables. When you click the little icon in the top right in Postman, you'll get to see both of them. As a rule, the environment variables are just that - variables that define the parameters for running the Postman tests in our environment. These variables should be static/persistent between tests. The global variables are the ones that should be used when you are stashing values between tests. For example, if you want to set up the address to the API, it's an environment variable. If you want to remember an ID from one test to use as input into another test, it's a global. No Postman test (pre-request script or test) should ever use the pm.environment.set("key", "value") method.

Acceptance criteria

  1. Find instances where the pm.environment.set() method is being used and replace the method with pm.globals.set()
  2. Find instances where the variables being set by pm.environment.set() is being retrieved by the pm.environment.get() method and replace the method with pm.globals.get()
  3. Remove redundant and legacy tests from the Postman collection