feat(接口测试、功能用例): 隐藏接口定义首页定时任务表格选择框,修复测试用例导入的问题,修复接口用例另存为新用例的问题,修复xmind导入问题

--bug=1005220 --user=宋天阳 【测试用例】导入更新xmind,内容未同步更新
https://www.tapd.cn/55049933/s/1027435;--bug=1005155 --user=宋天阳
【接口自动化报告】步骤数统计错误 https://www.tapd.cn/55049933/s/1027437;--bug=1004801
--user=宋天阳 【github#4211】项目引用自定义用例模板后,导入时下载用例模板还是默认模板应该是自定义模板
https://www.tapd.cn/55049933/s/1027439;--bug=1005259 --user=宋天阳
【接口定义】mock另存为新接口,tab页名称显示undefined
https://www.tapd.cn/55049933/s/1027441;--bug=1005215 --user=宋天阳
【测试用例】导入的xmind用例名称为空,仍能导成功 https://www.tapd.cn/55049933/s/1027442
This commit is contained in:
song-tianyang 2021-07-21 17:48:28 +08:00 committed by 刘瑞斌
parent b22b491109
commit 423a399779
5 changed files with 29 additions and 17 deletions

View File

@ -116,21 +116,21 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
}
@Override
public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
public void invokeHeadMap(Map <Integer, String> headMap, AnalysisContext context) {
this.headMap = headMap;
if (excelDataClass != null) {
// if (excelDataClass != null) {
try {
Set<String> fieldNameSet = this.genExcelHeadToFieldNameDicAndGetNotRequiredFields();;
Collection<String> values = headMap.values();
for (String key : fieldNameSet) {
if (!values.contains(key)) {
throw new ExcelAnalysisException(Translator.get("missing_header_information") + ":" + key);
}
}
this.genExcelHeadToFieldNameDicAndGetNotRequiredFields();
// Collection<String> values = headMap.values();
// for (String key : fieldNameSet) {
// if (!values.contains(key)) {
// throw new ExcelAnalysisException(Translator.get("missing_header_information") + ":" + key);
// }
// }
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
// }
this.formatHeadMap();
super.invokeHeadMap(headMap, context);
}
@ -738,7 +738,7 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
}
excelHeadToFieldNameDic.put(value.toString(),field.getName());
// 检查是否必有的头部信息
if (field.getAnnotation(NotRequired.class) == null) {
if (field.getAnnotation(NotRequired.class) != null) {
result.add(value.toString());
}
}

View File

@ -224,7 +224,7 @@ public class TestCaseService {
.andProjectIdEqualTo(testCase.getProjectId())
.andNodePathEqualTo(nodePath)
.andTypeEqualTo(testCase.getType())
.andMaintainerEqualTo(testCase.getMaintainer())
// .andMaintainerEqualTo(testCase.getMaintainer())
.andPriorityEqualTo(testCase.getPriority());
// .andMethodEqualTo(testCase.getMethod());

View File

@ -159,11 +159,19 @@ public class XmindCaseParser {
data.setNodePath(nodePath);
if (data.getName().length() > 200) {
//用例名称判断
if(StringUtils.isEmpty(data.getName())){
validatePass = false;
process.add(Translator.get("test_case") + Translator.get("test_track.length_less_than") + "200", nodePath + data.getName());
process.add("name" + Translator.get("cannot_be_null"), nodePath + "");
}else {
if (data.getName().length() > 200) {
validatePass = false;
process.add(Translator.get("test_case") + Translator.get("test_track.length_less_than") + "200", nodePath + data.getName());
}
}
if (!StringUtils.isEmpty(nodePath)) {
String[] nodes = nodePath.split("/");
if (nodes.length > TestCaseConstants.MAX_NODE_DEPTH + 1) {

View File

@ -522,13 +522,16 @@ export default {
},
editApi(row) {
let name = "";
if (row.isCopy) {
name = "copy" + "-" + row.name;
row.name = "copy" + "-" + row.name;
} else {
name = this.$t('api_test.definition.request.edit_api') + "-" + row.name;
if(row.name){
name = this.$t('api_test.definition.request.edit_api') + "-" + row.name;
}else {
name = this.$t('api_test.definition.request.title');
}
}
this.handleTabsEdit(name, "ADD", row);
},

View File

@ -6,6 +6,7 @@
</span>
</template>
<ms-table
:enable-selection="false"
:condition="condition"
:data="tableData"
@refresh="search"