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
0607fdbd
Commit
0607fdbd
authored
Apr 04, 2019
by
吕雯燕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab2.dui88.com:mabo/test-platform
parents
22d3525f
a2fef856
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
140 additions
and
82 deletions
+140
-82
扣库存测试_DuibaTest.java
...test/java/http/cases/NewActivityTest/扣库存测试_DuibaTest.java
+4
-4
瓜分积分_实际瓜分_AccessTest.java
...st/java/http/cases/PkMoudleTest/瓜分积分_实际瓜分_AccessTest.java
+2
-0
瓜分积分_实际瓜分_主胜方_AccessTest.java
...ava/http/cases/PkMoudleTest/瓜分积分_实际瓜分_主胜方_AccessTest.java
+2
-1
总帐户提现页校验_AccessTest.java
src/test/java/http/cases/WalletTest/总帐户提现页校验_AccessTest.java
+90
-0
总帐户账户正常提现_AccessTest.java
...test/java/http/cases/WalletTest/总帐户账户正常提现_AccessTest.java
+2
-1
GlobalRewardService.java
src/test/java/http/service/Activity/GlobalRewardService.java
+40
-76
No files found.
src/test/java/http/cases/NewActivityTest/扣库存测试_DuibaTest.java
View file @
0607fdbd
...
...
@@ -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/PkMoudleTest/瓜分积分_实际瓜分_AccessTest.java
View file @
0607fdbd
...
...
@@ -3,6 +3,7 @@
* FileName: 瓜分积分测试_AccessTest
* Author: zhaoran
* Date: 2018/12/10 19:45
* AppId: 21827
* Description:
*/
package
http
.
cases
.
PkMoudleTest
;
...
...
@@ -198,6 +199,7 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.prizeList[0].bonusType"
),
"4"
,
"中奖弹窗类型校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.show"
),
"true"
,
"展示弹窗校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.unitName"
),
"金币"
,
"积分单位校验失败"
);
Response
response2
=
pkService
.
popup
(
uid3
);
response
.
prettyPrint
();
...
...
src/test/java/http/cases/PkMoudleTest/瓜分积分_实际瓜分_主胜方_AccessTest.java
View file @
0607fdbd
...
...
@@ -3,7 +3,7 @@
* FileName: 瓜分积分测试_AccessTest
* Author: zhaoran
* Date: 2018/12/10 19:45
* Description:
* Description:
appId 21832
*/
package
http
.
cases
.
PkMoudleTest
;
...
...
@@ -204,6 +204,7 @@ public class 瓜分积分_实际瓜分_主胜方_AccessTest extends DuibaTestBas
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.prizeList[0].bonusType"
),
"4"
,
"中奖弹窗类型校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.show"
),
"true"
,
"展示弹窗校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.unitName"
),
"金币"
,
"积分单位校验失败"
);
Response
response2
=
pkService
.
popup
(
uid1
);
response
.
prettyPrint
();
...
...
src/test/java/http/cases/WalletTest/总帐户提现页校验_AccessTest.java
0 → 100644
View file @
0607fdbd
package
http
.
cases
.
WalletTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
http.service.Activity.GlobalRewardService
;
import
http.service.Activity.SeedRedPacketService
;
import
http.service.Activity.WalletAccountService
;
import
http.service.Authorization
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.DataProvider
;
import
org.testng.annotations.Test
;
import
utils.HbaseService
;
import
java.lang.reflect.Method
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
static
io
.
restassured
.
RestAssured
.
given
;
/**
* Created by 赵然 on 2019/04/04
* AppId: 22565
*/
public
class
总帐户提现页校验
_AccessTest
extends
DuibaTestBase
{
@Value
(
"${activity.host}"
)
String
activityHost
;
@Autowired
SeedRedPacketService
seedRedPacketService
;
@Autowired
WalletAccountService
walletAccountService
;
@Autowired
GlobalRewardService
globalRewardService
;
@Autowired
Authorization
authorization
;
@Autowired
HbaseService
hbaseService
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
//指定用户
private
static
int
uid
=
7112
;
private
static
String
consumerId
=
"100145034"
;
@Test
public
void
提现页校验
()
throws
Exception
{
Response
response
=
globalRewardService
.
toWithdraw
(
uid
);
response
.
print
();
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"
,
"关联活动名称校验失败"
);
response
=
globalRewardService
.
periodCount
(
"18157163293"
,
"22565"
,
"2"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data"
),
"1"
,
"周期个数校验失败"
);
}
}
src/test/java/http/cases/WalletTest/总帐户账户正常提现.java
→
src/test/java/http/cases/WalletTest/总帐户账户正常提现
_AccessTest
.java
View file @
0607fdbd
...
...
@@ -24,8 +24,9 @@ import static io.restassured.RestAssured.given;
/**
* Created by 赵然 on 2019/03/29
* AppId: 22565
*/
public
class
总帐户账户正常提现
extends
DuibaTestBase
{
public
class
总帐户账户正常提现
_AccessTest
extends
DuibaTestBase
{
@Value
(
"${activity.host}"
)
String
activityHost
;
@Autowired
...
...
src/test/java/http/service/Activity/GlobalRewardService.java
View file @
0607fdbd
...
...
@@ -23,30 +23,10 @@ public class GlobalRewardService {
Authorization
authorization
;
@Value
(
"${activity.host}"
)
String
activityHost
;
@Value
(
"${hdserver.host}"
)
String
hdHost
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
/**
* 获取红包账户
* @param cookies
* @return
* @throws Exception
*/
public
Response
getWalletAccount
(
Map
cookies
)
throws
Exception
{
logger
.
info
(
"请求getWalletAccount"
);
Response
response
=
given
().
cookies
(
cookies
).
get
(
activityHost
+
"/walletAccount/getWalletAccount"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/walletAccount/getWalletAccount接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/walletAccount/getWalletAccount接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/walletAccount/getWalletAccount接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
/**
* 红包账户提现
* @param cookies
...
...
@@ -77,92 +57,76 @@ public class GlobalRewardService {
}
/**
* 红包账户提现
* @param cookies
* @param orderId
* 红包账户提现页
* @param uid
* @return
* @throws Exception
*/
public
Response
getOrderStatus
(
Map
cookies
,
String
orderId
)
throws
Exception
{
logger
.
info
(
"请求getOrderStatus"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"orderId"
,
orderId
);
public
Response
toWithdraw
(
int
uid
)
throws
Exception
{
logger
.
info
(
"请求toWithdraw"
);
Response
response
=
given
().
co
okies
(
cookies
).
params
(
map
).
post
(
activityHost
+
"/walletAccount/getOrderStatus
"
);
Response
response
=
given
().
co
ntentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
get
(
activityHost
+
"/globalReward/toWithdraw
"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/
walletAccount/getOrderStatus
接口失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/
globalReward/toWithdraw
接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/
walletAccount/getOrderStatus
接口失败,返回信息:"
+
response
.
asString
());
throw
new
Exception
(
"/
globalReward/toWithdraw
接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/
walletAccount/getOrderStatus
接口失败,返回信息:"
+
response
.
asString
());
throw
new
Exception
(
"/
globalReward/toWithdraw
接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
public
Response
getOrderStatus2
(
Map
cookies
,
String
orderId
)
throws
Exception
{
logger
.
info
(
"请求getOrderStatus"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"orderId"
,
orderId
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
map
).
post
(
activityHost
+
"/walletAccount/getOrderStatus"
);
return
response
;
}
/**
* 红包账户提现记录
* @param cookies
* 开发者后台红包周期列表
* @param account
* @param appId
* @param periodStatus 2:进行中
* @return
* @throws Exception
*/
public
Response
walletDetail
(
Map
cookie
s
)
throws
Exception
{
logger
.
info
(
"请求
walletDetail
"
);
public
Response
periodList
(
String
account
,
String
appId
,
String
periodStatu
s
)
throws
Exception
{
logger
.
info
(
"请求
periodList
"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"p
ageNo"
,
"1"
);
map
.
put
(
"page
Size"
,
"12
"
);
Response
response
=
given
().
co
okies
(
cookies
).
params
(
map
).
get
(
activityHost
+
"/walletAccount/walletDetail
"
);
map
.
put
(
"p
eriodStatus"
,
periodStatus
);
map
.
put
(
"page
Num"
,
"1
"
);
map
.
put
(
"pageSize"
,
"10"
);
Response
response
=
given
().
co
ntentType
(
"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"
,
"/
walletAccount/walletDetail
接口失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/
globalReward/toWithdraw
接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/
walletAccount/walletDetail
接口失败,返回信息:"
+
response
.
asString
());
throw
new
Exception
(
"/
redpackets/manageTool/periodList
接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/
walletAccount/walletDetail
接口失败,返回信息:"
+
response
.
asString
());
throw
new
Exception
(
"/
redpackets/manageTool/periodList
接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
/**
*
红包账户修改钱包账户余额后门
* @param
consumerId
* @param a
ccountType
* @param
balanceAmount
*
开发者后台红包周期个数
* @param
account
* @param a
ppId
* @param
periodStatus 2:进行中
* @return
* @throws Exception
*/
public
void
updateConsumerAccount
(
String
consumerId
,
String
accountType
,
String
balanceAmount
)
throws
Exception
{
logger
.
info
(
"请求
修改钱包账户余额后门:updateConsumerAcc
ount"
);
public
Response
periodCount
(
String
account
,
String
appId
,
String
periodStatus
)
throws
Exception
{
logger
.
info
(
"请求
periodC
ount"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"consumerId"
,
consumerId
);
map
.
put
(
"accountType"
,
accountType
);
map
.
put
(
"balanceAmount"
,
balanceAmount
);
Response
response
=
given
().
params
(
map
).
get
(
activityHost
+
"/aaw/automated/updateConsumerAccount"
);
// try{
// Assert.assertEquals(response.jsonPath().getString("success"),"true","/walletAccount/walletDetail接口失败");
//
// }catch(Exception e){
// throw new Exception("/aaw/automated/updateConsumerAccount接口失败,返回信息:"+response.asString());
// }catch(Error er){
// throw new Exception("/aaw/automated/updateConsumerAccount接口失败,返回信息:"+response.asString());
//
// }
//return response;
map
.
put
(
"periodStatus"
,
periodStatus
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaasNew
(
account
,
appId
)).
params
(
map
).
post
(
"http://"
+
hdHost
+
"/redpackets/manageTool/periodCount"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/globalReward/toWithdraw接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/redpackets/manageTool/periodCount接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/redpackets/manageTool/periodCount接口失败,返回信息:"
+
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