refactor(测试跟踪): 功能用例导入继续导入没有合法用例时提示失败

This commit is contained in:
AnAngle 2022-08-23 10:52:25 +08:00 committed by f2c-ci-robot[bot]
parent 291d16943c
commit 8808b2ce41
5 changed files with 24 additions and 21 deletions

View File

@ -499,8 +499,11 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
if (!errList.isEmpty() && !request.isIgnore()) {
return;
}
if ((isCreateModel() && CollectionUtils.isEmpty(list)) || (isUpdateModel() && CollectionUtils.isEmpty(updateList))) {
MSException.throwException(Translator.get("no_legitimate_case_tip"));
}
if (!(list.size() == 0)) {
if (CollectionUtils.isNotEmpty(list)) {
List<TestCaseWithBLOBs> result = list.stream()
.map(item -> this.convert2TestCase(item))
.collect(Collectors.toList());
@ -510,7 +513,7 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
this.isUpdated = true;
}
if (!(updateList.size() == 0)) {
if (CollectionUtils.isNotEmpty(updateList)) {
List<TestCaseWithBLOBs> result2 = updateList.stream()
.map(item -> this.convert2TestCaseForUpdate(item))
.collect(Collectors.toList());

View File

@ -15,15 +15,11 @@ number=
row=
error=
incorrect_format=
test_case_type_validate=
test_case_priority_validate=
test_case_method_validate=
test_case_name=
test_case_module=
test_case_type=
test_case_maintainer=
test_case_priority=
test_case_method=
test_case_prerequisite=
test_case_remark=
test_case_step_desc=

View File

@ -113,15 +113,10 @@ test_case_exist=A test case already exists under this project:
node_deep_limit=The node depth does not exceed 8 layers!
before_delete_plan=There is an associated test case under this plan, please unlink it first!
incorrect_format=\tincorrect format
test_case_type_validate=\tmust be functional, performance, api
test_case_step_model_validate=\tmust be TEXT, STEP
test_case_priority_validate=\tmust be P0, P1, P2, P3
test_case_method_validate=\tmust be manual, auto
test_case_name=Name
test_case_type=Type
test_case_maintainer=Maintainer
test_case_priority=Priority
test_case_method=method
test_case_prerequisite=Prerequisite
test_case_remark=Remark
test_case_step_desc=Step description
@ -324,6 +319,15 @@ test_case_plan_comment=Execute
test_case_review_comment=Review
plan_case_status_blocking=Blocking
plan_case_status_skip=Skip
custom_field_required_tip=[%s] is required
custom_field_array_tip=[%s] must be array
custom_field_datetime_tip=[%s] must be in time-date format [%s]
custom_field_date_tip=[%s] must be in date format [%s]
custom_field_float_tip=[%s] must be number
custom_field_int_tip=[%s] must be integer
custom_field_member_tip=[%s] must be current project member
custom_field_select_tip=[%s] must be %s
no_legitimate_case_tip =Import fails without legitimate use cases!
# mock
mock_warning=No matching Mock expectation was found
zentao_test_type_error=invalid Zentao request

View File

@ -113,15 +113,10 @@ test_case_exist=该项目下已存在用例:
node_deep_limit=节点深度不超过8层
before_delete_plan=该计划下存在关联测试用例,请先取消关联!
incorrect_format=格式错误
test_case_type_validate=必须为functional、performance、api
test_case_step_model_validate=必须为TEXT、STEP
test_case_priority_validate=必须为P0、P1、P2、P3
test_case_method_validate=必须为manual、auto
test_case_name=用例名称
test_case_type=用例类型
test_case_maintainer=维护人
test_case_priority=用例等级
test_case_method=测试方式
test_case_prerequisite=前置条件
test_case_remark=备注
test_case_step_desc=步骤描述
@ -331,6 +326,7 @@ custom_field_float_tip=[%s]必须为数字
custom_field_int_tip=[%s]必须为整型
custom_field_member_tip=[%s]必须当前项目成员
custom_field_select_tip=[%s]必须为%s
no_legitimate_case_tip=导入失败,没有合法用例!
# mock
mock_warning=未找到匹配的Mock期望
zentao_test_type_error=无效的 Zentao 请求

View File

@ -113,15 +113,10 @@ test_case_exist=該項目下已存在用例:
node_deep_limit=節點深度不超過8層
before_delete_plan=該計劃下存在關聯測試用例,請先取消關聯!
incorrect_format=格式錯誤
test_case_type_validate=必須為functional、performance、api
test_case_step_model_validate=必須為TEXT、STEP
test_case_priority_validate=必須為P0、P1、P2、P3
test_case_method_validate=必須為manual、auto
test_case_name=用例名稱
test_case_type=用例類型
test_case_maintainer=維護人
test_case_priority=用例等級
test_case_method=測試方式
test_case_prerequisite=前置條件
test_case_remark=備註
test_case_step_desc=步驟描述
@ -322,6 +317,15 @@ test_case_plan_comment=執行
test_case_review_comment=評審
plan_case_status_blocking=阻塞
plan_case_status_skip=跳過
custom_field_required_tip=[%s]為必填項
custom_field_array_tip=[%s]必須是數組
custom_field_datetime_tip=[%s]必須為時間日期格式[%s]
custom_field_date_tip=[%s]必須為日期格式[%s]
custom_field_float_tip=[%s]必須為數字
custom_field_int_tip=[%s]必須為整型
custom_field_member_tip=[%s]必須當前項目成員
custom_field_select_tip=[%s]必須為%s
no_legitimate_case_tip=導入失敗,沒有合法用例!
# mock
mock_warning=未找到匹配的Mock期望
zentao_test_type_error=請求方式錯誤