fix(接口测试): 修复JsonSchema中的样式问题

--bug=1020800 --user=宋天阳 【接口测试】github#20570,接口场景测试 JSON请求体中
json数组中的mock函数无效 https://www.tapd.cn/55049933/s/1316138
This commit is contained in:
song-tianyang 2022-12-16 00:54:03 +08:00 committed by 建国
parent 6beadcb67a
commit 17b3a03791
3 changed files with 22 additions and 11 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="json-schema-editor" style="padding: 0 10px"> <div class="json-schema-editor" style="padding: 0 10px">
<el-row class="row" :gutter="10"> <el-row class="row" :gutter="10" v-if="reloadSelfOver">
<el-col :style="{ minWidth: `${200 - 10 * deep}px` }" class="ms-col-name"> <el-col :style="{ minWidth: `${200 - 10 * deep}px` }" class="ms-col-name">
<div :style="{ marginLeft: `${10 * deep}px` }" class="ms-col-name-c" /> <div :style="{ marginLeft: `${10 * deep}px` }" class="ms-col-name-c" />
<span <span
@ -401,6 +401,7 @@ export default {
countAdd: 1, countAdd: 1,
modalVisible: false, modalVisible: false,
reloadItemOver: true, reloadItemOver: true,
reloadSelfOver: true,
advancedValue: {}, advancedValue: {},
addProp: {}, // addProp: {}, //
customProps: [], customProps: [],
@ -484,15 +485,19 @@ export default {
changeAllItemsType(changeType) { changeAllItemsType(changeType) {
if (this.isArray(this.pickValue) && this.pickValue.items && this.pickValue.items.length > 0) { if (this.isArray(this.pickValue) && this.pickValue.items && this.pickValue.items.length > 0) {
this.pickValue.items.forEach((item) => { this.pickValue.items.forEach((item) => {
item.type = changeType;
delete item['properties']; delete item['properties'];
delete item['items']; delete item['items'];
delete item['required']; delete item['required'];
delete item['mock']; delete item['mock'];
this.$set(item, 'type', changeType);
if (changeType === 'array') { if (changeType === 'array') {
this.$set(item, 'items', [{ type: 'string', mock: { mock: '' } }]); this.$set(item, 'items', [{ type: 'string', mock: { mock: '' } }]);
} }
}); });
this.$nextTick(() => {
this.reloadSelf();
this.reloadItems();
});
} }
}, },
onCheck(e) { onCheck(e) {
@ -609,6 +614,13 @@ export default {
this.reloadItemOver = true; this.reloadItemOver = true;
}); });
}, },
reloadSelf() {
this.reloadSelfOver = false;
this.$nextTick(() => {
this.reloadSelfOver = true;
});
},
editScenarioAdvance(data) { editScenarioAdvance(data) {
this.$emit('editScenarioAdvance', data); this.$emit('editScenarioAdvance', data);
}, },

View File

@ -130,9 +130,6 @@ export default {
}, },
}; };
}, },
activated() {
this.search();
},
methods: { methods: {
clickRow(row, column) { clickRow(row, column) {
if (column.property !== 'status') { if (column.property !== 'status') {

View File

@ -38,7 +38,6 @@ import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionUtils; import org.mybatis.spring.SqlSessionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -561,6 +560,11 @@ public class TestPlanReportService {
resourceId = planExecutionQueues.get(0).getResourceId(); resourceId = planExecutionQueues.get(0).getResourceId();
testPlanExecutionQueueMapper.deleteByExample(testPlanExecutionQueueExample); testPlanExecutionQueueMapper.deleteByExample(testPlanExecutionQueueExample);
} }
testPlanReportMapper.updateByPrimaryKey(testPlanReport);
//发送通知
testPlanMessageService.checkTestPlanStatusAndSendMessage(testPlanReport, content, isSendMessage);
if (runMode != null && StringUtils.equalsIgnoreCase(runMode, RunModeConstants.SERIAL.name()) && resourceId != null) { if (runMode != null && StringUtils.equalsIgnoreCase(runMode, RunModeConstants.SERIAL.name()) && resourceId != null) {
TestPlanExecutionQueueExample queueExample = new TestPlanExecutionQueueExample(); TestPlanExecutionQueueExample queueExample = new TestPlanExecutionQueueExample();
queueExample.createCriteria().andReportIdIsNotNull().andResourceIdEqualTo(resourceId); queueExample.createCriteria().andReportIdIsNotNull().andResourceIdEqualTo(resourceId);
@ -577,10 +581,8 @@ public class TestPlanReportService {
runRequest.setReportId(testPlanExecutionQueue.getReportId()); runRequest.setReportId(testPlanExecutionQueue.getReportId());
testPlanService.runPlan(runRequest); testPlanService.runPlan(runRequest);
} }
testPlanReportMapper.updateByPrimaryKey(testPlanReport);
} }
//发送通知
testPlanMessageService.checkTestPlanStatusAndSendMessage(testPlanReport, content, isSendMessage);
return testPlanReport; return testPlanReport;
} }