fix(UI 自动化): 根据条件关联用例到测试计划

--bug=1016273 --user=张大海 【测试跟踪】测试计划-UI测试用例-关联测试用例-弹框-输入关键字搜索用例-全选符合搜索结果的所有数据确定-实际关联的是项目下所有数据 https://www.tapd.cn/55049933/s/1233644
This commit is contained in:
zhangdahai112 2022-08-25 11:53:34 +08:00 committed by zhangdahai112
parent 3ced82ad63
commit 8b197849c2
3 changed files with 22 additions and 4 deletions

View File

@ -54,6 +54,11 @@ public class TestPlanUiScenarioCaseController {
return testPlanUiScenarioCaseService.relevanceList(request, goPage, pageSize); return testPlanUiScenarioCaseService.relevanceList(request, goPage, pageSize);
} }
@PostMapping("/relevance/list/ids")
public List<String> relevanceListIds(@RequestBody UiScenarioRequest request) {
return testPlanUiScenarioCaseService.relevanceListIds(request);
}
@GetMapping("/delete/{id}") @GetMapping("/delete/{id}")
@MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestPlanScenarioCaseService.class) @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestPlanScenarioCaseService.class)
public int deleteTestCase(@PathVariable String id) { public int deleteTestCase(@PathVariable String id) {

View File

@ -618,4 +618,12 @@ public class TestPlanUiScenarioCaseService {
extTestPlanUiScenarioCaseMapper::getLastOrder, extTestPlanUiScenarioCaseMapper::getLastOrder,
testPlanUiScenarioMapper::updateByPrimaryKeySelective); testPlanUiScenarioMapper::updateByPrimaryKeySelective);
} }
public List<String> relevanceListIds(UiScenarioRequest request) {
request.setNotInTestPlan(true);
if (testPlanService.isAllowedRepeatCase(request.getPlanId())) {
request.setNotInTestPlan(false);
}
return uiAutomationServiceProxy.list(request).stream().map(UiScenarioDTO::getId).collect(Collectors.toList());
}
} }

View File

@ -132,6 +132,13 @@ export default {
this.$refs.baseRelevance.close(); this.$refs.baseRelevance.close();
}); });
}, },
getAllId(param) {
return new Promise((resolve) => {
this.$post("/test/plan/uiScenario/case/relevance/list/ids", param, (data) => {
resolve(data.data);
})
});
},
async saveCaseRelevance() { async saveCaseRelevance() {
let selectIds = []; let selectIds = [];
let url = '/ui/automation/relevance'; let url = '/ui/automation/relevance';
@ -154,10 +161,8 @@ export default {
// //
let params = this.$refs.apiScenarioList.condition; let params = this.$refs.apiScenarioList.condition;
if (params.selectAll) { if (params.selectAll) {
let result = await this.$post("/ui/automation/listAllIds", { let result = await this.getAllId(params);
projectId: params.projectId param.selectIds = result;
});
param.selectIds = result.data.data;
} }
this.result = this.$post(url, param, () => { this.result = this.$post(url, param, () => {