提交 5337e6a1 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

save productID in script file

上级 4aac1c63
......@@ -30,8 +30,8 @@ type TestCaseInTask struct {
}
type TestCase struct {
Id string
ProductId string
Id string
Product string
Title string
Steps map[int]TestStep
......
......@@ -26,7 +26,7 @@ func Generate(testcases []model.TestCase, langType string, independentFile bool)
func GenerateTestCaseScript(cs model.TestCase, langType string, independentFile bool, caseIds *[]string) {
caseId := cs.Id
productId := cs.ProductId
productId := cs.Product
caseTitle := cs.Title
scriptFile := fmt.Sprintf(constant.ScriptDir+"tc-%s.%s", caseId, LangMap[langType]["extName"])
......@@ -50,7 +50,6 @@ func GenerateTestCaseScript(cs model.TestCase, langType string, independentFile
if fileUtils.FileExist(scriptFile) { // update title and steps
content := fileUtils.ReadFile(scriptFile)
fmt.Println(content)
// replace title
re, _ := regexp.Compile(`title:\s*([^\n]*?)\s*\n`)
......
......@@ -59,7 +59,7 @@ func ListCaseByProduct(baseUrl string, productId string, moduleId string) []mode
tc := caseMap[idStr]
csWithSteps := GetCaseById(baseUrl, idStr)
caseArr = append(caseArr, model.TestCase{Id: idStr, ProductId: tc.ProductId, Title: tc.Title, StepArr: csWithSteps.StepArr})
caseArr = append(caseArr, model.TestCase{Id: idStr, Product: tc.Product, Title: tc.Title, StepArr: csWithSteps.StepArr})
}
return caseArr
......@@ -83,7 +83,7 @@ func ListCaseByTask(baseUrl string, taskId string) []model.TestCase {
caseId := cs.Case
csWithSteps := GetCaseById(baseUrl, caseId)
caseArr = append(caseArr, model.TestCase{Id: caseId, ProductId: cs.ProductId,
caseArr = append(caseArr, model.TestCase{Id: caseId, Product: cs.ProductId,
Title: cs.Title, StepArr: csWithSteps.StepArr})
}
......@@ -108,7 +108,7 @@ func ListCaseBySuite(baseUrl string, suiteId string) []model.TestCase {
caseId := cs.Case
csWithSteps := GetCaseById(baseUrl, caseId)
caseArr = append(caseArr, model.TestCase{Id: caseId, ProductId: cs.ProductId,
caseArr = append(caseArr, model.TestCase{Id: caseId, Product: cs.ProductId,
Title: cs.Title, StepArr: csWithSteps.StepArr})
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册