增加批量增加用例、测试项、设计需求功能

This commit is contained in:
2025-12-19 18:08:19 +08:00
parent f3806687b0
commit 3e048ea876
235 changed files with 1984 additions and 201 deletions

View File

@@ -126,6 +126,20 @@ class CaseCreateInputSchema(Schema):
# 新增时序图字段
timing_diagram: str = Field("", alias="timing_diagram")
# 批量新增测试用例
class OneCaseBatchCreateSchema(Schema):
parent_key: str
name: str
summarize: Optional[str] = ""
initialization: Optional[str] = ""
premise: Optional[str] = ""
sequence: Optional[str] = "" # 时序图
test_step: str
class BatchCreateCaseInputSchema(Schema):
project_id: int = Field(..., validation_alias=AliasChoices('project_id', 'projectId'))
cases: List[OneCaseBatchCreateSchema] = []
# 由demand创建case的输入Schema
class DemandNodeSchema(Schema):
project_id: int

View File

@@ -15,6 +15,7 @@ class TestContentStepSchema(ModelSchema):
fields = ['operation', 'expect']
class TestContentSchema(ModelSchema):
subDescription: Optional[str] = ""
subStep: List[TestContentStepSchema] = [] # 可能为空
class Meta:
@@ -76,6 +77,8 @@ class TestDemandCreateOutSchema(ModelSchema):
# 新增测试子项单个子项的Schema
class TestContentInputSchema(Schema):
subName: str = None
# 2025/12/15-对CPU增加测试子项描述
subDescription: Optional[str] = "" # 未提供时为空字符串
subStep: Optional[List[TestContentStepSchema]] = []
# 新增/更新测试项Schema
@@ -95,6 +98,22 @@ class TestDemandCreateInputSchema(Schema):
testType: str = Field(None, alias="testType")
testDesciption: str = Field("", alias='testDesciption')
# 批量新增测试项Schema-2个Schema
class TestDemandOneInput(Schema):
parent_key: str # 直接给设计需求的key前端去组装
ident: str
name: str
priority: str = "1"
adequacy: str
testContent: str # 注意这个在接口里面分情况判断
testMethod: List[str] = []
testType: str
testDesciption: Optional[str] = ""
class TestDemandMultiCreateInputSchema(Schema):
project_id: int
demands: List[TestDemandOneInput]
# 处理前端请求-设计需求关联测试需求(测试项)
class TestDemandRelatedSchema(Schema):
data: List[int] = None
@@ -129,4 +148,4 @@ class ReplaceDemandContentSchema(Schema):
# 优先级替换Schema
class PriorityReplaceSchema(Schema):
selectRows: List[int] = None
priority: str
priority: str