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
fd64fe09
Commit
fd64fe09
authored
Apr 04, 2019
by
赵然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zr
parent
cc7e74d3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
9 deletions
+69
-9
扣库存测试_DuibaTest.java
...test/java/http/cases/NewActivityTest/扣库存测试_DuibaTest.java
+4
-4
总帐户提现页校验.java
src/test/java/http/cases/WalletTest/总帐户提现页校验.java
+29
-4
总帐户账户正常提现.java
src/test/java/http/cases/WalletTest/总帐户账户正常提现.java
+1
-0
GlobalRewardService.java
src/test/java/http/service/Activity/GlobalRewardService.java
+35
-1
No files found.
src/test/java/http/cases/NewActivityTest/扣库存测试_DuibaTest.java
View file @
fd64fe09
...
...
@@ -222,7 +222,7 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase {
@Test
public
void
自有活动工具扣库存测试
()
throws
Exception
{
//获取兑换项库存
Response
response
=
developerService
.
appItems
(
"2239"
,
"【自动化勿动】自有优惠券"
);
Response
response
=
developerService
.
appItems
(
"2239"
,
"【自动化勿动】
zr
自有优惠券"
);
//response.prettyPrint();
String
remind
=
response
.
jsonPath
().
getString
(
"data.list[0].remaind"
);
logger
.
info
(
"抽奖前兑换项库存为:"
+
remind
);
...
...
@@ -240,18 +240,18 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase {
response
=
this
.
新活动工具接口传参
(
"28247"
,
"abcde"
,
"iOS"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"lottery.type"
),
"coupon"
,
"校验type失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"lottery.title"
),
"【自动化勿动】自有优惠券"
,
"校验title失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"lottery.title"
),
"【自动化勿动】
zr
自有优惠券"
,
"校验title失败"
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getString
(
"lottery.link"
).
contains
(
"/crecord/recordDetailNew?orderId="
));
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"lottery.id"
),
"16405"
,
"校验id失败"
);
logger
.
info
(
"校验实物商品:type,title,link,id成功"
);
//校验兑换项库存
response
=
developerService
.
appItems
(
"2239"
,
"【自动化勿动】自有优惠券"
);
response
=
developerService
.
appItems
(
"2239"
,
"【自动化勿动】
zr
自有优惠券"
);
String
Newremind
=
response
.
jsonPath
().
getString
(
"data.list[0].remaind"
);
int
i
=
10
;
while
(
i
>
0
&&
!
Newremind
.
equals
(
remind
)){
Thread
.
sleep
(
500
);
response
=
developerService
.
appItems
(
"2239"
,
"【自动化勿动】自有优惠券"
);
response
=
developerService
.
appItems
(
"2239"
,
"【自动化勿动】
zr
自有优惠券"
);
Newremind
=
response
.
jsonPath
().
getString
(
"data.list[0].remaind"
);
i
--;
}
...
...
src/test/java/http/cases/WalletTest/总帐户提现页校验.java
View file @
fd64fe09
...
...
@@ -23,6 +23,7 @@ import static io.restassured.RestAssured.given;
/**
* Created by 赵然 on 2019/04/04
* AppId: 22565
*/
public
class
总帐户提现页校验
extends
DuibaTestBase
{
@Value
(
"${activity.host}"
)
...
...
@@ -48,15 +49,39 @@ public class 总帐户提现页校验 extends DuibaTestBase{
Response
response
=
globalRewardService
.
toWithdraw
(
uid
);
response
.
print
();
String
expireTime
=
response
.
jsonPath
().
getString
(
"expireTime"
);
String
perLimitAmount
=
response
.
jsonPath
().
getString
(
"perLimitAmount"
);
String
periodOpen
=
response
.
jsonPath
().
getString
(
"periodOpen"
);
String
expireTime
=
response
.
jsonPath
().
getString
(
"
data.
expireTime"
);
String
perLimitAmount
=
response
.
jsonPath
().
getString
(
"
data.
perLimitAmount"
);
String
periodOpen
=
response
.
jsonPath
().
getString
(
"
data.
periodOpen"
);
Assert
.
assertEquals
(
expireTime
,
"2021/01/31 00:00:00"
,
"提现页过期时间校验失败"
);
Assert
.
assertEquals
(
perLimitAmount
,
"2000"
,
"提现页满额提现金额校验失败"
);
Assert
.
assertEquals
(
periodOpen
,
"true"
,
"总帐户状态校验失败"
);
logger
.
info
(
"总帐户提现页校验成功!"
);
}
@Test
public
void
后台红包周期校验
()
throws
Exception
{
}
Response
response
=
globalRewardService
.
periodList
(
"18157163293"
,
"22565"
,
"2"
);
response
.
print
();
String
bonusLimit
=
response
.
jsonPath
().
getString
(
"data[0].bonusLimit"
);
String
forConfirm
=
response
.
jsonPath
().
getString
(
"data[0].forConfirm"
);
String
periodStatus
=
response
.
jsonPath
().
getString
(
"data[0].periodStatus"
);
String
withdrawThreshold
=
response
.
jsonPath
().
getString
(
"data[0].withdrawThreshold"
);
String
relType
=
response
.
jsonPath
().
getString
(
"data[0].relList[0].relType"
);
String
relTypeName
=
response
.
jsonPath
().
getString
(
"data[0].relList[0].relTypeName"
);
Assert
.
assertEquals
(
bonusLimit
,
"40000"
,
"红包预算校验失败"
);
Assert
.
assertEquals
(
forConfirm
,
"false"
,
"确认按钮校验失败"
);
Assert
.
assertEquals
(
periodStatus
,
"OPEN"
,
"总帐户状态校验失败"
);
Assert
.
assertEquals
(
withdrawThreshold
,
"2000"
,
"用户提现限制校验失败"
);
Assert
.
assertEquals
(
relType
,
"PK"
,
"关联活动类型校验失败"
);
Assert
.
assertEquals
(
relTypeName
,
"组件pk"
,
"关联活动名称校验失败"
);
}
}
src/test/java/http/cases/WalletTest/总帐户账户正常提现.java
View file @
fd64fe09
...
...
@@ -24,6 +24,7 @@ import static io.restassured.RestAssured.given;
/**
* Created by 赵然 on 2019/03/29
* AppId: 22565
*/
public
class
总帐户账户正常提现
extends
DuibaTestBase
{
@Value
(
"${activity.host}"
)
...
...
src/test/java/http/service/Activity/GlobalRewardService.java
View file @
fd64fe09
...
...
@@ -23,6 +23,8 @@ public class GlobalRewardService {
Authorization
authorization
;
@Value
(
"${activity.host}"
)
String
activityHost
;
@Value
(
"${hdserver.host}"
)
String
hdHost
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
/**
...
...
@@ -54,7 +56,12 @@ public class GlobalRewardService {
}
/**
* 红包账户提现页
* @param uid
* @return
* @throws Exception
*/
public
Response
toWithdraw
(
int
uid
)
throws
Exception
{
logger
.
info
(
"请求toWithdraw"
);
...
...
@@ -72,4 +79,31 @@ public class GlobalRewardService {
}
/**
* 开发者后台红包周期列表
* @param account
* @param appId
* @param periodStatus 2:进行中
* @return
* @throws Exception
*/
public
Response
periodList
(
String
account
,
String
appId
,
String
periodStatus
)
throws
Exception
{
logger
.
info
(
"请求periodList"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"periodStatus"
,
periodStatus
);
map
.
put
(
"pageNum"
,
"1"
);
map
.
put
(
"pageSize"
,
"10"
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaasNew
(
account
,
appId
)).
params
(
map
).
post
(
"http://"
+
hdHost
+
"/redpackets/manageTool/periodList"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/globalReward/toWithdraw接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/redpackets/manageTool/periodList接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/redpackets/manageTool/periodList接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
}
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