DT
Size: a a a
DT
NV
const jsonBody = pm.response.json();
const objectsArray = [];
jsonBody.forEach(object => {
const item = {
uicId: object.uicId,
id: object.id,
};
objectsArray.push(item);
}
pm.collectionVariables.set('objectsArray', JSON.stringify(objects array);
Second Tests tab:const jsonBody = pm.response.json();
const firstResponseArray = JSON.parse(pm.collectionVariables.get('objectsArray'));
uuicId matches for id ${object.id}
`, () => {NV
MZ
S
S
S
NV
const jsonBody = pm.response.json();
const property1 = 'A';
const property2 = 'Б';
if (jsonBody.hasOwnProperty(property1) {
pm.expect(jsonBody[property1]).to.eql(1);
}
if (jsonBody.hasOwnProperty(property2) {
pm.expect(jsonBody[property2]).to.eql(2);
}
NV
const jsonBody = pm.response.json();
const property1 = 'A';
const property2 = 'Б';
tests['А or Б'] = jsonBody[property1] === 1 || jsonBody[property2] === 2;
NV
H
pm.test("Data should be empty", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.data).to.be.an("object").that.is.empty; // или pm.expect(jsonData.data).to.be.an("array").that.is.empty;
});
YR
S
S
pm.test("Data should be empty", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.data).to.be.an("object").that.is.empty; // или pm.expect(jsonData.data).to.be.an("array").that.is.empty;
});
.data
я убрал, с ним не работал, мы же уже задали jsonData через var, откуда .data?S
resp
jsonData, который я задал var jsonData = pm.response.json(); Но что-то не прошлоYR
resp
jsonData, который я задал var jsonData = pm.response.json(); Но что-то не прошлоS