Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. var jsonData = pm.response.json();
  2.  
  3. var resultCount = jsonData.length;
  4. for (i=0;i<resultCount;i++){
  5. var modelString = jsonData[i].name;
  6. if(modelString.indexOf("Pregnancy") > 0)
  7. {
  8. tests["Each organisation name field " +i+ " contains "Pregnancy""] = modelString.has("Pregnancy");
  9. }
  10. else
  11. {
  12. pm.expect.fail("failed");
  13. }
  14. }
  15. console.log("")
  16.  
  17. [
  18. {
  19. "id": "1-116992830",
  20. "name": "British Pregnancy Advisory Service (BPAS)",
  21. "numberOfLocations": 78
  22. },
  23. {
  24. "id": "1-1560082724",
  25. "name": "PAMS Pregnancy Ultrasound Centre (PAMS 3D & 4D Baby Imaging)",
  26. "numberOfLocations": 1
  27. },
  28. {
  29. "id": "1-2458518720",
  30. "name": "Pregnancy Ultrasound Ltd (Babyface4d)",
  31. "numberOfLocations": 1
  32. },
  33. {
  34. "id": "1-101728376",
  35. "name": "National Unplanned Pregnancy Advisory Service Limited",
  36. "numberOfLocations": 23
  37. },
  38. {
  39. "id": "1-3578030817",
  40. "name": "Private Pregnancy Ultrasound Services Ltd trading as Expectancy Scanning Studios Ltd (Expectancy Scanning Studios Ltd)",
  41. "numberOfLocations": 2
  42. },
  43. {
  44. "id": "1-1412821832",
  45. "name": "Foundation For Life (Salisbury) (Pregnancy Advice Salisbury)",
  46. "numberOfLocations": 1
  47. },
  48. {
  49. "id": "1-2028907839",
  50. "name": "Miscarriage Clinic Limited (Centre for Reproductive Immunolgy and Pregnancy)",
  51. "numberOfLocations": 1
  52. },
  53. {
  54. "id": "1-744810951",
  55. "name": "Foundation For Life (Tyneside Pregnancy Advice Centre)",
  56. "numberOfLocations": 1
  57. }
  58. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement