samedi 19 mai 2018

Counting words using javascript - Postman test

Hello I am a newbie in API, postman etc. and got some task which I cannot go through.

I need to create test in postman which will check if body text contains 2 words 'Black'.

Body text: ['Green Snake', 'Black Cow', 'Blue Bird', 'Black Cat', 'Yellow Cow']

My code:

var colour = "Black"
tests["Body cointains string: " + colour] = responseBody.has(colourCount=2);

Could someone help me to solve this?

Aucun commentaire:

Enregistrer un commentaire