|
1 | 1 | # Postman Utilities Library
|
2 |
| -This repo holds the [utils](utils.js) JavaScript class that can simplify and reduce [Postman](https://www.postman.com/) test and pre-request code. |
| 2 | +This repo holds the [`utils`](utils.js) JavaScript class that can simplify and reduce [Postman](https://www.postman.com/) test and pre-request code. |
3 | 3 |
|
4 | 4 | ## Overview
|
5 | 5 | The `utils` library is a simple JavaScript object that, when included in a collection folder's pre-request script, will be available to all scripts called after it. The object exposes various functions intended to make Postman tests shorter, simpler and more consistent.
|
6 | 6 |
|
7 | 7 | ## Usage
|
8 |
| -To use the `utils` library, copy the [utils.js](utils.js) source code and paste it in the pre-request script of the test collection's root folder. Then you can call the `utils` functions from anywhere in the test code base. |
| 8 | +To use the `utils` library, copy the [`utils.js`](utils.js) source code and paste it in the pre-request script of the test collection's root folder. Then you can call the `utils` functions from anywhere in the test code base. |
9 | 9 |
|
10 | 10 | The `utils` source code comments explain how to use the library, but a more detailed description is provided here.
|
11 | 11 |
|
@@ -36,9 +36,9 @@ Use folder level functions to run test or pre-request code attached to test coll
|
36 | 36 |
|
37 | 37 | Folder level functions are grouped under the `utils.run` namespace and include:
|
38 | 38 |
|
39 |
| -* [utils.run.once](#utilsrunonce): |
| 39 | +* [`utils.run.once`](#utilsrunonce): |
40 | 40 | Invokes code in the specified custom inline function once per test collection run.
|
41 |
| -* [utils.run.always](#utilsrunalways): |
| 41 | +* [`utils.run.always`](#utilsrunalways): |
42 | 42 | Invokes code in the specified custom inline function for every request during test collection run.
|
43 | 43 |
|
44 | 44 | ### Parameters
|
@@ -90,13 +90,13 @@ utils.run.always(pm, "Client_Credentials_Flow_Tests", function() {
|
90 | 90 |
|
91 | 91 | ## Primary test functions
|
92 | 92 | Use primary test functions to initialize and execute tests. Primary test functions are grouped under the `utils.test` namespace and include:
|
93 |
| -* [utils.test.initialize](#utilstestinitialize): |
| 93 | +* [`utils.test.initialize`](#utilstestinitialize): |
94 | 94 | Use to initialize request data in pre-request scripts.
|
95 |
| -* [utils.test.positive](#utilstestpositive): |
| 95 | +* [`utils.test.positive`](#utilstestpositive): |
96 | 96 | Use to execute positive tests.
|
97 |
| -* [utils.test.negative](#utilstestnegative): |
| 97 | +* [`utils.test.negative`](#utilstestnegative): |
98 | 98 | Use to execute negative tests.
|
99 |
| -* [utils.test.neutral](#utilstestneutral): |
| 99 | +* [`utils.test.neutral`](#utilstestneutral): |
100 | 100 | Use if you need to execute additional tests that must run separately from the primary (positive or negative) test defined for a request.
|
101 | 101 |
|
102 | 102 | ### Parameters
|
|
0 commit comments