Hi,
I wrote a function to wait for my async API to be done first and execute related tests later.
something like below:
wait_for_task_to_be_done(jsonData.taskId).then(function(value) {
pm.test("Test A", function () {
pm.expect(data).to.eql("expectation"));
});
pm.sendRequest( ... ,function (err, res) {
pm.test("Test B", function () {
pm.expect(data).to.eql("expectation"));
});
})
pm.test("Test C", function () {
pm.expect(data).to.eql("expectation"));
});
});
However, the βTest Bβ not showing up in test result but the βTest Aβ and βTest Cβ working perfectly.
And I checked the console output, the request has never been sent, it seems like the pm.sendRequest is not working in promise.then().
Could anyone help? Any workaround?