Home > Net >  Assert MetaInfo using test data CSV for Postman Tests
Assert MetaInfo using test data CSV for Postman Tests

Time:02-10

I am trying to right tests in postman for the response body to validate. Trying to validate the following data

"plans": [
  {
    "Option": "Single",
    "premium": 23.45,
    "type": "Plan1",
    "paymentFreequency": "Monthly"
  },
  {
    "Option": "Single",
    "premium": 45.41,
    "type": "Plan2",
    "paymentFreequency": "Monthly"
  },
  {
    "Option": "Single",
    "premium": 65.45,
    "type": "Plan3",
    "paymentFreequency": "Monthly"
  }
]

I am trying to assert this way

pm.test("Single Group Annual Premiums Plan Options ", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.plans[0].premium).to.eql(23.45);
pm.expect(jsonData.plans[1].premium).to.eql(45.41);
pm.expect(jsonData.plans[2].premium).to.eql(65.45);
});

But Now i need to assert using test data from CSV. please explain how can i achieve it

CodePudding user response:

  •  Tags:  
  • Related