Created
September 8, 2024 05:44
-
-
Save PramodDutta/ec775b2b507690b166298890e6718233 to your computer and use it in GitHub Desktop.
Postman Testcases Writing notes
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
console.log("After running the API") | |
console.log("Testcases written by Us") | |
console.log(pm.info.requestName); | |
// Postman Syntax for Text is based on the ChaiJS | |
console.log(pm.response.text()); // text response | |
console.log(pm.response.json()); // json response | |
console.log(pm.response.code); // 200 | |
console.log(pm.response.status); // OK | |
console.log(pm.response.headers); // Headers | |
console.log(pm.response.cookies); // Cookies | |
Assertion | |
An assertion is a statement or declaration that is made confidently and emphatically, | |
Expected Result = Actual Result | |
Pura JS | |
pm.test("Verify that status code for the request is 200 Ok", function(){ | |
pm.expect(pm.response.code).to.be.equal(200); | |
// pm.expect(AR).to.be.equal(ER); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment