fix(接口测试): 修复返回结果为空的时候推荐jsonPath提示错误的缺陷
--bug=1033315 --user=王孝刚 【接口测试】github#27779,【接口自动化】接口自动化-复制其他场景进行调试,返回内容为空时,点击“推荐JSONPath断言”,页面会有“请先执行调试获取响应结果”提示 https://www.tapd.cn/55049933/s/1446209
This commit is contained in:
parent
681eaebca0
commit
4cddc43770
|
@ -207,10 +207,14 @@ export default {
|
||||||
suggestJsonOpen() {
|
suggestJsonOpen() {
|
||||||
this.$emit('suggestClick');
|
this.$emit('suggestClick');
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (!this.response || !this.response.responseResult || !this.response.responseResult.body) {
|
if (!this.response || !this.response.responseResult) {
|
||||||
this.$message(this.$t('api_test.request.assertions.debug_first'));
|
this.$message(this.$t('api_test.request.assertions.debug_first'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!this.response.responseResult.body) {
|
||||||
|
this.$message(this.$t('api_test.request.assertions.body_is_null'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$refs.jsonpathSuggest.open(this.response.responseResult.body);
|
this.$refs.jsonpathSuggest.open(this.response.responseResult.body);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -167,10 +167,14 @@ export default {
|
||||||
suggestJsonOpen() {
|
suggestJsonOpen() {
|
||||||
this.$emit('suggestClick');
|
this.$emit('suggestClick');
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (!this.response || !this.response.responseResult || !this.response.responseResult.body) {
|
if (!this.response || !this.response.responseResult) {
|
||||||
this.$message(this.$t('api_test.request.assertions.debug_first'));
|
this.$message(this.$t('api_test.request.assertions.debug_first'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!this.response.responseResult.body) {
|
||||||
|
this.$message(this.$t('api_test.request.assertions.body_is_null'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$refs.jsonpathSuggest.open(this.response.responseResult.body);
|
this.$refs.jsonpathSuggest.open(this.response.responseResult.body);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -188,10 +188,14 @@ export default {
|
||||||
suggestJsonOpen() {
|
suggestJsonOpen() {
|
||||||
this.$emit('suggestClick');
|
this.$emit('suggestClick');
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (!this.response || !this.response.responseResult || !this.response.responseResult.body) {
|
if (!this.response || !this.response.responseResult) {
|
||||||
this.$message(this.$t('api_test.request.assertions.debug_first'));
|
this.$message(this.$t('api_test.request.assertions.debug_first'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!this.response.responseResult.body) {
|
||||||
|
this.$message(this.$t('api_test.request.assertions.body_is_null'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$refs.jsonpathSuggest.open(this.response.responseResult.body);
|
this.$refs.jsonpathSuggest.open(this.response.responseResult.body);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -154,10 +154,14 @@ export default {
|
||||||
suggestJsonOpen() {
|
suggestJsonOpen() {
|
||||||
this.$emit('suggestClick');
|
this.$emit('suggestClick');
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (!this.response || !this.response.responseResult || !this.response.responseResult.body) {
|
if (!this.response || !this.response.responseResult) {
|
||||||
this.$message(this.$t('api_test.request.assertions.debug_first'));
|
this.$message(this.$t('api_test.request.assertions.debug_first'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!this.response.responseResult.body) {
|
||||||
|
this.$message(this.$t('api_test.request.assertions.body_is_null'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$refs.jsonpathSuggest.open(this.response.responseResult.body);
|
this.$refs.jsonpathSuggest.open(this.response.responseResult.body);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -197,10 +197,14 @@ export default {
|
||||||
suggestJsonOpen() {
|
suggestJsonOpen() {
|
||||||
this.$emit('suggestClick');
|
this.$emit('suggestClick');
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (!this.response || !this.response.responseResult || !this.response.responseResult.body) {
|
if (!this.response || !this.response.responseResult) {
|
||||||
this.$message(this.$t('api_test.request.assertions.debug_first'));
|
this.$message(this.$t('api_test.request.assertions.debug_first'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!this.response.responseResult.body) {
|
||||||
|
this.$message(this.$t('api_test.request.assertions.body_is_null'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$refs.jsonpathSuggest.open(this.response.responseResult.body);
|
this.$refs.jsonpathSuggest.open(this.response.responseResult.body);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
@ -169,10 +169,14 @@ export default {
|
||||||
suggestJsonOpen() {
|
suggestJsonOpen() {
|
||||||
this.$emit('suggestClick');
|
this.$emit('suggestClick');
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (!this.response || !this.response.responseResult || !this.response.responseResult.body) {
|
if (!this.response || !this.response.responseResult) {
|
||||||
this.$message(this.$t('api_test.request.assertions.debug_first'));
|
this.$message(this.$t('api_test.request.assertions.debug_first'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!this.response.responseResult.body) {
|
||||||
|
this.$message(this.$t('api_test.request.assertions.body_is_null'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$refs.jsonpathSuggest.open(this.response.responseResult.body);
|
this.$refs.jsonpathSuggest.open(this.response.responseResult.body);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -1933,6 +1933,8 @@ const message = {
|
||||||
json_path_suggest: "JSONPath Assertion Suggest",
|
json_path_suggest: "JSONPath Assertion Suggest",
|
||||||
json_path_clear: "Clear JSONPath Assertion",
|
json_path_clear: "Clear JSONPath Assertion",
|
||||||
debug_first: "First, debug to get the response",
|
debug_first: "First, debug to get the response",
|
||||||
|
body_is_null:
|
||||||
|
"No response data detected, please run the interface and ensure response data is generated",
|
||||||
suggest_tip: "Click the note to add the JSONPath assertion",
|
suggest_tip: "Click the note to add the JSONPath assertion",
|
||||||
regex_info:
|
regex_info:
|
||||||
'Special characters "$ () * +. [] \\ ^ {} |" need to be escaped as "\\ "+"special characters", such as "\\$"',
|
'Special characters "$ () * +. [] \\ ^ {} |" need to be escaped as "\\ "+"special characters", such as "\\$"',
|
||||||
|
|
|
@ -1861,6 +1861,7 @@ const message = {
|
||||||
json_path_suggest: "推荐JSONPath断言",
|
json_path_suggest: "推荐JSONPath断言",
|
||||||
json_path_clear: "清空JSONPath断言",
|
json_path_clear: "清空JSONPath断言",
|
||||||
debug_first: "请先执行调试获取响应结果",
|
debug_first: "请先执行调试获取响应结果",
|
||||||
|
body_is_null: "未检测到响应数据,请运行接口并确保产生了响应数据",
|
||||||
ignore_status: "忽略状态",
|
ignore_status: "忽略状态",
|
||||||
add: "添加",
|
add: "添加",
|
||||||
script_name: "脚本名称",
|
script_name: "脚本名称",
|
||||||
|
|
|
@ -1860,6 +1860,7 @@ const message = {
|
||||||
json_path_suggest: "推薦JSONPath斷言",
|
json_path_suggest: "推薦JSONPath斷言",
|
||||||
json_path_clear: "清空JSONPath斷言",
|
json_path_clear: "清空JSONPath斷言",
|
||||||
debug_first: "請先執行調試獲取響應結果",
|
debug_first: "請先執行調試獲取響應結果",
|
||||||
|
body_is_null: "未檢測到響應數據,請運行介面並確保產生了響應數據",
|
||||||
ignore_status: "忽略狀態",
|
ignore_status: "忽略狀態",
|
||||||
add: "添加",
|
add: "添加",
|
||||||
script_name: "腳本名稱",
|
script_name: "腳本名稱",
|
||||||
|
|
Loading…
Reference in New Issue