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
ff707124
Commit
ff707124
authored
Mar 18, 2019
by
吕雯燕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv
parent
4d3804b3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
32 deletions
+114
-32
Qb_兑换限制测试_ExchangeTest.java
.../java/http/cases/ExchangeTest/Qb_兑换限制测试_ExchangeTest.java
+90
-13
多档位话费_兑换流程测试_ExchangeTest.java
...va/http/cases/ExchangeTest/多档位话费_兑换流程测试_ExchangeTest.java
+1
-0
支付宝_兑换流程测试_ExchangeTest.java
...java/http/cases/ExchangeTest/支付宝_兑换流程测试_ExchangeTest.java
+23
-19
No files found.
src/test/java/http/cases/ExchangeTest/Qb_兑换限制测试_ExchangeTest.java
View file @
ff707124
...
...
@@ -63,9 +63,8 @@ public class Qb_兑换限制测试_ExchangeTest extends CheckTemplet {
return
result
;
}
@Test
(
description
=
"每限日兑换制同一个用户使用同一个QQ号"
)
public
void
每限日兑换制同一个用户兑换同一个
qq
()
throws
Exception
{
logger
.
info
(
"Q币每限日兑换制同一个用户兑换同一个qq开始"
);
@Test
(
description
=
"Q币1元用户兑换限制每天"
)
public
void
用户每日兑换限制
()
throws
Exception
{
int
uid
=
4932
;
//第一次兑换
...
...
@@ -84,17 +83,57 @@ public class Qb_兑换限制测试_ExchangeTest extends CheckTemplet {
response
=
qbExchangeService
.
doTakePrize1
(
authorization
.
dafuwengLogin
(
uid
),
"1234345554"
,
"1"
);
message
=
response
.
jsonPath
().
getString
(
"message"
);
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"已兑完"
));
logger
.
info
(
"Q币每限日兑换制同一个用户兑换同一个qq成功"
);
//获取按钮状态
Response
detailResponse
=
mobileService
.
detail
(
authorization
.
dafuwengLogin
(
uid
),
"2"
);
String
btnText
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"1\":\\{\"btnText\":\"(.*?)\","
,
1
);
logger
.
info
(
"兑换按钮:"
+
btnText
);
Assert
.
assertTrue
(
message
.
contains
(
"已兑完"
),
"校验message失败"
);
Assert
.
assertEquals
(
btnText
,
"今日已兑换"
,
"校验兑换按钮失败"
);
logger
.
info
(
"校验Q币1元每日用户兑换限制成功"
);
}
@Test
(
description
=
"每限日兑换制同一个用户使用不同一个QQ号"
)
public
void
每限日兑换制同一个用户使用不同一个
QQ
号
()
throws
Exception
{
logger
.
info
(
"每限日兑换制同一个用户使用不同一个QQ号开始"
);
@Test
(
description
=
"Q币2元用户兑换限制永久"
)
public
void
用户永久兑换限制
()
throws
Exception
{
int
uid
=
4933
;
//第一次兑换
Response
response
=
qbExchangeService
.
doTakePrize
(
authorization
.
dafuwengLogin
(
uid
),
"1234345554"
,
"1"
);
Response
response
=
qbExchangeService
.
doTakePrize
(
authorization
.
dafuwengLogin
(
uid
),
"1234345554"
,
"2"
);
String
orderId
=
(
String
)
response
.
jsonPath
().
get
(
"orderId"
);
response
=
mobileService
.
orderStatusQuery
(
authorization
.
dafuwengLogin
(
uid
),
orderId
);
String
message
=
response
.
jsonPath
().
getString
(
"message"
);
int
i
=
10
;
while
(!
message
.
equals
(
"兑换提交成功!待处理"
)&&
i
>
0
){
Thread
.
sleep
(
1000
);
response
=
mobileService
.
orderStatusQuery
(
authorization
.
dafuwengLogin
(
uid
),
orderId
);
message
=
response
.
jsonPath
().
getString
(
"message"
);
i
--;
}
//第二次兑换
response
=
qbExchangeService
.
doTakePrize1
(
authorization
.
dafuwengLogin
(
uid
),
"12343455541"
,
"2"
);
response
.
prettyPrint
();
message
=
response
.
jsonPath
().
getString
(
"message"
);
logger
.
info
(
message
);
//获取按钮状态
Response
detailResponse
=
mobileService
.
detail
(
authorization
.
dafuwengLogin
(
uid
),
"2"
);
String
btnText
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"2\":\\{\"btnText\":\"(.*?)\","
,
1
);
logger
.
info
(
"兑换按钮:"
+
btnText
);
Assert
.
assertTrue
(
message
.
contains
(
"已兑完"
),
"校验Message失败"
);
Assert
.
assertEquals
(
btnText
,
"已兑换"
,
"校验兑换按钮失败"
);
logger
.
info
(
"校验Q币2元用户永久兑换限制成功"
);
}
@Test
(
description
=
"Q币3元用户兑换限制每月"
)
public
void
用户每月兑换限制
()
throws
Exception
{
int
uid
=
4933
;
//第一次兑换
Response
response
=
qbExchangeService
.
doTakePrize
(
authorization
.
dafuwengLogin
(
uid
),
"1234345554"
,
"3"
);
String
orderId
=
(
String
)
response
.
jsonPath
().
get
(
"orderId"
);
response
=
mobileService
.
orderStatusQuery
(
authorization
.
dafuwengLogin
(
uid
),
orderId
);
String
message
=
response
.
jsonPath
().
getString
(
"message"
);
...
...
@@ -106,13 +145,51 @@ public class Qb_兑换限制测试_ExchangeTest extends CheckTemplet {
i
--;
}
//第二次兑换
response
=
qbExchangeService
.
doTakePrize1
(
authorization
.
dafuwengLogin
(
uid
),
"12343455541"
,
"
1
"
);
response
=
qbExchangeService
.
doTakePrize1
(
authorization
.
dafuwengLogin
(
uid
),
"12343455541"
,
"
3
"
);
response
.
prettyPrint
();
message
=
response
.
jsonPath
().
getString
(
"message"
);
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"已兑完"
));
// Assert.assertTrue(message.contains("\"success\":false"));
logger
.
info
(
"每限日兑换制同一个用户使用不同一个QQ号成功"
);
//获取按钮状态
Response
detailResponse
=
mobileService
.
detail
(
authorization
.
dafuwengLogin
(
uid
),
"2"
);
String
btnText
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"3\":\\{\"btnText\":\"(.*?)\","
,
1
);
logger
.
info
(
"兑换按钮:"
+
btnText
);
Assert
.
assertTrue
(
message
.
contains
(
"已兑完"
),
"校验Message失败"
);
Assert
.
assertEquals
(
btnText
,
"已兑换"
,
"校验兑换按钮失败"
);
logger
.
info
(
"校验Q币3元用户每月兑换限制成功"
);
}
@Test
(
description
=
"Q币兑换会员等级限制"
)
public
void
会员等级测试
()
throws
Exception
{
//开发者账号lv测试应用33, 15833333333
String
degreeId
=
"1"
;
String
message
=
""
;
int
uid
=
6569
;
int
vipUid
=
6705
;
//会员等级无法兑换
try
{
Response
response
=
qbExchangeService
.
doTakePrize
(
authorization
.
dafuwengLogin
(
uid
),
"1234345554"
,
degreeId
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
//会员等级可兑换,vip=5
Response
response
=
qbExchangeService
.
doTakePrize
(
authorization
.
generateSignAutoLogin
(
"42vkFzeLnoNjXt6AhMM7LPj4G8pT"
,
vipUid
),
"1234345554"
,
degreeId
);
response
.
prettyPrint
();
Assert
.
assertTrue
(
message
.
contains
(
"会员等级不符,请挑选其他吧(15)"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验success失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"校验兑换结果失败"
);
logger
.
info
(
"校验Q币会员等级成功"
);
}
@Test
(
description
=
"每限日兑换制不同一个用户使用同一个QQ号"
)
...
...
src/test/java/http/cases/ExchangeTest/多档位话费_兑换流程测试_ExchangeTest.java
View file @
ff707124
...
...
@@ -173,6 +173,7 @@ public class 多档位话费_兑换流程测试_ExchangeTest extends CheckTemple
@Test
(
description
=
"多档位话费会员等级"
)
public
void
会员等级测试
()
throws
Exception
{
//开发者账号lv测试应用33, 15833333333
String
degreeId
=
"10"
;
String
message
=
""
;
int
uid
=
6569
;
...
...
src/test/java/http/cases/ExchangeTest/支付宝_兑换流程测试_ExchangeTest.java
View file @
ff707124
...
...
@@ -67,6 +67,8 @@ public class 支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
result
=
new
Object
[][]{
new
Object
[]{
1
,
"peeulk6392@sandbox.com"
,
"沙箱环境"
,
"2"
,
"支付宝用户永久兑换限制测试"
},
//case1
new
Object
[]{
2
,
"peeulk6392@sandbox.com"
,
"沙箱环境"
,
"3"
,
"支付宝用户每日兑换限制测试"
},
//case2
new
Object
[]{
3
,
"peeulk6392@sandbox.com"
,
"沙箱环境"
,
"4"
,
"支付宝用户每月兑换限制测试"
},
//case3
};
}
...
...
@@ -74,55 +76,49 @@ public class 支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
}
//
@Test
@Test
public
void
支付宝审核通过测试
()
throws
Exception
{
//查询兑换前的开发者账户余额
// Response accountResponse = developerAccountService.accountInfo();
// String remainMoney = accountResponse.jsonPath().getString("data.remainMoney");
// logger.info("兑换前的开发者账户余额:" + remainMoney);
// String remainMoneyNew =String.valueOf(Integer.valueOf(remainMoney) - 1020) ;
int
uid
=
6569
;
//支付宝兑换
String
orderId
=
this
.
支付宝兑换订单
(
uid
,
"peeulk6392@sandbox.com"
,
"沙箱环境"
,
"10"
);
logger
.
info
(
"订单号:"
+
orderId
);
//订单审核,判断是否在待审核节点
Map
<
String
,
Object
>
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
7
+
" WHERE id = "
+
orderId
);
Map
<
String
,
Object
>
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
9
+
" WHERE id = "
+
orderId
);
String
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
Assert
.
assertEquals
(
flowWork
,
"Audit-started"
,
"校验订单审核节点失败"
);
String
orderIdmain
=
String
.
valueOf
(
mapOrder
.
get
(
"order_num"
));
logger
.
info
(
"兑吧订单号为:"
+
orderIdmain
);
int
i
=
10
;
while
(
i
>
0
&&
!
flowWork
.
equals
(
"Audit-started"
))
{
Thread
.
sleep
(
300
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
7
+
" WHERE id = "
+
orderId
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
9
+
" WHERE id = "
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
i
--;
}
Response
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"pass"
);
Response
auditResponse
=
dsOrderService
.
submitAudit
(
"22542"
,
orderId
,
"pass"
,
authorization
.
hdLoginCommonNew
(
"15833333333"
)
);
auditResponse
.
prettyPrint
();
//判断订单是否审核成功,如果订单没有成功则继续审核
int
j
=
10
;
while
(
j
>
0
&&
!
flowWork
.
equals
(
"Success-complete"
))
{
Thread
.
sleep
(
1000
);
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"pass"
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
7
+
" WHERE id = "
+
orderId
);
auditResponse
=
dsOrderService
.
submitAudit
(
"22542"
,
orderId
,
"pass"
,
authorization
.
hdLoginCommonNew
(
"15833333333"
)
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
9
+
" WHERE id = "
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
j
--;
}
String
status
=
String
.
valueOf
(
mapOrder
.
get
(
"status"
));
//兑换后的开发者账户余额
// accountResponse = developerAccountService.accountInfo();
// remainMoney = accountResponse.jsonPath().getString("data.remainMoney");
// logger.info("兑换后的开发者账户余额:" + remainMoney);
//校验开发者账户余额变动
Response
accountResponse
=
developerAccountService
.
cashDetail
(
orderIdmain
);
Response
accountResponse
=
developerAccountService
.
cashDetail
(
authorization
.
hdLoginCommonNew
(
"15833333333"
),
orderIdmain
);
String
remainMoney
=
String
.
valueOf
(
Integer
.
valueOf
(
accountResponse
.
jsonPath
().
getString
(
"data.list[0].balance"
))+
Integer
.
valueOf
(
accountResponse
.
jsonPath
().
getString
(
"data.list[0].moneyChange"
)));
logger
.
info
(
"兑换前的开发者账户余额:"
+
remainMoney
);
remainMoney
=
String
.
valueOf
(
Integer
.
valueOf
(
remainMoney
)
-
1020
)
;
...
...
@@ -131,7 +127,7 @@ public class 支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
Assert
.
assertEquals
(
remainMoneyNew
,
remainMoney
,
"校验开发者账户余额失败"
);
Assert
.
assertEquals
(
status
,
"success"
,
"校验订单状态失败"
);
logger
.
info
(
"校验支付宝扣费订单成功"
);
logger
.
info
(
"校验支付宝
审核
扣费订单成功"
);
}
...
...
@@ -277,6 +273,7 @@ public class 支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
@Test
(
dataProvider
=
"providerMethod"
)
public
void
支付宝用户兑换限制测试
(
int
caseNum
,
String
alipay
,
String
realName
,
String
degreeId
,
String
caseName
)
throws
Exception
{
logger
.
info
(
"----"
+
caseName
+
"----"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"alipay"
,
alipay
);
map
.
put
(
"realname"
,
realName
);
...
...
@@ -300,6 +297,7 @@ public class 支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
// detailResponse.prettyPrint();
String
btnText2
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"2\":\\{\"btnText\":\"(.*?)\","
,
1
);
String
btnText3
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"3\":\\{\"btnText\":\"(.*?)\","
,
1
);
String
btnText4
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"4\":\\{\"btnText\":\"(.*?)\","
,
1
);
switch
(
caseNum
){
...
...
@@ -307,13 +305,19 @@ public class 支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
logger
.
info
(
"再次兑换按钮:"
+
btnText2
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"message"
),
"已兑完"
,
"校验用户兑换限制失败"
);
Assert
.
assertEquals
(
btnText2
,
"已兑换"
,
"校验马上兑换按钮状态失败"
);
logger
.
info
(
"校验支付宝用户永久兑换限制成功"
);
logger
.
info
(
"校验支付宝
2元
用户永久兑换限制成功"
);
break
;
case
2
:
logger
.
info
(
"再次兑换按钮:"
+
btnText3
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"message"
),
"已兑完"
,
"校验用户兑换限制失败"
);
Assert
.
assertEquals
(
btnText3
,
"今日已兑换"
,
"校验马上兑换按钮状态失败"
);
logger
.
info
(
"校验支付宝用户每日兑换限制成功"
);
logger
.
info
(
"校验支付宝3元用户每日兑换限制成功"
);
break
;
case
3
:
logger
.
info
(
"再次兑换按钮:"
+
btnText4
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"message"
),
"已兑完"
,
"校验用户兑换限制失败"
);
Assert
.
assertEquals
(
btnText4
,
"已兑换"
,
"校验马上兑换按钮状态失败"
);
logger
.
info
(
"校验支付宝4元用户每月兑换限制成功"
);
break
;
}
...
...
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