fix: 修复测试计划定时任务无法执行场景案例的问题,Mock配置页面操作优化

修复测试计划定时任务无法执行场景案例的问题,Mock配置页面操作优化
This commit is contained in:
song-tianyang 2021-04-25 15:32:44 +08:00 committed by 刘瑞斌
parent b47be42743
commit d3c88eb271
3 changed files with 8 additions and 8 deletions

View File

@ -935,6 +935,7 @@ public class TestPlanService {
planScenarioID + ":" + request.getTestPlanReportId(), planScenarioID + ":" + request.getTestPlanReportId(),
item.getName(), request.getTriggerMode() == null ? ReportTriggerMode.MANUAL.name() : request.getTriggerMode(), item.getName(), request.getTriggerMode() == null ? ReportTriggerMode.MANUAL.name() : request.getTriggerMode(),
request.getExecuteType(), item.getProjectId(), request.getReportUserID(),null); request.getExecuteType(), item.getProjectId(), request.getReportUserID(),null);
apiScenarioReportMapper.insert(report);
group.setHashTree(scenarios); group.setHashTree(scenarios);
testPlan.getHashTree().add(group); testPlan.getHashTree().add(group);
returnId = request.getId(); returnId = request.getId();
@ -1056,7 +1057,6 @@ public class TestPlanService {
//执行场景执行任务 //执行场景执行任务
if (!planScenarioIdMap.isEmpty()) { if (!planScenarioIdMap.isEmpty()) {
LogUtil.info("-------------- testplan schedule ---------- api case over -----------------");
SchedulePlanScenarioExecuteRequest scenarioRequest = new SchedulePlanScenarioExecuteRequest(); SchedulePlanScenarioExecuteRequest scenarioRequest = new SchedulePlanScenarioExecuteRequest();
String senarionReportID = UUID.randomUUID().toString(); String senarionReportID = UUID.randomUUID().toString();
scenarioRequest.setId(senarionReportID); scenarioRequest.setId(senarionReportID);
@ -1076,7 +1076,6 @@ public class TestPlanService {
scenarioIsExcuting = true; scenarioIsExcuting = true;
scenarioCaseIdArray= JSONArray.toJSONString(new ArrayList<>(planScenarioIdMap.keySet())); scenarioCaseIdArray= JSONArray.toJSONString(new ArrayList<>(planScenarioIdMap.keySet()));
} }
LogUtil.info("-------------- testplan schedule ---------- scenario case over -----------------");
} }

View File

@ -266,8 +266,7 @@ export default {
let mockConfigId = this.mockConfigData.mockConfig.id; let mockConfigId = this.mockConfigData.mockConfig.id;
this.mockExpectConfig.mockConfigId = mockConfigId; this.mockExpectConfig.mockConfigId = mockConfigId;
this.mockExpectConfig.id = ""; this.mockExpectConfig.id = "";
let formCheckResult = this.checkMockExpectForm("mockExpectForm"); let formCheckResult = this.checkMockExpectForm("mockExpectForm", true);
this.cleanMockExpectConfig();
}, },
cleanMockExpectConfig() { cleanMockExpectConfig() {
this.showHeadTable = false; this.showHeadTable = false;
@ -294,13 +293,16 @@ export default {
updateMockExpectConfig() { updateMockExpectConfig() {
this.checkMockExpectForm("mockExpectForm"); this.checkMockExpectForm("mockExpectForm");
}, },
uploadMockExpectConfig() { uploadMockExpectConfig(clearForm) {
let url = "/mockConfig/updateMockExpectConfig"; let url = "/mockConfig/updateMockExpectConfig";
let param = this.mockExpectConfig; let param = this.mockExpectConfig;
this.$post(url, param, response => { this.$post(url, param, response => {
let returnData = response.data; let returnData = response.data;
this.mockExpectConfig.id = returnData.id; this.mockExpectConfig.id = returnData.id;
this.refreshMockInfo(param.mockConfigId); this.refreshMockInfo(param.mockConfigId);
if (clearForm) {
this.cleanMockExpectConfig();
}
this.$message({ this.$message({
type: 'success', type: 'success',
message: this.$t('commons.save_success'), message: this.$t('commons.save_success'),
@ -314,10 +316,10 @@ export default {
this.mockConfigData = response.data; this.mockConfigData = response.data;
}); });
}, },
checkMockExpectForm(formName) { checkMockExpectForm(formName, clearForm) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
this.uploadMockExpectConfig(); this.uploadMockExpectConfig(clearForm);
return true; return true;
} else { } else {
return false; return false;

View File

@ -151,7 +151,6 @@ export default {
watch: { watch: {
selectNodeIds() { selectNodeIds() {
this.selectDataCounts = 0; this.selectDataCounts = 0;
this.$refs.selectPopover.reload();
}, },
}, },
computed: { computed: {