You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,7 +147,7 @@ Inline function containing the code to be executed (this function is optional fo
147
147
The optional error handler that can be handy if you need to implement special logic (like stopping test execution or skipping to a specific test) on operation failure in the default or custom `process` function.
148
148
149
149
### `utils.test.initialize`
150
-
Use to initialize request data in pre-request scripts.
150
+
Use `utils.test.initialize`to initialize request data in pre-request scripts.
Use to run positive tests. By default, it will check the response's HTTP status code against the specified value. If the returned HTTP status code matches the expected value, this function will call additional custom code if one is specified via the `process` parameter.
168
+
Use `utils.test.positive`to run positive tests. By default, it will check the response's HTTP status code against the specified (or default) value. If the returned HTTP status code matches the expected value, this function will call additional custom code if one is specified via the `process` parameter.
Use to run negative tests. By default, it will check the response's HTTP status code against the specified value. If the returned HTTP status code matches the expected value, this function will also check the value of the `serviceCode` (or similar) property defined in the data object returned in HTTP response. You can also add additional checks in the custom code defined in the `process` parameter.
207
+
Use `utils.test.negative`to run negative tests. By default, it will check the response's HTTP status code against the specified (or default) value. If the returned HTTP status code matches the expected value, this function will also check the value of the `serviceCode` (or similar) property defined in the data object returned in HTTP response. You can also add additional checks in the custom code defined in the `process` parameter.
Expected HTTP status code returned in HTTP response (default value: `400`; it is recommended to explicitly set the expected value).
217
217
*`serviceCode`:
218
-
Optional string value of the property holding error code returned by the HTTP response. By default, the name of the property is expected to be `serviceCode`. To check a different property, add the name followed by the colon(`:`) or equal (`=`) character before the expected value, such as `'errorCode=IllegalOperation'`.
218
+
Optional string value of the property holding error code returned by the HTTP response. By default, the name of the property is expected to be `serviceCode`. To check a different property, add the name followed by the colon(`:`) or equal (`=`) character before the expected value, such as `'errorCode=IllegalOperation'`.
219
219
220
220
#### Examples
221
221
A negative test that only checks for the default `400 Bad Request` HTTP status code passed in the HTTP response.
This function is intended for a rare case when you need to implement multiple tests for the same request. It is similar to the `utils.test.positive` and `utils.test.negative` functions, except it does not perform any default validation and totally relies on the custom test code specified by the caller in the `process` parameter. Also, because multiple tests are associated with the request, it is recommended to give each of them a unique name (for example, you can append an incremented index to the default test name as illustrated in the example below). Generally, you should avoid using this function.
258
+
The `utils.test.neutral` function is intended for a rare case when you need to implement multiple tests for the same request. It is similar to the `utils.test.positive` and `utils.test.negative` functions, except it does not perform any default validation and totally relies on the custom test code specified by the caller in the `process` parameter. Also, because multiple tests are associated with the request, it is recommended to give each of them a unique name (for example, you can append an incremented index to the default test name as illustrated in the example below). Generally, you should avoid using this function.
0 commit comments