크기가 0보다 커야하지만 올바르게 테스트하지 못하는 POSTMAN에서 테스트하려고합니다. . 내가 무슨 짓을POSTMAN을 사용하여 물체의 크기가 특정 숫자보다 큰지 테스트하는 방법
는 크기가 0
보다 작은 경우는 크기가 X의 수보다 큰 경우 확인하는 우편 배달부의 기능이 있나요 실패하는 것이었다?
pm.test("Step 7/ Getting the resources and availabilites list " , function(){
pm.expect(pm.response.code).to.be.oneOf([200]);
if(pm.response.code === 200){
var jsonData = JSON.parse(responseBody);
var sizeOK= 1;
if(jsonData.resources.length>0){
}else{
//I will make the test fail if there is not data available on the response.
pm.test("Response body is empty ", function() {
pm.expect(pm.response.json().resources.length).to.equal(1);
});
}
console.log(Boolean(jsonData.resources.length>1))
}
});
? 응답 본문의 요소에서? –
그냥 0보다 커야합니다. 그런 다음 목록을 반복합니다. – mavi