diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java index 0b20990141..fa7fbebfde 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionExecResultService.java @@ -55,6 +55,9 @@ public class ApiDefinitionExecResultService { saveResult.setCreateTime(System.currentTimeMillis()); saveResult.setUserId(Objects.requireNonNull(SessionUtils.getUser()).getId()); saveResult.setName(item.getName()); + if (item.getName().indexOf("<->") != -1) { + saveResult.setName(item.getName().substring(0, item.getName().indexOf("<->"))); + } saveResult.setResourceId(item.getName()); saveResult.setContent(JSON.toJSONString(item)); saveResult.setStartTime(item.getStartTime()); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index 4e836d4afb..e03afa3ef7 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -14,6 +14,7 @@ import io.metersphere.api.dto.scenario.request.RequestType; import io.metersphere.api.dto.swaggerurl.SwaggerTaskResult; import io.metersphere.api.dto.swaggerurl.SwaggerUrlRequest; import io.metersphere.api.jmeter.JMeterService; +import io.metersphere.api.jmeter.RequestResult; import io.metersphere.api.jmeter.TestResult; import io.metersphere.api.parse.ApiImportParser; import io.metersphere.api.parse.ApiImportParserFactory; @@ -297,7 +298,7 @@ public class ApiDefinitionService { } } - private ApiDefinition importCreate(ApiDefinitionResult request, ApiDefinitionMapper batchMapper,ApiTestImportRequest apiTestImportRequest) { + private ApiDefinition importCreate(ApiDefinitionResult request, ApiDefinitionMapper batchMapper, ApiTestImportRequest apiTestImportRequest) { SaveApiDefinitionRequest saveReq = new SaveApiDefinitionRequest(); BeanUtils.copyBean(saveReq, request); final ApiDefinitionWithBLOBs apiDefinition = new ApiDefinitionWithBLOBs(); @@ -313,7 +314,7 @@ public class ApiDefinitionService { apiDefinition.setDescription(request.getDescription()); List sameRequest = getSameRequest(saveReq); - if(StringUtils.equals("fullCoverage",apiTestImportRequest.getModeId())){ + if (StringUtils.equals("fullCoverage", apiTestImportRequest.getModeId())) { if (CollectionUtils.isEmpty(sameRequest)) { batchMapper.insert(apiDefinition); } else { @@ -321,9 +322,9 @@ public class ApiDefinitionService { apiDefinition.setId(sameRequest.get(0).getId()); apiDefinitionMapper.updateByPrimaryKeyWithBLOBs(apiDefinition); } - }else if(StringUtils.equals("incrementalMerge",apiTestImportRequest.getModeId())){ + } else if (StringUtils.equals("incrementalMerge", apiTestImportRequest.getModeId())) { batchMapper.insert(apiDefinition); - }else{ + } else { if (CollectionUtils.isEmpty(sameRequest)) { batchMapper.insert(apiDefinition); } else { @@ -372,7 +373,11 @@ public class ApiDefinitionService { public void addResult(TestResult res) { if (!res.getScenarios().isEmpty() && !res.getScenarios().get(0).getRequestResults().isEmpty()) { - cache.put(res.getTestId(), res.getScenarios().get(0).getRequestResults().get(0)); + RequestResult result = res.getScenarios().get(0).getRequestResults().get(0); + if (result.getName().indexOf("<->") != -1) { + result.setName(result.getName().substring(0, result.getName().indexOf("<->"))); + } + cache.put(res.getTestId(), result); } else { MSException.throwException(Translator.get("test_not_found")); } @@ -451,7 +456,7 @@ public class ApiDefinitionService { item.setName(item.getName().substring(0, 255)); } item.setNum(num++); - importCreate(item, batchMapper,request); + importCreate(item, batchMapper, request); if (i % 300 == 0) { sqlSession.flushStatements(); } @@ -614,7 +619,7 @@ public class ApiDefinitionService { /*swagger定时导入*/ public void createSchedule(Schedule request) { /*保存swaggerUrl*/ - SwaggerUrlProject swaggerUrlProject=new SwaggerUrlProject(); + SwaggerUrlProject swaggerUrlProject = new SwaggerUrlProject(); swaggerUrlProject.setId(UUID.randomUUID().toString()); swaggerUrlProject.setProjectId(request.getProjectId()); swaggerUrlProject.setSwaggerUrl(request.getResourceId()); @@ -631,33 +636,38 @@ public class ApiDefinitionService { this.addOrUpdateSwaggerImportCronJob(request); } + //关闭 - public void updateSchedule(Schedule request){ + public void updateSchedule(Schedule request) { scheduleService.editSchedule(request); this.addOrUpdateSwaggerImportCronJob(request); } + //删除 - public void deleteSchedule(ScheduleInfoSwaggerUrlRequest request){ + public void deleteSchedule(ScheduleInfoSwaggerUrlRequest request) { swaggerUrlProjectMapper.deleteByPrimaryKey(request.getId()); scheduleMapper.deleteByPrimaryKey(request.getTaskId()); } + //查询swaggerUrl详情 - public SwaggerUrlProject getSwaggerInfo(String resourceId){ + public SwaggerUrlProject getSwaggerInfo(String resourceId) { return swaggerUrlProjectMapper.selectByPrimaryKey(resourceId); } - public String getResourceId(SwaggerUrlRequest swaggerUrlRequest){ - SwaggerUrlProjectExample swaggerUrlProjectExample=new SwaggerUrlProjectExample(); - SwaggerUrlProjectExample.Criteria criteria=swaggerUrlProjectExample.createCriteria(); + + public String getResourceId(SwaggerUrlRequest swaggerUrlRequest) { + SwaggerUrlProjectExample swaggerUrlProjectExample = new SwaggerUrlProjectExample(); + SwaggerUrlProjectExample.Criteria criteria = swaggerUrlProjectExample.createCriteria(); criteria.andProjectIdEqualTo(swaggerUrlRequest.getProjectId()).andSwaggerUrlEqualTo(swaggerUrlRequest.getSwaggerUrl()).andModuleIdEqualTo(swaggerUrlRequest.getModuleId()); - List list=swaggerUrlProjectMapper.selectByExample(swaggerUrlProjectExample); - String resourceId=""; - if(list.size()==1){ - resourceId=list.get(0).getId(); + List list = swaggerUrlProjectMapper.selectByExample(swaggerUrlProjectExample); + String resourceId = ""; + if (list.size() == 1) { + resourceId = list.get(0).getId(); } return resourceId; } - public List getSwaggerScheduleList(String projectId){ + + public List getSwaggerScheduleList(String projectId) { return extSwaggerUrlScheduleMapper.getSwaggerTaskList(projectId); } diff --git a/backend/src/main/java/io/metersphere/api/service/HistoricalDataUpgradeService.java b/backend/src/main/java/io/metersphere/api/service/HistoricalDataUpgradeService.java index a20aea382f..e1f1aca8d1 100644 --- a/backend/src/main/java/io/metersphere/api/service/HistoricalDataUpgradeService.java +++ b/backend/src/main/java/io/metersphere/api/service/HistoricalDataUpgradeService.java @@ -412,6 +412,7 @@ public class HistoricalDataUpgradeService { MsScenario step = new MsScenario(); step.setId(scenario1.getId()); step.setName(scenario1.getName()); + step.setEnable(scenario.isEnable()); step.setType("scenario"); step.setResourceId(UUID.randomUUID().toString()); step.setReferenced("REF"); diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue index 3c79a559fa..fbe24ef940 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue @@ -14,7 +14,7 @@ {{$t('api_test.automation.reference_deleted')}} {{ $t('commons.copy') }} {{ $t('api_test.scenario.reference') }} - diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiResponseComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiResponseComponent.vue index 6dc1c8d434..633cf95c21 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiResponseComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiResponseComponent.vue @@ -42,6 +42,12 @@ this.isActive = true; } }, + watch: { + result() { + this.response = this.result; + this.isActive = true; + } + }, methods: { getExecResult() { // 执行结果信息 diff --git a/frontend/src/business/components/track/case/components/BatchMove.vue b/frontend/src/business/components/track/case/components/BatchMove.vue index 42dc3adf1d..eebc783ffd 100644 --- a/frontend/src/business/components/track/case/components/BatchMove.vue +++ b/frontend/src/business/components/track/case/components/BatchMove.vue @@ -25,15 +25,15 @@ {{node.label}} - - - - - + + + + + diff --git a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseEdit.vue b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseEdit.vue index 6c1b606dbf..27afbba563 100644 --- a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseEdit.vue +++ b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseEdit.vue @@ -257,9 +257,10 @@