refactor(接口测试): 没有可用请求时提示
This commit is contained in:
parent
e8ee29da09
commit
205f4ce4ed
|
@ -157,6 +157,10 @@ export default {
|
||||||
this.$warning(this.$t(validator.info));
|
this.$warning(this.$t(validator.info));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!this.validateEnableTest()) {
|
||||||
|
this.$warning(this.$t('api_test.enable_validate_tip'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.change = false;
|
this.change = false;
|
||||||
let bodyFiles = this.getBodyUploadFiles();
|
let bodyFiles = this.getBodyUploadFiles();
|
||||||
let url = this.create ? "/api/create" : "/api/update";
|
let url = this.create ? "/api/create" : "/api/update";
|
||||||
|
@ -214,7 +218,6 @@ export default {
|
||||||
item.id = fileId;
|
item.id = fileId;
|
||||||
this.test.bodyUploadIds.push(fileId);
|
this.test.bodyUploadIds.push(fileId);
|
||||||
bodyUploadFiles.push(item.file);
|
bodyUploadFiles.push(item.file);
|
||||||
// item.file = undefined;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -224,6 +227,18 @@ export default {
|
||||||
});
|
});
|
||||||
return bodyUploadFiles;
|
return bodyUploadFiles;
|
||||||
},
|
},
|
||||||
|
validateEnableTest() {
|
||||||
|
for (let scenario of this.test.scenarioDefinition) {
|
||||||
|
if (scenario.enable) {
|
||||||
|
for (let request of scenario.requests) {
|
||||||
|
if (request.enable) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
resetBodyFile() {
|
resetBodyFile() {
|
||||||
//下次保存不再上传已传文件
|
//下次保存不再上传已传文件
|
||||||
this.test.scenarioDefinition.forEach(scenario => {
|
this.test.scenarioDefinition.forEach(scenario => {
|
||||||
|
|
|
@ -377,6 +377,7 @@ export default {
|
||||||
value: "Value",
|
value: "Value",
|
||||||
create_performance_test: "Create Performance Test",
|
create_performance_test: "Create Performance Test",
|
||||||
export_config: "Export",
|
export_config: "Export",
|
||||||
|
enable_validate_tip: "No request available",
|
||||||
environment: {
|
environment: {
|
||||||
name: "Environment Name",
|
name: "Environment Name",
|
||||||
socket: "Socket",
|
socket: "Socket",
|
||||||
|
|
|
@ -378,6 +378,7 @@ export default {
|
||||||
value: "值",
|
value: "值",
|
||||||
create_performance_test: "创建性能测试",
|
create_performance_test: "创建性能测试",
|
||||||
export_config: "导出",
|
export_config: "导出",
|
||||||
|
enable_validate_tip: "没有可用请求",
|
||||||
environment: {
|
environment: {
|
||||||
name: "环境名称",
|
name: "环境名称",
|
||||||
socket: "环境域名",
|
socket: "环境域名",
|
||||||
|
|
|
@ -376,6 +376,7 @@ export default {
|
||||||
value: "值",
|
value: "值",
|
||||||
create_performance_test: "創建性能測試",
|
create_performance_test: "創建性能測試",
|
||||||
export_config: "匯出",
|
export_config: "匯出",
|
||||||
|
enable_validate_tip: "沒有可用請求",
|
||||||
environment: {
|
environment: {
|
||||||
name: "環境名稱",
|
name: "環境名稱",
|
||||||
socket: "環境域名",
|
socket: "環境域名",
|
||||||
|
|
Loading…
Reference in New Issue