Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save christianbaumann/59a80f0bf11221b49226e5b149a28e8d to your computer and use it in GitHub Desktop.

Select an option

Save christianbaumann/59a80f0bf11221b49226e5b149a28e8d to your computer and use it in GitHub Desktop.
Execute a 3rd postman test only if two previous tests have passed
let test1Passed, test2Passed;
pm.test("Test 1", function() {
try {
pm.expect(true).to.equal(true)
test1Passed = true;
} catch (err) {
test1Passed = false;
}
});
pm.test("Test 2", function() {
try {
pm.expect(true).to.equal(true)
test2Passed = true;
} catch (err) {
test2Passed = false;
}
});
if (test1Passed && test2Passed) {
pm.test("Test 3", function() {
// pm.expect()
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment