Pre-req:
const moment = require('moment');
pm.collectionVariables.set("todayDate",moment().format("YYYY-MM-DD"));
pm.collectionVariables.set("todayDate1",(new Date()).toISOString());
pm.collectionVariables.get("todayDate1");
pm.collectionVariables.set("Name","morpheus");
pm.collectionVariables.set("Job","leader");
Tests Code:
var jsonData = pm.response.json();
pm.test("varify name", function(){
pm.expect(jsonData.name).to.eql("morpheus");
});
pm.collectionVariables.set("ID",jsonData.id);
En esta página del sitio puede ver el video en línea API Testing Using Postman Part 15: How to write API test cases in Postman using JavaScript de Duración hora minuto segunda en buena calidad , que subió el usuario Testing Tutorialspoint 01 octubre 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 721 veces y le gustó 16 a los espectadores. Disfruta viendo!