diff --git a/src/model/testing.go b/src/model/testing.go index 862dd0e71a7b639ad7f4381307488834a4e0438e..4ed731b344b9e37d57425001ac0a2a4591a5c9bf 100644 --- a/src/model/testing.go +++ b/src/model/testing.go @@ -30,8 +30,8 @@ type TestCaseInTask struct { } type TestCase struct { - Id string - ProductId string + Id string + Product string Title string Steps map[int]TestStep diff --git a/src/service/script/generator.go b/src/service/script/generator.go index 3f148e84748c10c7fd9292132d0177a890e19f4a..cc4f1f0b975fdaad5b08a5ee82e4296b0ac81e45 100644 --- a/src/service/script/generator.go +++ b/src/service/script/generator.go @@ -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`) diff --git a/src/service/zentao/testcase.go b/src/service/zentao/testcase.go index e37fb93ccb3bcdca944547844f209ec9aab5cf59..27198f96fe55ddaa81a93217bc40dfac94feb312 100644 --- a/src/service/zentao/testcase.go +++ b/src/service/zentao/testcase.go @@ -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}) }