Last active
          November 23, 2022 12:14 
        
      - 
      
- 
        Save xbns/0e0bbb7e4702aa4f1d59bc25ed9e378a to your computer and use it in GitHub Desktop. 
    token auth [postman token authentication automation ]#postman
  
        
  
    
      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
    
  
  
    
  | const lodash = require('lodash') | |
| pm.test("Validate Response to be 200 OK", function () { | |
| pm.response.to.have.status(200); | |
| }); | |
| pm.test("Validate Response Time to be less than 200ms", function () { | |
| pm.expect(pm.response.responseTime).to.be.below(200); | |
| }); | |
| pm.test('Companies with name Group',() => { | |
| _.each(pm.response.json(), (item) => { | |
| // console.log(item.company.name) | |
| var company_name = item.company.name; | |
| if (company_name.endsWith('Group')){ | |
| console.log(company_name) | |
| } | |
| }) | |
| pm.expect(pm.response.text()).to.include("Group"); | |
| }) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment