Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
fbbe74cd
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
大约 1 年 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fbbe74cd
编写于
5月 30, 2023
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test restapi
上级
5ad9282c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
19 addition
and
19 deletion
+19
-19
test/restapi/api_bug_test.go
test/restapi/api_bug_test.go
+5
-5
test/restapi/api_case_test.go
test/restapi/api_case_test.go
+7
-7
test/restapi/api_module_test.go
test/restapi/api_module_test.go
+1
-1
test/restapi/api_product_test.go
test/restapi/api_product_test.go
+1
-1
test/restapi/api_result_test.go
test/restapi/api_result_test.go
+1
-1
test/restapi/api_suite_test.go
test/restapi/api_suite_test.go
+2
-2
test/restapi/api_task_test.go
test/restapi/api_task_test.go
+2
-2
未找到文件。
test/restapi/api_bug_test.go
浏览文件 @
fbbe74cd
...
...
@@ -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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"products/%d/bugs"
,
ProductId
),
nil
,
constTestHelper
.
Z
entaoSite
Url
)
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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"products/%d/bugs"
,
ProductId
),
nil
,
constTestHelper
.
Z
entaoSite
Url
)
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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
"options/bug"
,
params
,
constTestHelper
.
Z
entaoSite
Url
)
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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"bugs/%d"
,
id
),
nil
,
constTestHelper
.
Z
entaoSite
Url
)
bodyBytes
,
_
:=
httpHelper
.
Get
(
url
,
token
)
...
...
test/restapi/api_case_test.go
浏览文件 @
fbbe74cd
...
...
@@ -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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"/products/%d/testcases"
,
ProductId
),
params
,
constTestHelper
.
Z
entaoSite
Url
)
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
.
Z
tf
Url
)
nil
,
constTestHelper
.
Z
entaoSite
Url
)
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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"/testsuites/%d"
,
SuiteId
),
nil
,
constTestHelper
.
Z
entaoSite
Url
)
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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"/testtasks/%d"
,
TaskId
),
nil
,
constTestHelper
.
Z
entaoSite
Url
)
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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"testcases/%d"
,
CaseId
),
nil
,
constTestHelper
.
Z
entaoSite
Url
)
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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"testcases/%d"
,
CaseId
),
nil
,
constTestHelper
.
Z
entaoSite
Url
)
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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"testcases/%d"
,
id
),
nil
,
constTestHelper
.
Z
entaoSite
Url
)
bodyBytes
,
_
:=
httpHelper
.
Get
(
url
,
token
)
...
...
test/restapi/api_module_test.go
浏览文件 @
fbbe74cd
...
...
@@ -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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"modules?type=case&id=%d"
,
ProductId
),
nil
,
constTestHelper
.
Z
entaoSite
Url
)
bodyBytes
,
_
:=
httpHelper
.
Get
(
url
,
token
)
...
...
test/restapi/api_product_test.go
浏览文件 @
fbbe74cd
...
...
@@ -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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
"products"
,
nil
,
constTestHelper
.
Z
entaoSite
Url
)
bodyBytes
,
_
:=
httpHelper
.
Get
(
url
,
token
)
...
...
test/restapi/api_result_test.go
浏览文件 @
fbbe74cd
...
...
@@ -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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
"ciresults"
,
nil
,
constTestHelper
.
Z
entaoSite
Url
)
report
:=
commDomain
.
ZtfReport
{}
json
.
Unmarshal
([]
byte
(
reportJson
),
&
report
)
...
...
test/restapi/api_suite_test.go
浏览文件 @
fbbe74cd
...
...
@@ -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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"products/%d/testsuites"
,
ProductId
),
nil
,
constTestHelper
.
Z
entaoSite
Url
)
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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"testsuites/%d"
,
SuiteId
),
nil
,
constTestHelper
.
Z
entaoSite
Url
)
bodyBytes
,
_
:=
httpHelper
.
Get
(
url
,
token
)
...
...
test/restapi/api_task_test.go
浏览文件 @
fbbe74cd
...
...
@@ -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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"testtasks?product=%d"
,
ProductId
),
nil
,
constTestHelper
.
Z
entaoSite
Url
)
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
.
Z
tf
Url
)
url
:=
zentaoHelper
.
GenApiUrl
(
fmt
.
Sprintf
(
"testtasks/%d"
,
TaskId
),
nil
,
constTestHelper
.
Z
entaoSite
Url
)
bodyBytes
,
_
:=
httpHelper
.
Get
(
url
,
token
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录