feat(接口测试): 接口保留最后一次测试结果并回显
--story=1010697 --user=赵勇 接口TEST保留最近一次测试记录 https://www.tapd.cn/55049933/s/1320069
This commit is contained in:
parent
02641e86c0
commit
5018215989
|
@ -24,11 +24,8 @@ public interface ExtApiDefinitionExecResultMapper {
|
||||||
|
|
||||||
ApiDefinitionExecResultWithBLOBs selectMaxResultByResourceIdAndType(String resourceId, String type);
|
ApiDefinitionExecResultWithBLOBs selectMaxResultByResourceIdAndType(String resourceId, String type);
|
||||||
|
|
||||||
|
|
||||||
long countByProjectIDAndCreateInThisWeek(@Param("projectId") String projectId, @Param("version") String version, @Param("firstDayTimestamp") long firstDayTimestamp, @Param("lastDayTimestamp") long lastDayTimestamp);
|
long countByProjectIDAndCreateInThisWeek(@Param("projectId") String projectId, @Param("version") String version, @Param("firstDayTimestamp") long firstDayTimestamp, @Param("lastDayTimestamp") long lastDayTimestamp);
|
||||||
|
|
||||||
long countByTestCaseIDInProject(String projectId);
|
|
||||||
|
|
||||||
List<ExecutedCaseInfoResult> findFailureCaseInTestPlanByProjectIDAndExecuteTimeAndLimitNumber(@Param("projectId") String projectId, @Param("versionId") String version, @Param("selectFunctionCase") boolean selectFunctionCase, @Param("startTimestamp") long startTimestamp, @Param("limitNumber") int limitNumber);
|
List<ExecutedCaseInfoResult> findFailureCaseInTestPlanByProjectIDAndExecuteTimeAndLimitNumber(@Param("projectId") String projectId, @Param("versionId") String version, @Param("selectFunctionCase") boolean selectFunctionCase, @Param("startTimestamp") long startTimestamp, @Param("limitNumber") int limitNumber);
|
||||||
|
|
||||||
String selectExecResult(String resourceId);
|
String selectExecResult(String resourceId);
|
||||||
|
@ -37,8 +34,6 @@ public interface ExtApiDefinitionExecResultMapper {
|
||||||
|
|
||||||
List<ApiDefinitionExecResult> selectStatusByIdList(@Param("ids") Collection<String> values);
|
List<ApiDefinitionExecResult> selectStatusByIdList(@Param("ids") Collection<String> values);
|
||||||
|
|
||||||
List<ApiDefinitionExecResult> selectApiResultByProjectId(String projectId);
|
|
||||||
|
|
||||||
void update(@Param("ids") List<String> ids);
|
void update(@Param("ids") List<String> ids);
|
||||||
|
|
||||||
@InsertProvider(type = ExtApiDefinitionExecResultProvider.class, method = "insertListSql")
|
@InsertProvider(type = ExtApiDefinitionExecResultProvider.class, method = "insertListSql")
|
||||||
|
|
|
@ -33,22 +33,6 @@
|
||||||
AND create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
|
AND create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="countByTestCaseIDInProject" resultType="java.lang.Long">
|
|
||||||
SELECT count(id) AS countNumber
|
|
||||||
FROM api_case_execution_info
|
|
||||||
WHERE source_id IN (
|
|
||||||
SELECT testCase.id
|
|
||||||
FROM api_test_case testCase
|
|
||||||
WHERE testCase.project_id = #{projectId}
|
|
||||||
)
|
|
||||||
OR source_id IN (SELECT id
|
|
||||||
FROM test_plan_api_case
|
|
||||||
WHERE api_case_id IN (
|
|
||||||
SELECT testCase.id
|
|
||||||
FROM api_test_case testCase
|
|
||||||
WHERE testCase.project_id = #{projectId}))
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectDistinctStatusByReportId" resultType="java.lang.String">
|
<select id="selectDistinctStatusByReportId" resultType="java.lang.String">
|
||||||
SELECT DISTINCT status
|
SELECT DISTINCT status
|
||||||
FROM api_definition_exec_result
|
FROM api_definition_exec_result
|
||||||
|
@ -181,19 +165,6 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectApiResultByProjectId" resultType="io.metersphere.base.domain.ApiDefinitionExecResult">
|
|
||||||
select *
|
|
||||||
from api_definition_exec_result t
|
|
||||||
left join `user` t1 ON t.user_id = t1.id
|
|
||||||
left join test_resource_pool t2 on t.actuator = t2.id
|
|
||||||
left join api_definition t3 on t.resource_id = t3.id
|
|
||||||
left join api_test_case t4 on t4.id = t.resource_id
|
|
||||||
left join test_plan_api_case t5 on t.resource_id = t5.id
|
|
||||||
left join test_plan t6 on t5.test_plan_id = t6.id
|
|
||||||
where to_days(FROM_UNIXTIME(t.create_time / 1000)) = to_days(now())
|
|
||||||
and (t3.project_id = #{projectId} OR t4.project_id = #{projectId} OR t6.project_id = #{projectId})
|
|
||||||
and t.`status` in ('RUNNING', 'PENDING')
|
|
||||||
</select>
|
|
||||||
<select id="selectForPlanReport" resultType="io.metersphere.dto.PlanReportCaseDTO">
|
<select id="selectForPlanReport" resultType="io.metersphere.dto.PlanReportCaseDTO">
|
||||||
select status from api_definition_exec_result
|
select status from api_definition_exec_result
|
||||||
where id in
|
where id in
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
package io.metersphere.controller.definition;
|
package io.metersphere.controller.definition;
|
||||||
|
|
||||||
import io.metersphere.service.definition.ApiDefinitionExecResultService;
|
import io.metersphere.base.domain.ApiDefinitionExecResultWithBLOBs;
|
||||||
import io.metersphere.dto.PlanReportCaseDTO;
|
import io.metersphere.dto.PlanReportCaseDTO;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import io.metersphere.service.definition.ApiDefinitionExecResultService;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -27,4 +25,9 @@ public class ApiDefinitionExecResultController {
|
||||||
public Map<String, String> selectReportResultByReportIds(@RequestBody List<String> apiReportIds) {
|
public Map<String, String> selectReportResultByReportIds(@RequestBody List<String> apiReportIds) {
|
||||||
return apiDefinitionExecResultService.selectReportResultByReportIds(apiReportIds);
|
return apiDefinitionExecResultService.selectReportResultByReportIds(apiReportIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/last-result/{resourceId}")
|
||||||
|
public ApiDefinitionExecResultWithBLOBs selectLastResult(@PathVariable String resourceId) {
|
||||||
|
return apiDefinitionExecResultService.getLastResult(resourceId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -477,4 +477,8 @@ public class ApiDefinitionExecResultService {
|
||||||
public void updateByExampleSelective(ApiDefinitionExecResultWithBLOBs resultWithBLOBs, ApiDefinitionExecResultExample resultExample) {
|
public void updateByExampleSelective(ApiDefinitionExecResultWithBLOBs resultWithBLOBs, ApiDefinitionExecResultExample resultExample) {
|
||||||
apiDefinitionExecResultMapper.updateByExampleSelective(resultWithBLOBs, resultExample);
|
apiDefinitionExecResultMapper.updateByExampleSelective(resultWithBLOBs, resultExample);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ApiDefinitionExecResultWithBLOBs getLastResult(String testId) {
|
||||||
|
return extApiDefinitionExecResultMapper.selectMaxResultByResourceId(testId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,3 +9,18 @@ export function getApiReportDetail(id) {
|
||||||
let url = '/api/definition/report/get/' + id;
|
let url = '/api/definition/report/get/' + id;
|
||||||
return get(url);
|
return get(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getLastResult(id) {
|
||||||
|
return get(`/api/definition/exec/result/last-result/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getLastResultDetail(id, _this) {
|
||||||
|
if (id) {
|
||||||
|
getLastResult(id).then((response) => {
|
||||||
|
if (response.data && response.data.content) {
|
||||||
|
let data = JSON.parse(response.data.content);
|
||||||
|
_this.responseData = data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -67,7 +67,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getApiReportDetail } from '@/api/definition-report';
|
|
||||||
import MsResponseResult from '../response/ResponseResult';
|
import MsResponseResult from '../response/ResponseResult';
|
||||||
import MsRequestMetric from '../response/RequestMetric';
|
import MsRequestMetric from '../response/RequestMetric';
|
||||||
import { getUUID } from 'metersphere-frontend/src/utils';
|
import { getUUID } from 'metersphere-frontend/src/utils';
|
||||||
|
@ -120,7 +119,6 @@ export default {
|
||||||
options: [],
|
options: [],
|
||||||
responseData: { type: 'TCP', responseResult: {}, subRequestResults: [] },
|
responseData: { type: 'TCP', responseResult: {}, subRequestResults: [] },
|
||||||
loading: false,
|
loading: false,
|
||||||
debugResultId: '',
|
|
||||||
runData: [],
|
runData: [],
|
||||||
headers: [],
|
headers: [],
|
||||||
reportId: '',
|
reportId: '',
|
||||||
|
@ -130,33 +128,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.testCase) {
|
this.request = createComponent('DubboSampler');
|
||||||
if (this.testCase.id) {
|
|
||||||
// 执行结果信息
|
|
||||||
getApiReportDetail(this.testCase.id).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
let data = JSON.parse(response.data.content);
|
|
||||||
this.responseData = data;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.request = this.testCase.request;
|
|
||||||
if (this.request) {
|
|
||||||
this.debugForm.method = this.request.method;
|
|
||||||
if (this.request.url) {
|
|
||||||
this.debugForm.url = this.request.url;
|
|
||||||
} else {
|
|
||||||
this.debugForm.url = this.request.path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.request = createComponent('DubboSampler');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
debugResultId() {
|
|
||||||
this.getResult();
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleCommand(e) {
|
handleCommand(e) {
|
||||||
|
|
|
@ -90,7 +90,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getApiReportDetail } from '@/api/definition-report';
|
|
||||||
import MsApiRequestForm from '../request/http/ApiHttpRequestForm';
|
import MsApiRequestForm from '../request/http/ApiHttpRequestForm';
|
||||||
import MsResponseResult from '../response/ResponseResult';
|
import MsResponseResult from '../response/ResponseResult';
|
||||||
import MsRequestMetric from '../response/RequestMetric';
|
import MsRequestMetric from '../response/RequestMetric';
|
||||||
|
@ -109,7 +108,7 @@ import { mergeRequestDocumentData } from '@/business/definition/api-definition';
|
||||||
import { execStop } from '@/api/scenario';
|
import { execStop } from '@/api/scenario';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ApiConfig',
|
name: 'DebugHttpPage',
|
||||||
components: {
|
components: {
|
||||||
MsRequestResultTail,
|
MsRequestResultTail,
|
||||||
MsResponseResult,
|
MsResponseResult,
|
||||||
|
@ -125,14 +124,6 @@ export default {
|
||||||
scenario: Boolean,
|
scenario: Boolean,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
let validateURL = (rule, value, callback) => {
|
|
||||||
try {
|
|
||||||
new URL(this.debugForm.url);
|
|
||||||
callback();
|
|
||||||
} catch (e) {
|
|
||||||
callback(this.$t('api_test.request.url_invalid'));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return {
|
return {
|
||||||
rules: {
|
rules: {
|
||||||
method: [
|
method: [
|
||||||
|
@ -149,16 +140,12 @@ export default {
|
||||||
message: this.$t('commons.input_limit', [1, 500]),
|
message: this.$t('commons.input_limit', [1, 500]),
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
/*
|
|
||||||
{validator: validateURL, trigger: 'blur'}
|
|
||||||
*/
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
debugForm: { method: REQ_METHOD[0].id, environmentId: '' },
|
debugForm: { method: REQ_METHOD[0].id, environmentId: '' },
|
||||||
options: [],
|
options: [],
|
||||||
responseData: { type: 'HTTP', responseResult: {}, subRequestResults: [] },
|
responseData: { type: 'HTTP', responseResult: {}, subRequestResults: [] },
|
||||||
loading: false,
|
loading: false,
|
||||||
debugResultId: '',
|
|
||||||
runData: [],
|
runData: [],
|
||||||
reportId: '',
|
reportId: '',
|
||||||
reqOptions: REQ_METHOD,
|
reqOptions: REQ_METHOD,
|
||||||
|
@ -168,33 +155,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.testCase) {
|
this.createHttp();
|
||||||
if (this.testCase.id) {
|
|
||||||
// 执行结果信息
|
|
||||||
getApiReportDetail(this.testCase.id).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
let data = JSON.parse(response.data.content);
|
|
||||||
this.responseData = data;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.request = this.testCase.request;
|
|
||||||
if (this.request) {
|
|
||||||
this.debugForm.method = this.request.method;
|
|
||||||
if (this.request.url) {
|
|
||||||
this.debugForm.url = this.request.url;
|
|
||||||
} else {
|
|
||||||
this.debugForm.url = this.request.path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.createHttp();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
debugResultId() {
|
|
||||||
this.getResult();
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
hasPermission,
|
hasPermission,
|
||||||
|
|
|
@ -68,7 +68,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getApiReportDetail } from '@/api/definition-report';
|
|
||||||
import MsResponseResult from '../response/ResponseResult';
|
import MsResponseResult from '../response/ResponseResult';
|
||||||
import MsRequestMetric from '../response/RequestMetric';
|
import MsRequestMetric from '../response/RequestMetric';
|
||||||
import { getUUID } from 'metersphere-frontend/src/utils';
|
import { getUUID } from 'metersphere-frontend/src/utils';
|
||||||
|
@ -123,7 +122,6 @@ export default {
|
||||||
options: [],
|
options: [],
|
||||||
responseData: { type: 'JDBC', responseResult: {}, subRequestResults: [] },
|
responseData: { type: 'JDBC', responseResult: {}, subRequestResults: [] },
|
||||||
loading: false,
|
loading: false,
|
||||||
debugResultId: '',
|
|
||||||
runData: [],
|
runData: [],
|
||||||
headers: [],
|
headers: [],
|
||||||
reportId: '',
|
reportId: '',
|
||||||
|
@ -133,37 +131,11 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.testCase) {
|
this.request = createComponent('JDBCSampler');
|
||||||
if (this.testCase.id) {
|
|
||||||
// 执行结果信息
|
|
||||||
getApiReportDetail(this.testCase.id).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
let data = JSON.parse(response.data.content);
|
|
||||||
this.responseData = data;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.request = this.testCase.request;
|
|
||||||
if (this.request) {
|
|
||||||
this.debugForm.method = this.request.method;
|
|
||||||
if (this.request.url) {
|
|
||||||
this.debugForm.url = this.request.url;
|
|
||||||
} else {
|
|
||||||
this.debugForm.url = this.request.path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.request = createComponent('JDBCSampler');
|
|
||||||
}
|
|
||||||
if (!this.request.environmentId) {
|
if (!this.request.environmentId) {
|
||||||
this.request.environmentId = store.useEnvironment;
|
this.request.environmentId = store.useEnvironment;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
debugResultId() {
|
|
||||||
this.getResult();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
handleCommand(e) {
|
handleCommand(e) {
|
||||||
mergeRequestDocumentData(this.request);
|
mergeRequestDocumentData(this.request);
|
||||||
|
|
|
@ -125,7 +125,6 @@ export default {
|
||||||
options: [],
|
options: [],
|
||||||
responseData: { type: 'TCP', responseResult: {}, subRequestResults: [] },
|
responseData: { type: 'TCP', responseResult: {}, subRequestResults: [] },
|
||||||
loading: false,
|
loading: false,
|
||||||
debugResultId: '',
|
|
||||||
runData: [],
|
runData: [],
|
||||||
headers: [],
|
headers: [],
|
||||||
reportId: '',
|
reportId: '',
|
||||||
|
@ -135,33 +134,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.testCase) {
|
this.request = createComponent('TCPSampler');
|
||||||
if (this.testCase.id) {
|
|
||||||
// 执行结果信息
|
|
||||||
getApiReportDetail(this.testCase.id).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
let data = JSON.parse(response.data.content);
|
|
||||||
this.responseData = data;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.request = this.testCase.request;
|
|
||||||
if (this.request) {
|
|
||||||
this.debugForm.method = this.request.method;
|
|
||||||
if (this.request.url) {
|
|
||||||
this.debugForm.url = this.request.url;
|
|
||||||
} else {
|
|
||||||
this.debugForm.url = this.request.path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.request = createComponent('TCPSampler');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
debugResultId() {
|
|
||||||
this.getResult();
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleCommand(e) {
|
handleCommand(e) {
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { updateDefinition } from '@/api/definition';
|
import { updateDefinition } from '@/api/definition';
|
||||||
import { getApiReportDetail } from '@/api/definition-report';
|
import { getLastResultDetail } from '@/api/definition-report';
|
||||||
import { versionEnableByProjectId } from '@/api/xpack';
|
import { versionEnableByProjectId } from '@/api/xpack';
|
||||||
import { getUUID } from 'metersphere-frontend/src/utils';
|
import { getUUID } from 'metersphere-frontend/src/utils';
|
||||||
import { hasLicense } from 'metersphere-frontend/src/utils/permission';
|
import { hasLicense } from 'metersphere-frontend/src/utils/permission';
|
||||||
|
@ -310,16 +310,6 @@ export default {
|
||||||
environmentConfigClose() {
|
environmentConfigClose() {
|
||||||
this.getEnvironments();
|
this.getEnvironments();
|
||||||
},
|
},
|
||||||
getResult() {
|
|
||||||
if (this.api.id) {
|
|
||||||
getApiReportDetail(this.api.id).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
let data = JSON.parse(response.data.content);
|
|
||||||
this.responseData = data;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
stop() {
|
stop() {
|
||||||
execStop(this.reportId).then(() => {
|
execStop(this.reportId).then(() => {
|
||||||
this.runLoading = false;
|
this.runLoading = false;
|
||||||
|
@ -345,22 +335,13 @@ export default {
|
||||||
this.currentRequest = this.api.request;
|
this.currentRequest = this.api.request;
|
||||||
this.runLoading = false;
|
this.runLoading = false;
|
||||||
this.getEnvironments();
|
this.getEnvironments();
|
||||||
this.getResult();
|
getLastResultDetail(this.api.id, this);
|
||||||
this.checkVersionEnable();
|
this.checkVersionEnable();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.ms-htt-width {
|
|
||||||
width: 350px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.environment-button {
|
|
||||||
margin-left: 20px;
|
|
||||||
padding: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-drawer) {
|
:deep(.el-drawer) {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getMockEnvironment, updateDefinition } from '@/api/definition';
|
import { getMockEnvironment, updateDefinition } from '@/api/definition';
|
||||||
import { getApiReportDetail } from '@/api/definition-report';
|
import { getLastResultDetail } from '@/api/definition-report';
|
||||||
import { versionEnableByProjectId } from '@/api/xpack';
|
import { versionEnableByProjectId } from '@/api/xpack';
|
||||||
import MsApiRequestForm from '../request/http/ApiHttpRequestForm';
|
import MsApiRequestForm from '../request/http/ApiHttpRequestForm';
|
||||||
import { hasLicense, hasPermission } from 'metersphere-frontend/src/utils/permission';
|
import { hasLicense, hasPermission } from 'metersphere-frontend/src/utils/permission';
|
||||||
|
@ -414,16 +414,6 @@ export default {
|
||||||
refresh() {
|
refresh() {
|
||||||
this.$emit('refresh');
|
this.$emit('refresh');
|
||||||
},
|
},
|
||||||
getResult() {
|
|
||||||
if (this.api.id) {
|
|
||||||
getApiReportDetail(this.api.id).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
let data = JSON.parse(response.data.content);
|
|
||||||
this.responseData = data;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
stop() {
|
stop() {
|
||||||
execStop(this.reportId).then(() => {
|
execStop(this.reportId).then(() => {
|
||||||
this.runLoading = false;
|
this.runLoading = false;
|
||||||
|
@ -450,6 +440,7 @@ export default {
|
||||||
if (!this.api.environmentId && store.useEnvironment) {
|
if (!this.api.environmentId && store.useEnvironment) {
|
||||||
this.api.environmentId = store.useEnvironment;
|
this.api.environmentId = store.useEnvironment;
|
||||||
}
|
}
|
||||||
|
getLastResultDetail(this.api.id, this);
|
||||||
this.runLoading = false;
|
this.runLoading = false;
|
||||||
this.checkVersionEnable();
|
this.checkVersionEnable();
|
||||||
},
|
},
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { updateDefinition } from '@/api/definition';
|
import { updateDefinition } from '@/api/definition';
|
||||||
import { getApiReportDetail } from '@/api/definition-report';
|
import { getLastResultDetail } from '@/api/definition-report';
|
||||||
import { versionEnableByProjectId } from '@/api/xpack';
|
import { versionEnableByProjectId } from '@/api/xpack';
|
||||||
import { hasLicense } from 'metersphere-frontend/src/utils/permission';
|
import { hasLicense } from 'metersphere-frontend/src/utils/permission';
|
||||||
import { getUUID } from 'metersphere-frontend/src/utils';
|
import { getUUID } from 'metersphere-frontend/src/utils';
|
||||||
|
@ -310,16 +310,6 @@ export default {
|
||||||
environmentConfigClose() {
|
environmentConfigClose() {
|
||||||
this.getEnvironments();
|
this.getEnvironments();
|
||||||
},
|
},
|
||||||
getResult() {
|
|
||||||
if (this.api.id) {
|
|
||||||
getApiReportDetail(this.api.id).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
let data = JSON.parse(response.data.content);
|
|
||||||
this.responseData = data;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
stop() {
|
stop() {
|
||||||
execStop(this.reportId).then(() => {
|
execStop(this.reportId).then(() => {
|
||||||
this.runLoading = false;
|
this.runLoading = false;
|
||||||
|
@ -351,7 +341,7 @@ export default {
|
||||||
}
|
}
|
||||||
this.runLoading = false;
|
this.runLoading = false;
|
||||||
this.getEnvironments();
|
this.getEnvironments();
|
||||||
this.getResult();
|
getLastResultDetail(this.api.id, this);
|
||||||
this.checkVersionEnable();
|
this.checkVersionEnable();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getMockEnvironment, updateDefinition } from '@/api/definition';
|
import { getMockEnvironment, updateDefinition } from '@/api/definition';
|
||||||
import { getApiReportDetail } from '@/api/definition-report';
|
import { getLastResultDetail } from '@/api/definition-report';
|
||||||
import { versionEnableByProjectId } from '@/api/xpack';
|
import { versionEnableByProjectId } from '@/api/xpack';
|
||||||
import MsApiRequestForm from '../request/http/ApiHttpRequestForm';
|
import MsApiRequestForm from '../request/http/ApiHttpRequestForm';
|
||||||
import { hasLicense } from 'metersphere-frontend/src/utils/permission';
|
import { hasLicense } from 'metersphere-frontend/src/utils/permission';
|
||||||
|
@ -316,14 +316,6 @@ export default {
|
||||||
this.api.request = this.currentRequest;
|
this.api.request = this.currentRequest;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getResult() {
|
|
||||||
getApiReportDetail(this.api.id).then((response) => {
|
|
||||||
if (response.data) {
|
|
||||||
let data = JSON.parse(response.data.content);
|
|
||||||
this.responseData = data;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
stop() {
|
stop() {
|
||||||
execStop(this.reportId).then(() => {
|
execStop(this.reportId).then(() => {
|
||||||
this.runLoading = false;
|
this.runLoading = false;
|
||||||
|
@ -350,7 +342,7 @@ export default {
|
||||||
}
|
}
|
||||||
this.currentRequest = this.api.request;
|
this.currentRequest = this.api.request;
|
||||||
this.runLoading = false;
|
this.runLoading = false;
|
||||||
this.getResult();
|
getLastResultDetail(this.api.id, this);
|
||||||
if (this.api.environmentId) {
|
if (this.api.environmentId) {
|
||||||
this.api.request.useEnvironment = this.api.environmentId;
|
this.api.request.useEnvironment = this.api.environmentId;
|
||||||
}
|
}
|
||||||
|
@ -364,15 +356,6 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.ms-htt-width {
|
|
||||||
width: 350px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.environment-button {
|
|
||||||
margin-left: 20px;
|
|
||||||
padding: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-drawer) {
|
:deep(.el-drawer) {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue