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
06b1bdcd
Commit
06b1bdcd
authored
Feb 20, 2020
by
吕雯燕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv
parent
9ff1e122
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
21 deletions
+13
-21
兑吧老实物_兑换流程测试_ExchangeTest.java
...va/http/cases/ExchangeTest/兑吧老实物_兑换流程测试_ExchangeTest.java
+13
-21
No files found.
src/test/java/http/cases/ExchangeTest/兑吧老实物_兑换流程测试_ExchangeTest.java
View file @
06b1bdcd
...
...
@@ -107,40 +107,32 @@ public class 兑吧老实物_兑换流程测试_ExchangeTest extends CheckTemple
return
result
;
}
//实物兑换积分不足
//实物兑换积分不足
实物兑换积分不足
@Test
(
description
=
"实物兑换积分不足"
)
public
void
积分不足
()
throws
Exception
{
String
message
=
""
;
//活动详情页
Response
response
=
mobileService
.
detail
(
authorization
.
dafuwengLogin
(
3086
),
"28515"
);
Map
<
String
,
String
>
map
=
authorization
.
dafuwengLogin
(
3086
);
Assert
.
assertEquals
(
String
.
valueOf
(
response
.
getStatusCode
()),
"200"
,
"活动详情页请求异常"
);
//实物兑换
response
=
couponExchangeService
.
objectExchange
(
map
,
"167141"
,
"28515"
,
"null"
,
"yrJRr7Cddp2YeQd"
,
"null"
);
response
.
prettyPrint
();
//校验兑换成功
// Assert.assertEquals(response.jsonPath().getString("success"),"true");
//获取orderId
String
orderId
=
response
.
jsonPath
().
getString
(
"orderId"
);
//获取兑换结果
response
=
mobileService
.
orderAmbStatusQuery
(
3086
,
orderId
);
response
.
prettyPrint
();
String
message
=
response
.
jsonPath
().
getString
(
"data.message"
);
int
i
=
10
;
//异步接口,直到兑换成功
while
(
i
>
0
&&
"兑换正在处理中..."
.
equals
(
message
))
{
Thread
.
sleep
(
1000
);
response
=
mobileService
.
orderAmbStatusQuery
(
3086
,
orderId
);
//无法兑换,直接抛出
try
{
response
=
couponExchangeService
.
objectExchange
(
map
,
"167141"
,
"28515"
,
"null"
,
"yrJRr7Cddp2YeQd"
,
"null"
);
response
.
prettyPrint
();
message
=
response
.
jsonPath
().
getString
(
"data.message"
);
i
--;
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
//校验messaga字段返回值
String
message2
=
response
.
jsonPath
().
getString
(
"data.message"
);
Assert
.
assertEquals
(
message2
,
"兑换失败,用户积分余额不足"
,
"message字段校验失败-期望是积分不足"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"message\":\"您的积分不足\""
),
"校验message失败"
);
//这个提示很奇怪
logger
.
info
(
"校验实物兑换积分不足成功"
);
// authorization.dafuwengLogin(2720,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