fix(接口定义): 修复tcp执行没有提示选择环境的缺陷
--bug=1017749 --user=王孝刚 【接口测试】tcp接口用例没有环境,执行的时候没有提示选环境 https://www.tapd.cn/55049933/s/1281609
This commit is contained in:
parent
51c571a3ae
commit
6a1b922005
|
@ -482,13 +482,13 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
singleRun(data) {
|
singleRun(data) {
|
||||||
let methods = ["SQL", "DUBBO", "dubbo://", "TCP"];
|
let methods = ['SQL', 'DUBBO', 'dubbo://'];
|
||||||
if (data.apiMethod && methods.indexOf(data.apiMethod) === -1 && (!this.environment || this.environment === undefined)) {
|
if (data.apiMethod && methods.indexOf(data.apiMethod) === -1 && (!this.environment || this.environment === undefined)) {
|
||||||
this.$warning(this.$t('api_test.environment.select_environment'));
|
this.$warning(this.$t('api_test.environment.select_environment'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mergeRequestDocumentData(data.request);
|
mergeRequestDocumentData(data.request);
|
||||||
if (data.apiMethod !== "SQL" && data.apiMethod !== "DUBBO" && data.apiMethod !== "dubbo://" && data.apiMethod !== "TCP") {
|
if (data.apiMethod !== 'SQL' && data.apiMethod !== 'DUBBO' && data.apiMethod !== 'dubbo://') {
|
||||||
data.request.useEnvironment = this.environment;
|
data.request.useEnvironment = this.environment;
|
||||||
} else {
|
} else {
|
||||||
data.request.useEnvironment = data.request.environmentId;
|
data.request.useEnvironment = data.request.environmentId;
|
||||||
|
@ -504,7 +504,7 @@ export default {
|
||||||
let request = JSON.parse(JSON.stringify(data.request));
|
let request = JSON.parse(JSON.stringify(data.request));
|
||||||
request.id = uuid;
|
request.id = uuid;
|
||||||
let obj = {
|
let obj = {
|
||||||
name: "copy_" + data.name,
|
name: 'copy_' + data.name,
|
||||||
priority: data.priority,
|
priority: data.priority,
|
||||||
active: true,
|
active: true,
|
||||||
tags: data.tags,
|
tags: data.tags,
|
||||||
|
|
|
@ -553,7 +553,7 @@ export default {
|
||||||
active: true,
|
active: true,
|
||||||
tags: [],
|
tags: [],
|
||||||
uuid: newUuid,
|
uuid: newUuid,
|
||||||
caseStatus: "Underway",
|
caseStatus: 'Underway',
|
||||||
type: 'AddCase'
|
type: 'AddCase'
|
||||||
};
|
};
|
||||||
request.projectId = getCurrentProjectID();
|
request.projectId = getCurrentProjectID();
|
||||||
|
@ -574,7 +574,7 @@ export default {
|
||||||
this.$emit('showExecResult', row);
|
this.$emit('showExecResult', row);
|
||||||
},
|
},
|
||||||
singleRun(row) {
|
singleRun(row) {
|
||||||
let methods = ["SQL", "DUBBO", "dubbo://", "TCP"];
|
let methods = ['SQL', 'DUBBO', 'dubbo://'];
|
||||||
if (row.apiMethod && methods.indexOf(row.apiMethod) === -1 && (!this.environment || this.environment === undefined)) {
|
if (row.apiMethod && methods.indexOf(row.apiMethod) === -1 && (!this.environment || this.environment === undefined)) {
|
||||||
this.$warning(this.$t('api_test.environment.select_environment'));
|
this.$warning(this.$t('api_test.environment.select_environment'));
|
||||||
return;
|
return;
|
||||||
|
@ -583,7 +583,7 @@ export default {
|
||||||
this.singleLoading = true;
|
this.singleLoading = true;
|
||||||
this.singleRunId = row.id;
|
this.singleRunId = row.id;
|
||||||
row.request.name = row.id;
|
row.request.name = row.id;
|
||||||
if (row.apiMethod !== "SQL" && row.apiMethod !== "DUBBO" && row.apiMethod !== "dubbo://") {
|
if (row.apiMethod !== 'SQL' && row.apiMethod !== 'DUBBO' && row.apiMethod !== 'dubbo://') {
|
||||||
row.request.useEnvironment = this.environment;
|
row.request.useEnvironment = this.environment;
|
||||||
} else {
|
} else {
|
||||||
row.request.useEnvironment = row.request.environmentId;
|
row.request.useEnvironment = row.request.environmentId;
|
||||||
|
@ -595,13 +595,13 @@ export default {
|
||||||
/*触发执行操作*/
|
/*触发执行操作*/
|
||||||
this.reportId = getUUID().substring(0, 8);
|
this.reportId = getUUID().substring(0, 8);
|
||||||
this.testCaseId = row.id ? row.id : row.request.id;
|
this.testCaseId = row.id ? row.id : row.request.id;
|
||||||
this.$emit("refreshCase", this.testCaseId);
|
this.$emit('refreshCase', this.testCaseId);
|
||||||
},
|
},
|
||||||
|
|
||||||
stop(id) {
|
stop(id) {
|
||||||
let obj = {type: "API", reportId: this.reportId};
|
let obj = {type: 'API', reportId: this.reportId};
|
||||||
execBatchStop([obj]).then(response => {
|
execBatchStop([obj]).then(response => {
|
||||||
this.$emit("stop", id);
|
this.$emit('stop', id);
|
||||||
this.singleLoading = false;
|
this.singleLoading = false;
|
||||||
this.$success(this.$t('report.test_stop_success'));
|
this.$success(this.$t('report.test_stop_success'));
|
||||||
});
|
});
|
||||||
|
@ -639,7 +639,8 @@ export default {
|
||||||
.ms-drawer :deep(.ms-drawer-body) {
|
.ms-drawer :deep(.ms-drawer-body) {
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
}
|
}
|
||||||
.ms-drawer-case-header :deep(.ms-drawer-header){
|
|
||||||
|
.ms-drawer-case-header :deep(.ms-drawer-header) {
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue