Hello! I need your help
I have the following request:
GET https://eu-api.backendless.com/1877CC4D-B4EA-4E2D-FFCB-78A7EDACDE00/ACA31220-F45A-474C-94E0-AB0700926637/hive/Management/list/keys?filterPattern=*&pageSize=5&cursor=0
The following test is written for it (it works as expected, but there is one thing):
const finalCursor = "0";
pm.variables.set('cursorValue', pm.response.json().cursor);
const res = pm.response.json();
if(res.cursor !== finalCursor){
postman.setNextRequest("Iterate over the key names in the specific Hive 'Test work only in 'Run Collection'")
pm.test('Cursor is not equal to 0, cursor eql ' + res.cursor, () => {
pm.expect(res.cursor, 'Error').to.not.eql(finalCursor)
})
} else {
pm.test('Cursor equals ' + res.cursor, () => {
pm.expect(res.cursor).to.eql(finalCursor)
})
}
The logic here is as follows:
1 iteration: A request is sent with cursor=0;
response from the server "cursor": "360"
2 iteration: Request is sent with cursor=360
Response from the server "cursor": "86"
3 iteration: Request sent from cursor=86
Response from the server "cursor": "415"
4 iteration: Request is sent from cursor=415
Response from the server "cursor": "10"
5 iteration: Request sent from cursor=10
Response from the server "cursor": "0"
The test is over
The problem is that the Runner displays a large number of additional queries, as a result of which the total number of tests will vary for each environment.
I need only one request with the test result ‘Cursor equals 0’ to be displayed in the test runner
How can I do this?