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);
На этой странице сайта вы можете посмотреть видео онлайн API Testing Using Postman Part 15: How to write API test cases in Postman using JavaScript длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Testing Tutorialspoint 01 Октябрь 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 721 раз и оно понравилось 16 зрителям. Приятного просмотра!