fix(测试用例): 导入的用例所属模块节点开始无/报错问题
--bug=1045195 --user=宋昌昌 【测试用例】excel导入用例-所属模块路径跟节点无/-导入报错 https://www.tapd.cn/55049933/s/1572218
This commit is contained in:
parent
6c82da4de5
commit
93cee2b8b9
|
@ -45,7 +45,7 @@ public enum CaseType {
|
|||
|
||||
public static CaseType getType(String key) {
|
||||
for (CaseType caseType : CaseType.values()) {
|
||||
if (StringUtils.equals(caseType.getKey(), key)) {
|
||||
if (StringUtils.equalsIgnoreCase(caseType.getKey(), key)) {
|
||||
return caseType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -390,13 +390,11 @@ public class FunctionalCaseCheckEventListener extends AnalysisEventListener<Map<
|
|||
* @param errMsg
|
||||
*/
|
||||
private void validateModule(FunctionalCaseExcelData data, StringBuilder errMsg) {
|
||||
if (!StringUtils.startsWith(data.getModule(), "/")) {
|
||||
data.setModule("/" + data.getModule());
|
||||
}
|
||||
String module = data.getModule();
|
||||
if (StringUtils.isNotEmpty(module)) {
|
||||
if (!StringUtils.startsWith(module, "/")) {
|
||||
errMsg.append(Translator.get("module_starts_with"))
|
||||
.append(ERROR_MSG_SEPARATOR);
|
||||
return;
|
||||
}
|
||||
String[] nodes = module.split("/");
|
||||
//模块名不能为空
|
||||
for (int i = 0; i < nodes.length; i++) {
|
||||
|
|
|
@ -500,6 +500,9 @@ public class FunctionalCaseImportEventListener extends AnalysisEventListener<Map
|
|||
* @param errMsg
|
||||
*/
|
||||
private void validateModule(FunctionalCaseExcelData data, StringBuilder errMsg) {
|
||||
if (!StringUtils.startsWith(data.getModule(), "/")) {
|
||||
data.setModule("/" + data.getModule());
|
||||
}
|
||||
String module = data.getModule();
|
||||
if (StringUtils.isNotEmpty(module)) {
|
||||
String[] nodes = module.split("/");
|
||||
|
|
|
@ -248,12 +248,15 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService {
|
|||
|
||||
public List<TestPlanCasePageResponse> getFunctionalCasePage(TestPlanCaseRequest request, boolean deleted) {
|
||||
filterCaseRequest(request);
|
||||
// 查询中不需要项目ID参数
|
||||
String projectId = request.getProjectId();
|
||||
request.setProjectId(null);
|
||||
List<TestPlanCasePageResponse> functionalCaseLists = extTestPlanFunctionalCaseMapper.getCasePage(request, deleted, request.getSortString());
|
||||
if (CollectionUtils.isEmpty(functionalCaseLists)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//处理自定义字段值
|
||||
return handleCustomFields(functionalCaseLists, request.getProjectId());
|
||||
return handleCustomFields(functionalCaseLists, projectId);
|
||||
}
|
||||
|
||||
private List<TestPlanCasePageResponse> handleCustomFields(List<TestPlanCasePageResponse> functionalCaseLists, String projectId) {
|
||||
|
|
Loading…
Reference in New Issue