サイズが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