【发布时间】:2020-06-09 08:18:14
【问题描述】:
这是我的意见
{
"AccountId": "9834e8cb-275a-4bff-b362-f216e9653686",
"ContactId": "9834e8cb-275a-4bff-b362-f216e9653686",
"AuthenticationDetails": {
"AuthenticationId": "{{clientId}}",
"AuthenticationType": "Token"
}
}
这是我的输出
{
"orderedByContactId": "36b8e4da-94fd-4680-a2d3-6b128e4b2584",
"orderedForContactId": "9834e8cb-275a-4bff-b362-f216e9653686"
}
我需要创建一个测试(邮递员)以确保输出值(“orderedForContactId”)与输入值(“ContactId”)匹配。有人可以帮帮我吗?
现有的测试格式如下:
pm.test("Response should contain orderedForContactId",function(){
let jsonRespData = pm.response.json();
pm.expect(jsonRespData).to.have.property('orderedForContactId');
});
【问题讨论】:
-
执行现有测试时遇到什么错误?
-
我没有收到错误,我只是不确定如何在测试中确保输入值与输出值匹配。 (我在问题中包含的测试示例正在运行并返回阳性测试结果)。
-
我要做的是创建一个测试,其中“Input-ContactId{value}”=“Output-orderedForContactId{value}”,但不知道如何获取要使用的值他们。
标签: testing automation postman