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
d46e72b7
Commit
d46e72b7
authored
Dec 05, 2018
by
胡梦新
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hmx
parent
99220cd4
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
258 additions
and
191 deletions
+258
-191
补给站.java
src/test/java/http/cases/SaasDeveloperTest/补给站.java
+69
-21
DeveloperBJZ.java
src/test/java/http/service/Saas/DeveloperBJZ.java
+187
-168
DeveloperObjectService.java
src/test/java/http/service/Saas/DeveloperObjectService.java
+2
-2
No files found.
src/test/java/http/cases/SaasDeveloperTest/补给站.java
View file @
d46e72b7
...
@@ -11,7 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -11,7 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
utils.PublicMethod
;
@ContextConfiguration
(
classes
=
Config
.
class
)
@ContextConfiguration
(
classes
=
Config
.
class
)
public
class
补给站
extends
DuibaTestBase
{
public
class
补给站
extends
DuibaTestBase
{
...
@@ -32,22 +31,23 @@ public class 补给站 extends DuibaTestBase {
...
@@ -32,22 +31,23 @@ public class 补给站 extends DuibaTestBase {
public
void
a_
添加至尊版实物
()
throws
Exception
{
public
void
a_
添加至尊版实物
()
throws
Exception
{
//查询列表,获取ID
//查询列表,获取ID
Response
response
=
developerBJZ
.
items
(
"2"
,
appId
);
Response
response
=
developerBJZ
.
items
(
"2"
,
appId
);
String
id
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.list[0].id"
));
String
itemId
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.list[0].id"
));
String
title
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.list[0].title"
));
String
itemIds
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.list[0].id"
));
String
appItemId
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.list[0].title"
));
//添加
//添加
developerBJZ
.
ajaxAddRepo
(
appId
,
id
);
developerBJZ
.
ajaxAddRepo
(
appId
,
i
temI
d
);
//上架
//上架
developerBJZ
.
ajaxDirectUp
(
appId
,
i
d
);
developerBJZ
.
ajaxDirectUp
(
appId
,
i
temIds
);
//查询商品列表,验证商品是否上架成功
//查询商品列表,验证商品是否上架成功
Response
response2
=
developer
ObjectService
.
appItems
(
appId
,
title
);
Response
response2
=
developer
BJZ
.
appItems
(
appId
,
appItemId
);
String
appItemId
=
response2
.
jsonPath
().
getString
(
"data.list[0].id"
);
String
appItemId
2
=
response2
.
jsonPath
().
getString
(
"data.list[0].id"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].title"
),
"测试至尊享版-实物3"
,
"校验实物标题失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].title"
),
"测试至尊享版-实物3"
,
"校验实物标题失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].status"
),
"1"
,
"校验实物状态失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].status"
),
"1"
,
"校验实物状态失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].type"
),
"object"
,
"校验实物类型失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].type"
),
"object"
,
"校验实物类型失败"
);
logger
.
info
(
"校验
title,status
成功"
);
logger
.
info
(
"校验
id,title,status,type
成功"
);
//删除添加的商品
//删除添加的商品
developer
ObjectService
.
ajaxDel
(
appItemId
);
developer
BJZ
.
ajaxDel
(
appId
,
appItemId2
);
}
}
//旗舰版app添加、上架至尊版实物:异常场景,提示不能上架
//旗舰版app添加、上架至尊版实物:异常场景,提示不能上架
...
@@ -79,20 +79,20 @@ public class 补给站 extends DuibaTestBase {
...
@@ -79,20 +79,20 @@ public class 补给站 extends DuibaTestBase {
//查询列表,获取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"
));
String
title
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.list[0].title"
));
String
appItemId
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.list[0].title"
));
//添加
//添加
developerBJZ
.
ajaxAddRepo
(
appId
,
id
);
developerBJZ
.
ajaxAddRepo
(
appId
,
id
);
//上架
//上架
developerBJZ
.
ajaxDirectUp
(
appId
,
id
);
developerBJZ
.
ajaxDirectUp
(
appId
,
id
);
//查询商品列表,验证商品是否上架成功
//查询商品列表,验证商品是否上架成功
Response
response2
=
developer
ObjectService
.
appItems
(
appId
,
title
);
Response
response2
=
developer
BJZ
.
appItems
(
appId
,
appItemId
);
String
appItemId
=
String
.
valueOf
(
response2
.
jsonPath
().
getString
(
"data.list[0].id"
));
String
appItemId
2
=
String
.
valueOf
(
response2
.
jsonPath
().
getString
(
"data.list[0].id"
));
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].title"
),
"测试至尊享版-优惠券"
,
"校验优惠券标题名称失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].title"
),
"测试至尊享版-优惠券"
,
"校验优惠券标题名称失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].status"
),
"1"
,
"校验优惠券状态失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].status"
),
"1"
,
"校验优惠券状态失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].type"
),
"coupon"
,
"校验优惠券类型失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].type"
),
"coupon"
,
"校验优惠券类型失败"
);
logger
.
info
(
"校验
title,status
成功"
);
logger
.
info
(
"校验
id,title,status,type
成功"
);
//删除添加的
商品
//删除添加的
优惠券
developer
ObjectService
.
ajaxDel
(
appItemId
);
developer
BJZ
.
ajaxDel
(
appId
,
appItemId2
);
}
}
//旗舰版app添加、上架至尊版优惠券:异常场景,提示不能上架
//旗舰版app添加、上架至尊版优惠券:异常场景,提示不能上架
...
@@ -109,21 +109,69 @@ public class 补给站 extends DuibaTestBase {
...
@@ -109,21 +109,69 @@ public class 补给站 extends DuibaTestBase {
@Test
@Test
public
void
f_
添加直冲类
()
throws
Exception
{
public
void
f_
添加直冲类
()
throws
Exception
{
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"
));
String
appItemId
=
String
.
valueOf
(
response1
.
jsonPath
().
getString
(
"data.list[1].title"
));
//添加直冲类
//添加直冲类
developerBJZ
.
ajaxAddRepo
(
appId
,
itemId
);
developerBJZ
.
ajaxAddRepo
(
appId
,
itemId
);
//查询商品列表,验证商品是否添加成功
//查询商品列表,验证商品是否添加成功
Response
response2
=
developerBJZ
.
appItems
(
appId
);
Response
response2
=
developerBJZ
.
appItems
(
appId
,
appItemId
);
String
appItemId
=
String
.
valueOf
(
response2
.
jsonPath
().
getString
(
"data.list[0].id"
));
String
appItemId
2
=
String
.
valueOf
(
response2
.
jsonPath
().
getString
(
"data.list[0].id"
));
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].title"
),
"Q币充值"
,
"校验标题名称失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].title"
),
"Q币充值"
,
"校验标题名称失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].status"
),
"0"
,
"校验状态失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].status"
),
"0"
,
"校验状态失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].type"
),
"qb"
,
"校验优惠券类型失败"
);
Assert
.
assertEquals
(
response2
.
jsonPath
().
getString
(
"data.list[0].type"
),
"qb"
,
"校验优惠券类型失败"
);
logger
.
info
(
"校验title,status成功"
);
logger
.
info
(
"校验title,status,type成功"
);
//删除添加的商品
//删除添加的直冲类
developerObjectService
.
ajaxDel
(
appItemId
);
developerBJZ
.
ajaxDel
(
appId
,
appItemId2
);
}
//添加活动
@Test
public
void
g_
添加活动
()
throws
Exception
{
//查询热门活动-活动列表,获取商品ID
Response
response
=
developerBJZ
.
saasActivitys
(
"3"
,
appId
);
String
goodItemId
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.saasActivitys[0].id"
));
//获取商品ID,进入商品订购页面,获取SKU
Response
response2
=
developerBJZ
.
itemOrderDetail
(
goodItemId
,
appId
);
String
skuId
=
String
.
valueOf
(
response2
.
jsonPath
().
getString
(
"data.goodsItemSku[0].skuId"
));
//点击订购,传入SKU创建订单
logger
.
info
(
"kuid==="
+
skuId
);
Response
response3
=
developerBJZ
.
createAutomationOrderNew
(
skuId
,
appId
);
String
orderid
=
String
.
valueOf
(
response3
.
jsonPath
().
getString
(
"data"
));
logger
.
info
(
"kuid==="
+
orderid
);
//下单购买
developerBJZ
.
orderAccountPay
(
orderid
,
appId
);
//查询是否购买成功
Response
response4
=
developerBJZ
.
findOrderById
(
orderid
,
appId
);
Assert
.
assertEquals
(
response4
.
jsonPath
().
getString
(
"data.vo.funcName"
),
"自动化测试活动--勿动"
,
"校验名称失败"
);
Assert
.
assertEquals
(
response4
.
jsonPath
().
getString
(
"data.vo.limitTime"
),
"一年"
,
"校验购买期限失败"
);
logger
.
info
(
"校验名称,期限成功"
);
}
//添加签到活动
@Test
public
void
h_
添加签到活动
()
throws
Exception
{
//查询热门活动-活动列表,获取商品ID
Response
response
=
developerBJZ
.
saasActivitys
(
"2"
,
appId
);
String
goodItemId
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"data.saasActivitys[1].id"
));
//获取商品ID,进入商品订购页面,获取SKU
Response
response2
=
developerBJZ
.
itemOrderDetail
(
goodItemId
,
appId
);
String
skuId
=
String
.
valueOf
(
response2
.
jsonPath
().
getString
(
"data.goodsItemSku[0].skuId"
));
//点击订购,传入SKU创建订单
logger
.
info
(
"kuid==="
+
skuId
);
Response
response3
=
developerBJZ
.
createAutomationOrderNew
(
skuId
,
appId
);
String
orderid
=
String
.
valueOf
(
response3
.
jsonPath
().
getString
(
"data"
));
logger
.
info
(
"kuid==="
+
orderid
);
//下单购买
developerBJZ
.
orderAccountPay
(
orderid
,
appId
);
//查询是否购买成功
Response
response4
=
developerBJZ
.
findOrderById
(
orderid
,
appId
);
Assert
.
assertEquals
(
response4
.
jsonPath
().
getString
(
"data.vo.funcName"
),
"SaaS签到"
,
"校验名称失败"
);
logger
.
info
(
"校验名称成功"
);
}
}
}
}
src/test/java/http/service/Saas/DeveloperBJZ.java
View file @
d46e72b7
This diff is collapsed.
Click to expand it.
src/test/java/http/service/Saas/DeveloperObjectService.java
View file @
d46e72b7
...
@@ -276,7 +276,7 @@ public class DeveloperObjectService {
...
@@ -276,7 +276,7 @@ public class DeveloperObjectService {
map
.
put
(
"belong"
,
""
);
map
.
put
(
"belong"
,
""
);
map
.
put
(
"priceType"
,
""
);
map
.
put
(
"priceType"
,
""
);
// logger.info("======="+url);
// logger.info("======="+url);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaas
(
"19515"
)).
params
(
map
).
post
(
url
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaas
()).
params
(
map
).
post
(
url
);
try
{
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/devItem/appItems接口失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/devItem/appItems接口失败"
);
...
@@ -296,7 +296,7 @@ public class DeveloperObjectService {
...
@@ -296,7 +296,7 @@ public class DeveloperObjectService {
map
.
put
(
"rowId"
,
"1"
);
map
.
put
(
"rowId"
,
"1"
);
map
.
put
(
"appItemId"
,
appItemId
);
map
.
put
(
"appItemId"
,
appItemId
);
// logger.info("======="+url);
// logger.info("======="+url);
Response
response
=
given
().
cookies
(
authorization
.
hdLoginSaas
(
"19515"
)).
params
(
map
).
post
(
url
);
Response
response
=
given
().
cookies
(
authorization
.
hdLoginSaas
()).
params
(
map
).
post
(
url
);
try
{
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/devItem/ajaxDel接口失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/devItem/ajaxDel接口失败"
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
...
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