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

test restapi

上级 5ad9282c
......@@ -33,7 +33,7 @@ func (s *BugApiSuite) BeforeEach(t provider.T) {
func (s *BugApiSuite) TestBugListApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("products/%d/bugs", ProductId), nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("products/%d/bugs", ProductId), nil, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......@@ -45,12 +45,12 @@ func (s *BugApiSuite) TestBugListApi(t provider.T) {
func (s *BugApiSuite) TestBugCreateApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("products/%d/bugs", ProductId), nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("products/%d/bugs", ProductId), nil, constTestHelper.ZentaoSiteUrl)
title := BugTitle + stringUtils.NewUuid()
data := map[string]interface{}{
"id": 1,
"id": 0,
"title": title,
"type": "codeerror",
"product": ProductId,
......@@ -86,7 +86,7 @@ func (s *BugApiSuite) TestBugOptionsApi(t provider.T) {
params := map[string]interface{}{
"product": ProductId,
}
url := zentaoHelper.GenApiUrl("options/bug", params, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl("options/bug", params, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......@@ -98,7 +98,7 @@ func (s *BugApiSuite) TestBugOptionsApi(t provider.T) {
func getBug(id int64) (bug map[string]interface{}) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("bugs/%d", id), nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("bugs/%d", id), nil, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......
......@@ -33,7 +33,7 @@ func (s *CaseApiSuite) TestCaseListApi(t provider.T) {
params := map[string]interface{}{
"limit": 10,
}
url := zentaoHelper.GenApiUrl(fmt.Sprintf("/products/%d/testcases", ProductId), params, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("/products/%d/testcases", ProductId), params, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......@@ -46,7 +46,7 @@ func (s *CaseApiSuite) TestCaseListByModuleApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("/products/%d/testcases?module=%d", ProductId, ModuleId),
nil, constTestHelper.ZtfUrl)
nil, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......@@ -58,7 +58,7 @@ func (s *CaseApiSuite) TestCaseListByModuleApi(t provider.T) {
func (s *CaseApiSuite) TestCaseListBySuiteApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("/testsuites/%d", SuiteId), nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("/testsuites/%d", SuiteId), nil, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......@@ -70,7 +70,7 @@ func (s *CaseApiSuite) TestCaseListBySuiteApi(t provider.T) {
func (s *CaseApiSuite) TestCaseListByTaskApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("/testtasks/%d", TaskId), nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("/testtasks/%d", TaskId), nil, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......@@ -82,7 +82,7 @@ func (s *CaseApiSuite) TestCaseListByTaskApi(t provider.T) {
func (s *CaseApiSuite) TestCaseDetailApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("testcases/%d", CaseId), nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("testcases/%d", CaseId), nil, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......@@ -93,7 +93,7 @@ func (s *CaseApiSuite) TestCaseDetailApi(t provider.T) {
func (s *CaseApiSuite) TestCaseCheckinApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("testcases/%d", CaseId), nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("testcases/%d", CaseId), nil, constTestHelper.ZentaoSiteUrl)
steps := []commDomain.ZentaoCaseStep{
{Type: commConsts.Item, Desc: "Step 1", Expect: "Expect 1"},
......@@ -125,7 +125,7 @@ func (s *CaseApiSuite) TestCaseCheckinApi(t provider.T) {
func getCase(id int) (cs map[string]interface{}) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("testcases/%d", id), nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("testcases/%d", id), nil, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......
......@@ -27,7 +27,7 @@ func (s *ModuleApiSuite) BeforeEach(t provider.T) {
func (s *ModuleApiSuite) TestModuleListForCaseApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("modules?type=case&id=%d", ProductId), nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("modules?type=case&id=%d", ProductId), nil, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......
......@@ -26,7 +26,7 @@ func (s *ProductApiSuite) BeforeEach(t provider.T) {
func (s *ProductApiSuite) TestProductListApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl("products", nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl("products", nil, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......
......@@ -27,7 +27,7 @@ func (s *ResultApiSuite) BeforeEach(t provider.T) {
func (s *ResultApiSuite) TestResultSubmitApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl("ciresults", nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl("ciresults", nil, constTestHelper.ZentaoSiteUrl)
report := commDomain.ZtfReport{}
json.Unmarshal([]byte(reportJson), &report)
......
......@@ -27,7 +27,7 @@ func (s *SuiteApiSuite) BeforeEach(t provider.T) {
func (s *SuiteApiSuite) TestSuiteListApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("products/%d/testsuites", ProductId), nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("products/%d/testsuites", ProductId), nil, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......@@ -39,7 +39,7 @@ func (s *SuiteApiSuite) TestSuiteListApi(t provider.T) {
func (s *SuiteApiSuite) TestSuiteDetailApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("testsuites/%d", SuiteId), nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("testsuites/%d", SuiteId), nil, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......
......@@ -27,7 +27,7 @@ func (s *TaskApiSuite) BeforeEach(t provider.T) {
func (s *TaskApiSuite) TestTaskListApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("testtasks?product=%d", ProductId), nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("testtasks?product=%d", ProductId), nil, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......@@ -39,7 +39,7 @@ func (s *TaskApiSuite) TestTaskListApi(t provider.T) {
func (s *TaskApiSuite) TestTaskDetailApi(t provider.T) {
token := httpHelper.Login()
url := zentaoHelper.GenApiUrl(fmt.Sprintf("testtasks/%d", TaskId), nil, constTestHelper.ZtfUrl)
url := zentaoHelper.GenApiUrl(fmt.Sprintf("testtasks/%d", TaskId), nil, constTestHelper.ZentaoSiteUrl)
bodyBytes, _ := httpHelper.Get(url, token)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册