refactor(测试计划): 无可执行用例时点击执行按钮跳转到计划详情页
This commit is contained in:
parent
8c6a0fa75b
commit
a820a0f418
|
@ -254,4 +254,9 @@ public class TestPlanController {
|
|||
apiAutomationService.updateSchedule(schedule);
|
||||
return schedule;
|
||||
}
|
||||
|
||||
@GetMapping("/have/exec/case/{id}")
|
||||
public boolean haveExecCase(@PathVariable String id) {
|
||||
return testPlanService.haveExecCase(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1917,4 +1917,28 @@ public class TestPlanService {
|
|||
testPlan.setReportConfig(testPlanDTO.getReportConfig());
|
||||
testPlanMapper.updateByPrimaryKeySelective(testPlan);
|
||||
}
|
||||
|
||||
public boolean haveExecCase(String id) {
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return false;
|
||||
}
|
||||
TestPlanApiCaseExample apiCaseExample = new TestPlanApiCaseExample();
|
||||
apiCaseExample.createCriteria().andTestPlanIdEqualTo(id);
|
||||
List<TestPlanApiCase> testPlanApiCases = testPlanApiCaseMapper.selectByExample(apiCaseExample);
|
||||
if (!CollectionUtils.isEmpty(testPlanApiCases)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
TestPlanApiScenarioExample apiScenarioExample = new TestPlanApiScenarioExample();
|
||||
apiScenarioExample.createCriteria().andTestPlanIdEqualTo(id);
|
||||
List<TestPlanApiScenario> testPlanApiScenarios = testPlanApiScenarioMapper.selectByExample(apiScenarioExample);
|
||||
if (!CollectionUtils.isEmpty(testPlanApiScenarios)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
TestPlanLoadCaseExample loadCaseExample = new TestPlanLoadCaseExample();
|
||||
loadCaseExample.createCriteria().andTestPlanIdEqualTo(id);
|
||||
List<TestPlanLoadCase> testPlanLoadCases = testPlanLoadCaseMapper.selectByExample(loadCaseExample);
|
||||
return !CollectionUtils.isEmpty(testPlanLoadCases);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -480,7 +480,14 @@ export default {
|
|||
},
|
||||
handleRun(row) {
|
||||
this.currentPlanId = row.id;
|
||||
this.$refs.runMode.open('API');
|
||||
this.$get("/test/plan/have/exec/case/" + row.id, res => {
|
||||
const haveExecCase = res.data;
|
||||
if (haveExecCase) {
|
||||
this.$refs.runMode.open('API');
|
||||
} else {
|
||||
this.$router.push('/track/plan/view/' + row.id);
|
||||
}
|
||||
})
|
||||
},
|
||||
_handleRun(config) {
|
||||
let {mode, reportType, onSampleError, runWithinResourcePool, resourcePoolId, envMap} = config;
|
||||
|
|
Loading…
Reference in New Issue