Skip to content

Instantly share code, notes, and snippets.

@daffahilmyf
Created February 27, 2022 23:19
Show Gist options
  • Save daffahilmyf/3d1d00e3cbaa8f146ac43a0a33b32496 to your computer and use it in GitHub Desktop.
Save daffahilmyf/3d1d00e3cbaa8f146ac43a0a33b32496 to your computer and use it in GitHub Desktop.
Example Test Script
pm.test("Activities Get Collection Response Status Code Should be 200", ()=>{
pm.expect(pm.response.code).to.eql(200);
});
pm.test("Activities Get Collection Response Time Should Less Than 1000ms", () => {
pm.expect(pm.response.responseTime).to.be.below(1000);
});
pm.test("Activities Get Collection Content-Type Header Should be application/json", ()=>{
pm.expect(pm.response.headers.get('Content-Type')).to.contain('application/json');
});
pm.test("Activities Collection Response Should be Array of JSON", ()=>{
pm.expect(pm.response.json()).to.be.an("array");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment