Created
August 4, 2019 05:25
-
-
Save danielplawgo/fc06ac4a3282ec34fb706a5819c44f32 to your computer and use it in GitHub Desktop.
Postman - asserty w automatycznych testach
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
pm.test("Status code is 200", function () { | |
pm.response.to.have.status(200); | |
}); | |
pm.test("Response time is less than 200ms", function () { | |
pm.expect(pm.response.responseTime).to.be.below(200); | |
}); | |
pm.test("Return added product data", function () { | |
var jsonData = pm.response.json(); | |
pm.expect(jsonData.Success).to.eql(true); | |
pm.expect(jsonData.Value.Id).to.eql(1); | |
pm.expect(jsonData.Value.Name).to.eql("Name1"); | |
}); |
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
pm.test("Return added product data", function () { | |
pm.response.to.have.body('{"Value":{"Id":1,"Name":"Name1"},"Success":true,"Errors":[]}'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment