Created
September 30, 2020 08:08
-
-
Save christianbaumann/59a80f0bf11221b49226e5b149a28e8d to your computer and use it in GitHub Desktop.
Execute a 3rd postman test only if two previous tests have passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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