test 内容
var data = JSON.parse(responseBody);
if (data.token) {
tests["Body has token"] = true;
postman.setEnvironmentVariable("token", data.token);
}
else {
tests["Body has token"] = false;
}
添加环境
{{token}} 取值
test 内容
var data = JSON.parse(responseBody);
if (data.token) {
tests["Body has token"] = true;
postman.setEnvironmentVariable("token", data.token);
}
else {
tests["Body has token"] = false;
}
添加环境
{{token}} 取值