agent-js-postman
agent-js-postman copied to clipboard
[Issue] Tests with conditions lead to infinite run
Tools:
- Postman + Newman
If the test has conditions and the condition is false (we don't execute pm.test() {}
in the condition block), I see the test in the report and it will never end.
Example:
let jsonData = JSON.parse(responseBody);
for (let i = 0; i < jsonData.data.length; i++) {
let id = jsonData.data[i].id;
pm.test("event id != null", function () {
pm.expect(jsonData.data[i].id).to.not.eql(null);
});
let event_type = jsonData.data[i].attributes.type;
if (event_type === "event") {
pm.test("event type === null", function () {
pm.expect(jsonData.data[i].relationships.event_type).to.eql(null);
});
}
}
https://github.com/reportportal/agent-js-postman/pull/94