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
41da1017
Commit
41da1017
authored
Feb 26, 2020
by
吕雯燕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv
parent
4cd080ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
新Qb_兑换流程测试_ExchangeTest.java
...ases/ExchangeTest/兑吧_直充类商品兑换/新Qb_兑换流程测试_ExchangeTest.java
+9
-10
gawService.java
src/test/java/http/service/app/gawService.java
+1
-1
No files found.
src/test/java/http/cases/ExchangeTest/兑吧_直充类商品兑换/新Qb_兑换流程测试_ExchangeTest.java
View file @
41da1017
...
...
@@ -46,7 +46,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
String
message
=
""
;
try
{
//
支付宝
兑换
//
Q币
兑换
Response
response
=
this
.
Q
币兑换
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
qq
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.payCreditsStatus"
),
"1"
,
"校验兑换失败"
);
logger
.
info
(
"用户成功兑换一次"
);
...
...
@@ -67,7 +67,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
String
btnText
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"1\":\\{\"btnText\":\"(.*?)\","
,
1
);
logger
.
info
(
"再次兑换按钮:"
+
btnText
);
Assert
.
assertTrue
(
message
.
contains
(
"
\"desc\":\"抱歉,该QQ号已达到充值上限,请换一个QQ号吧。\"
"
),
"校验用户兑换限制失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"
抱歉,该QQ号已达到充值上限,请换一个QQ号吧。
"
),
"校验用户兑换限制失败"
);
Assert
.
assertEquals
(
btnText
,
"已兑换"
,
"校验马上兑换按钮状态失败"
);
logger
.
info
(
"校验1个Q币用户永久兑换限制成功"
);
...
...
@@ -118,7 +118,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
String
btnText
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"2\":\\{\"btnText\":\"(.*?)\","
,
1
);
logger
.
info
(
"再次兑换按钮:"
+
btnText
);
Assert
.
assertTrue
(
message
.
contains
(
"
\"desc\":\"已兑完\"
"
),
"校验用户兑换限制失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"
已兑完
"
),
"校验用户兑换限制失败"
);
Assert
.
assertEquals
(
btnText
,
"今日已兑换"
,
"校验马上兑换按钮状态失败"
);
logger
.
info
(
"校验2个Q币用户每天兑换限制成功"
);
...
...
@@ -147,7 +147,6 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
@Test
(
description
=
"3个Q币用户兑换限制每月1次"
)
public
void
Q
币用户每月兑换限制测试
()
throws
Exception
{
...
...
@@ -181,7 +180,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
String
btnText
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"3\":\\{\"btnText\":\"(.*?)\","
,
1
);
logger
.
info
(
"再次兑换按钮:"
+
btnText
);
Assert
.
assertTrue
(
message
.
contains
(
"
\"desc\":\"已兑完\"
"
),
"校验用户兑换限制失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"
已兑完
"
),
"校验用户兑换限制失败"
);
Assert
.
assertEquals
(
btnText
,
"已兑换"
,
"校验马上兑换按钮状态失败"
);
logger
.
info
(
"校验3个Q币用户每月兑换限制成功"
);
...
...
@@ -238,7 +237,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"
\"desc\":\"未达到会员等级要求\"
"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"
未达到会员等级要求
"
),
"校验message失败"
);
logger
.
info
(
"校验Q币会员等级兑换成功"
);
}
...
...
@@ -265,8 +264,8 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"
\"success\":
false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"
\"desc\":\"档位不存在\"
"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"
档位不存在
"
),
"校验message失败"
);
logger
.
info
(
"校验Q币档位篡改无法兑换成功"
);
}
...
...
@@ -316,8 +315,8 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"
\"success\":
false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"
\"desc\":\"兑吧加钱购商品不可以加入到开发者商品中\"
"
),
"校验message失败"
);
//这个提示很奇怪
Assert
.
assertTrue
(
message
.
contains
(
"false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"
兑吧加钱购商品不可以加入到开发者商品中
"
),
"校验message失败"
);
//这个提示很奇怪
logger
.
info
(
"校验Q币用户id2篡改无法兑换成功"
);
...
...
src/test/java/http/service/app/gawService.java
View file @
41da1017
...
...
@@ -602,7 +602,7 @@ public class gawService {
logger
.
info
(
"请求Qb兑换接口:"
+
"/gaw/qbExchange/create"
);
Response
response
=
given
().
contentType
(
"application/json; charset=UTF-8"
).
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
body
(
jsonParam
).
post
(
"http://"
+
goodsHost
+
"/gaw/qbExchange/create"
);
response
.
prettyPrint
();
//
response.prettyPrint();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
...
...
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