Skip to content

Commit

Permalink
+ [feat#55955] 支持用例分组
Browse files Browse the repository at this point in the history
ysicing committed Jul 22, 2024
1 parent 31b06aa commit 1460ccd
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/pkg/domain/zentao.go
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ type ZentaoUserProfile struct {

type ZentaoCaseStep struct {
Type commConsts.CaseStepType `json:"type"`
Name string `json:"name"`
Desc string `json:"desc"`
Expect string `json:"expect"`
}
8 changes: 8 additions & 0 deletions internal/pkg/helper/script/parser.go
Original file line number Diff line number Diff line change
@@ -50,6 +50,8 @@ func ReadTitleAndStepsInNewFormat(content, lang string) (caseId int, title strin

comments := strings.TrimSpace(getScriptComments(content, lang))
index := 0
groupName := 1
itemName := 1
titleLineStart := false
lines := strings.Split(comments, "\n")
for index < len(lines) {
@@ -84,6 +86,12 @@ func ReadTitleAndStepsInNewFormat(content, lang string) (caseId int, title strin
step.Type = commConsts.Group
if isChild {
step.Type = commConsts.Item
step.Name = fmt.Sprintf("%d.%d", groupName-1, itemName)
itemName += 1
} else {
step.Name = fmt.Sprintf("%d", groupName)
groupName += 1
itemName = 1
}

steps = append(steps, step)

0 comments on commit 1460ccd

Please sign in to comment.