fix(接口测试): 修复执行测试用例显示测试中,无法停止问题

--bug=1009232 --user=赵勇 【接口测试】执行测试用例还是一直执行中【+github#8807】 https://www.tapd.cn/55049933/s/1087011
This commit is contained in:
fit2-zhao 2021-12-27 10:10:42 +08:00 committed by fit2-zhao
parent b3427b0714
commit 6a89622f5e
3 changed files with 125 additions and 127 deletions

View File

@ -60,7 +60,7 @@ export default {
if (this.apiItem && this.apiItem.id) {
let url = "/api/definition/report/getReport/" + this.apiItem.id;
this.$get(url, response => {
if (response.data) {
if (response.data && response.data.content) {
try {
let data = JSON.parse(response.data.content);
this.response = data;

View File

@ -23,7 +23,7 @@ export default {
return {
result: {},
loading: false,
requestResult: {},
requestResult: {responseResult: {}},
reqNumber: 0,
websocket: {}
}
@ -123,6 +123,7 @@ export default {
threadGroup.hashTree.push(item);
})
this.sort(testPlan.hashTree);
this.requestResult.reportId = this.reportId;
let reqObj = {id: this.reportId, testElement: testPlan, type: this.type, clazzName: this.clazzName ? this.clazzName : TYPE_TO_C.get(this.type), projectId: projectId, environmentMap: strMapToObj(this.envMap)};
let bodyFiles = getBodyUploadFiles(reqObj, this.runData);
if (this.runData[0].url) {

View File

@ -1,6 +1,5 @@
<template>
<div class="text-container">
<div class="text-container" v-if="responseResult">
<el-tabs v-model="activeName" v-show="isActive">
<el-tab-pane :label="$t('api_test.definition.request.response_body')" name="body" class="pane">
<ms-sql-result-table v-if="isSqlType" :body="responseResult.body"/>
@ -84,10 +83,8 @@
this.mode = mode;
},
setBodyType() {
if (!this.response.responseResult || !this.response.responseResult.headers) {
return;
}
if (this.response.responseResult.headers.indexOf("Content-Type: application/json") > 0) {
if (this.response && this.response.responseResult && this.response.responseResult.headers
&& this.response.responseResult.headers.indexOf("Content-Type: application/json") > 0) {
this.mode = BODY_FORMAT.JSON;
this.$nextTick(() => {
if (this.$refs.modeDropdown) {