Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
test-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马博
test-platform
Commits
99220cd4
Commit
99220cd4
authored
Dec 05, 2018
by
胡梦新
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hmx
parent
ebe0b46a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
5 deletions
+51
-5
补给站.java
src/test/java/http/cases/SaasDeveloperTest/补给站.java
+32
-4
DeveloperBJZ.java
src/test/java/http/service/Saas/DeveloperBJZ.java
+19
-1
No files found.
src/test/java/http/cases/SaasDeveloperTest/补给站.java
View file @
99220cd4
...
@@ -21,10 +21,13 @@ public class 补给站 extends DuibaTestBase {
...
@@ -21,10 +21,13 @@ public class 补给站 extends DuibaTestBase {
DeveloperObjectService
developerObjectService
;
DeveloperObjectService
developerObjectService
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
//至尊版app
String
appId
=
"19515"
;
String
appId
=
"19515"
;
//旗舰版app
String
appId2
=
"21695"
;
//添加、上架至尊版实物
//
至尊版app
添加、上架至尊版实物
@Test
@Test
public
void
a_
添加至尊版实物
()
throws
Exception
{
public
void
a_
添加至尊版实物
()
throws
Exception
{
//查询列表,获取ID
//查询列表,获取ID
...
@@ -47,8 +50,21 @@ public class 补给站 extends DuibaTestBase {
...
@@ -47,8 +50,21 @@ public class 补给站 extends DuibaTestBase {
developerObjectService
.
ajaxDel
(
appItemId
);
developerObjectService
.
ajaxDel
(
appItemId
);
}
}
//旗舰版app添加、上架至尊版实物:异常场景,提示不能上架
@Test
@Test
public
void
b_
实物搜索
()
throws
Exception
{
public
void
b_
旗舰版添加至尊版实物
()
throws
Exception
{
//查询列表,获取ID
Response
response
=
developerBJZ
.
items
(
"2"
,
appId2
);
String
id
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.list[0].id"
));
//上架
Response
response2
=
developerBJZ
.
ajaxDirectUp2
(
appId2
,
id
);
//接口提示,至尊版专享,不能上架
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"desc"
),
"至尊版专享"
,
"校验接口上架失败"
);
}
//优质好货搜索功能
@Test
public
void
c_
实物搜索
()
throws
Exception
{
// 根据具体的名称搜索出实物
// 根据具体的名称搜索出实物
developerBJZ
.
items2
(
"2"
,
appId
);
developerBJZ
.
items2
(
"2"
,
appId
);
// 输入精确的名称查询不到此实物
// 输入精确的名称查询不到此实物
...
@@ -59,7 +75,7 @@ public class 补给站 extends DuibaTestBase {
...
@@ -59,7 +75,7 @@ public class 补给站 extends DuibaTestBase {
//添加、上架优惠券
//添加、上架优惠券
@Test
@Test
public
void
c
_
添加至尊版优惠券
()
throws
Exception
{
public
void
d
_
添加至尊版优惠券
()
throws
Exception
{
//查询列表,获取ID
//查询列表,获取ID
Response
response
=
developerBJZ
.
coupons
(
appId
,
"2"
);
Response
response
=
developerBJZ
.
coupons
(
appId
,
"2"
);
String
id
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.list[0].id"
));
String
id
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.list[0].id"
));
...
@@ -79,8 +95,20 @@ public class 补给站 extends DuibaTestBase {
...
@@ -79,8 +95,20 @@ public class 补给站 extends DuibaTestBase {
developerObjectService
.
ajaxDel
(
appItemId
);
developerObjectService
.
ajaxDel
(
appItemId
);
}
}
//旗舰版app添加、上架至尊版优惠券:异常场景,提示不能上架
@Test
public
void
e_
旗舰版添加至尊版优惠券
()
throws
Exception
{
//查询列表,获取ID
Response
response
=
developerBJZ
.
coupons
(
appId2
,
"2"
);
String
id
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.list[0].id"
));
//上架
Response
response2
=
developerBJZ
.
ajaxDirectUp2
(
appId2
,
id
);
//接口提示,至尊版专享,不能上架
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"desc"
),
"至尊版专享"
,
"校验接口上架失败"
);
}
@Test
@Test
public
void
e
_
添加直冲类
()
throws
Exception
{
public
void
f
_
添加直冲类
()
throws
Exception
{
String
data
=
PublicMethod
.
data
();
String
data
=
PublicMethod
.
data
();
Response
response1
=
developerBJZ
.
directCharges
(
appId
);
Response
response1
=
developerBJZ
.
directCharges
(
appId
);
String
itemId
=
String
.
valueOf
(
response1
.
jsonPath
().
getString
(
"data.list[1].id"
));
String
itemId
=
String
.
valueOf
(
response1
.
jsonPath
().
getString
(
"data.list[1].id"
));
...
...
src/test/java/http/service/Saas/DeveloperBJZ.java
View file @
99220cd4
...
@@ -77,7 +77,7 @@ public class DeveloperBJZ {
...
@@ -77,7 +77,7 @@ public class DeveloperBJZ {
map
.
put
(
"rowId"
,
"1"
);
map
.
put
(
"rowId"
,
"1"
);
map
.
put
(
"itemName"
,
"测试至尊享版-实物31"
);
map
.
put
(
"itemName"
,
"测试至尊享版-实物31"
);
map
.
put
(
"max"
,
"20"
);
map
.
put
(
"max"
,
"20"
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaas
(
"19515"
)).
params
(
map
).
get
(
url
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaas
(
appId
)).
params
(
map
).
get
(
url
);
try
{
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"成功"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"成功"
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
@@ -123,6 +123,24 @@ public class DeveloperBJZ {
...
@@ -123,6 +123,24 @@ public class DeveloperBJZ {
return
response
;
return
response
;
}
}
//旗舰版app上架:至尊特权商品
public
Response
ajaxDirectUp2
(
String
appId2
,
String
itemIds
)
throws
Exception
{
String
url
=
"http://"
+
hdHost
+
"/devRepo/ajaxDirectUp"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
appId2
);
map
.
put
(
"itemIds"
,
itemIds
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaas
(
appId2
)).
params
(
map
).
post
(
url
);
response
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"至尊版专享"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"创建接口1失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"创建接口2失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
//大牌好券--查询至尊版特权TAB
//大牌好券--查询至尊版特权TAB
public
Response
coupons
(
String
appId
,
String
type
)
throws
Exception
{
public
Response
coupons
(
String
appId
,
String
type
)
throws
Exception
{
String
url
=
"http://"
+
hdHost
+
"/saasitem/coupons"
;
String
url
=
"http://"
+
hdHost
+
"/saasitem/coupons"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment