parent
bb920216e9
commit
3bbd86f1d2
|
@ -37,6 +37,14 @@ public class TestCaseExcelData {
|
|||
@ExcelIgnore
|
||||
private String stepModel;
|
||||
|
||||
/**
|
||||
* 责任人
|
||||
* 用例状态
|
||||
* 用例等级
|
||||
*/
|
||||
@ExcelIgnore
|
||||
private String status;
|
||||
|
||||
public Set<String> getExcludeColumnFiledNames(boolean needNum){
|
||||
Set<String> excludeColumnFiledNames = new HashSet<>();
|
||||
if(!needNum){
|
||||
|
|
|
@ -70,6 +70,11 @@ public class TestCaseExcelDataCn extends TestCaseExcelData {
|
|||
@ExcelProperty("预期结果")
|
||||
private String stepResult;
|
||||
|
||||
@ColumnWidth(50)
|
||||
@ExcelProperty("用例状态")
|
||||
private String status;
|
||||
|
||||
|
||||
@ColumnWidth(50)
|
||||
@ExcelProperty("编辑模式")
|
||||
@NotRequired
|
||||
|
|
|
@ -70,6 +70,10 @@ public class TestCaseExcelDataTw extends TestCaseExcelData {
|
|||
@ExcelProperty("預期結果")
|
||||
private String stepResult;
|
||||
|
||||
@ColumnWidth(50)
|
||||
@ExcelProperty("用例狀態")
|
||||
private String status;
|
||||
|
||||
@ColumnWidth(50)
|
||||
@ExcelProperty("編輯模式")
|
||||
@NotRequired
|
||||
|
|
|
@ -71,6 +71,10 @@ public class TestCaseExcelDataUs extends TestCaseExcelData {
|
|||
@ExcelProperty("Step result")
|
||||
private String stepResult;
|
||||
|
||||
@ColumnWidth(50)
|
||||
@ExcelProperty("Case status")
|
||||
private String status;
|
||||
|
||||
@ColumnWidth(50)
|
||||
@ExcelProperty("Edit Model")
|
||||
@NotRequired
|
||||
|
|
|
@ -257,6 +257,37 @@ public class TestCaseDataIgnoreErrorListener extends EasyExcelListener<TestCaseE
|
|||
}
|
||||
testCase.setNodePath(nodePath);
|
||||
|
||||
JSONArray customArr = new JSONArray();
|
||||
String caseStatusValue = "";
|
||||
if(StringUtils.equalsAny(data.getStatus(),"Underway","进行中","進行中")){
|
||||
caseStatusValue = "Underway";
|
||||
}else if(StringUtils.equalsAny(data.getStatus(),"Prepare","未开始","未開始")){
|
||||
caseStatusValue = "Prepare";
|
||||
}else if(StringUtils.equalsAny(data.getStatus(),"Completed","已完成","已完成")){
|
||||
caseStatusValue = "Completed";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(caseStatusValue)){
|
||||
JSONObject statusObj = new JSONObject();
|
||||
statusObj.put("id",UUID.randomUUID().toString());
|
||||
statusObj.put("name","用例状态");
|
||||
statusObj.put("value",caseStatusValue);
|
||||
statusObj.put("customData",null);
|
||||
customArr.add(statusObj);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(data.getMaintainer())){
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("id",UUID.randomUUID().toString());
|
||||
obj.put("name","责任人");
|
||||
obj.put("value",data.getMaintainer());
|
||||
obj.put("customData",null);
|
||||
customArr.add(obj);
|
||||
}
|
||||
|
||||
if(customArr.size()>0){
|
||||
testCase.setCustomFields(customArr.toString());
|
||||
}
|
||||
|
||||
//将标签设置为前端可解析的格式
|
||||
String modifiedTags = modifyTagPattern(data);
|
||||
testCase.setTags(modifiedTags);
|
||||
|
@ -297,6 +328,37 @@ public class TestCaseDataIgnoreErrorListener extends EasyExcelListener<TestCaseE
|
|||
String steps = getSteps(data);
|
||||
testCase.setSteps(steps);
|
||||
|
||||
JSONArray customArr = new JSONArray();
|
||||
String caseStatusValue = "";
|
||||
if(StringUtils.equalsAny(data.getStatus(),"Underway","进行中","進行中")){
|
||||
caseStatusValue = "Underway";
|
||||
}else if(StringUtils.equalsAny(data.getStatus(),"Prepare","未开始","未開始")){
|
||||
caseStatusValue = "Prepare";
|
||||
}else if(StringUtils.equalsAny(data.getStatus(),"Completed","已完成","已完成")){
|
||||
caseStatusValue = "Completed";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(caseStatusValue)){
|
||||
JSONObject statusObj = new JSONObject();
|
||||
statusObj.put("id",UUID.randomUUID().toString());
|
||||
statusObj.put("name","用例状态");
|
||||
statusObj.put("value",caseStatusValue);
|
||||
statusObj.put("customData",null);
|
||||
customArr.add(statusObj);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(data.getMaintainer())){
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("id",UUID.randomUUID().toString());
|
||||
obj.put("name","责任人");
|
||||
obj.put("value",data.getMaintainer());
|
||||
obj.put("customData",null);
|
||||
customArr.add(obj);
|
||||
}
|
||||
|
||||
if(customArr.size()>0){
|
||||
testCase.setCustomFields(customArr.toString());
|
||||
}
|
||||
|
||||
//将标签设置为前端可解析的格式
|
||||
String modifiedTags = modifyTagPattern(data);
|
||||
testCase.setTags(modifiedTags);
|
||||
|
|
|
@ -272,6 +272,37 @@ public class TestCaseDataListener extends EasyExcelListener<TestCaseExcelData> {
|
|||
testCase.setTags(modifiedTags);
|
||||
testCase.setType("functional");
|
||||
|
||||
JSONArray customArr = new JSONArray();
|
||||
String caseStatusValue = "";
|
||||
if(StringUtils.equalsAny(data.getStatus(),"Underway","进行中","進行中")){
|
||||
caseStatusValue = "Underway";
|
||||
}else if(StringUtils.equalsAny(data.getStatus(),"Prepare","未开始","未開始")){
|
||||
caseStatusValue = "Prepare";
|
||||
}else if(StringUtils.equalsAny(data.getStatus(),"Completed","已完成","已完成")){
|
||||
caseStatusValue = "Completed";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(caseStatusValue)){
|
||||
JSONObject statusObj = new JSONObject();
|
||||
statusObj.put("id",UUID.randomUUID().toString());
|
||||
statusObj.put("name","用例状态");
|
||||
statusObj.put("value",caseStatusValue);
|
||||
statusObj.put("customData",null);
|
||||
customArr.add(statusObj);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(data.getMaintainer())){
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("id",UUID.randomUUID().toString());
|
||||
obj.put("name","责任人");
|
||||
obj.put("value",data.getMaintainer());
|
||||
obj.put("customData",null);
|
||||
customArr.add(obj);
|
||||
}
|
||||
|
||||
if(customArr.size()>0){
|
||||
testCase.setCustomFields(customArr.toString());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(data.getStepModel())
|
||||
&& StringUtils.equals(data.getStepModel(), TestCaseConstants.StepModel.TEXT.name())) {
|
||||
testCase.setStepDescription(data.getStepDesc());
|
||||
|
@ -308,6 +339,37 @@ public class TestCaseDataListener extends EasyExcelListener<TestCaseExcelData> {
|
|||
String steps = getSteps(data);
|
||||
testCase.setSteps(steps);
|
||||
|
||||
JSONArray customArr = new JSONArray();
|
||||
String caseStatusValue = "";
|
||||
if(StringUtils.equalsAny(data.getStatus(),"Underway","进行中","進行中")){
|
||||
caseStatusValue = "Underway";
|
||||
}else if(StringUtils.equalsAny(data.getStatus(),"Prepare","未开始","未開始")){
|
||||
caseStatusValue = "Prepare";
|
||||
}else if(StringUtils.equalsAny(data.getStatus(),"Completed","已完成","已完成")){
|
||||
caseStatusValue = "Completed";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(caseStatusValue)){
|
||||
JSONObject statusObj = new JSONObject();
|
||||
statusObj.put("id",UUID.randomUUID().toString());
|
||||
statusObj.put("name","用例状态");
|
||||
statusObj.put("value",caseStatusValue);
|
||||
statusObj.put("customData",null);
|
||||
customArr.add(statusObj);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(data.getMaintainer())){
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("id",UUID.randomUUID().toString());
|
||||
obj.put("name","责任人");
|
||||
obj.put("value",data.getMaintainer());
|
||||
obj.put("customData",null);
|
||||
customArr.add(obj);
|
||||
}
|
||||
|
||||
if(customArr.size()>0){
|
||||
testCase.setCustomFields(customArr.toString());
|
||||
}
|
||||
|
||||
//将标签设置为前端可解析的格式
|
||||
String modifiedTags = modifyTagPattern(data);
|
||||
testCase.setTags(modifiedTags);
|
||||
|
|
|
@ -242,13 +242,13 @@ public class TestCaseService {
|
|||
|
||||
// 如果上边字段全部相同,去检查 remark 和 steps
|
||||
if (!CollectionUtils.isEmpty(caseList)) {
|
||||
String caseRemark = testCase.getRemark();
|
||||
String caseSteps = testCase.getSteps();
|
||||
String casePrerequisite = testCase.getPrerequisite();
|
||||
String caseRemark = testCase.getRemark() == null? "" : testCase.getRemark();
|
||||
String caseSteps = testCase.getSteps() == null? "" : testCase.getSteps();
|
||||
String casePrerequisite = testCase.getPrerequisite() == null? "" : testCase.getPrerequisite();
|
||||
for (TestCaseWithBLOBs tc : caseList) {
|
||||
String steps = tc.getSteps();
|
||||
String remark = tc.getRemark();
|
||||
String prerequisite = tc.getPrerequisite();
|
||||
String steps = tc.getSteps() == null?"" : tc.getSteps();
|
||||
String remark = tc.getRemark() == null?"" : tc.getRemark();
|
||||
String prerequisite = tc.getPrerequisite() == null?"" : tc.getPrerequisite();
|
||||
if (StringUtils.equals(steps, caseSteps) && StringUtils.equals(remark, caseRemark) && StringUtils.equals(prerequisite, casePrerequisite)) {
|
||||
//MSException.throwException(Translator.get("test_case_already_exists"));
|
||||
return tc;
|
||||
|
@ -872,6 +872,7 @@ public class TestCaseService {
|
|||
}
|
||||
}
|
||||
data.setMaintainer(t.getMaintainer());
|
||||
data.setStatus(t.getStatus());
|
||||
list.add(data);
|
||||
});
|
||||
return list;
|
||||
|
|
Loading…
Reference in New Issue