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
f890502b
Commit
f890502b
authored
Jul 04, 2019
by
赵然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zr
parent
45ee2396
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
24 deletions
+43
-24
补签测试_signTest.java
src/test/java/http/cases/SignTest/补签测试_signTest.java
+43
-24
No files found.
src/test/java/http/cases/SignTest/补签测试_signTest.java
View file @
f890502b
...
...
@@ -198,38 +198,57 @@ public class 补签测试_signTest extends DuibaTestBase {
}
//@Test(description = "补签失败场景——积分不足")
// public void 补签_积分不足() throws Exception {
//
// //补签前一天(前2天-2,当天0,后一天+1)
// Response response = signactivityService.reSign(authorization.dafuwengLogin(uid), "80", null, getTime(-1));
// response.prettyPrint();
// //response.prettyPrint();
// String hasConsume = response.jsonPath().getString("data.hasConsume");
// //补签消耗数量
// String reSignConsumeCount = response.jsonPath().getString("data.reSignConsumeCount");
// //补签消耗类型
// String reSignConsumeTypeStr = response.jsonPath().getString("data.reSignConsumeTypeStr");
// Assert.assertEquals(hasConsume, "true", "补签是否消耗");
// Assert.assertEquals(reSignConsumeCount, "999999999", "补签消耗数量不正确");
// Assert.assertEquals(reSignConsumeTypeStr,"积分","补签消耗类型是否为积分");
// //补签logid
// String logId = response.jsonPath().getString("data.logId");
// response = signactivityService.getSignResult(authorization.dafuwengLogin(uid), logId);
// //签到状态
// String status = response.jsonPath().getString("status");
// //接口异步处理
// int i=10;
// while(status.equals("0")&&i>0){
// Thread.sleep(1000);
// response = signactivityService.getSignResult(authorization.dafuwengLogin(uid),logId);
// status = response.jsonPath().getString("status");
// i--;
// }
// String message = response.jsonPath().getString("message");
// //response.prettyPrint();
// //判断结果
// Assert.assertEquals(status,"1","补签失败状态不正确");
// Assert.assertEquals(message,"签到失败,用户积分余额不足","签到失败,用户积分余额不足");
//
// logger.info("补签失败用例成功,原因——积分不足");
//
// }
@Test
(
description
=
"补签失败场景——积分不足"
)
public
void
补签
_
积分不足
()
throws
Exception
{
//补签前一天(前2天-2,当天0,后一天+1)
Response
response
=
signactivityService
.
reSign
(
authorization
.
dafuwengLogin
(
uid
),
"80"
,
null
,
getTime
(-
1
));
response
.
prettyPrint
();
//response.prettyPrint();
String
hasConsume
=
response
.
jsonPath
().
getString
(
"data.hasConsume"
);
//补签消耗数量
String
reSignConsumeCount
=
response
.
jsonPath
().
getString
(
"data.reSignConsumeCount"
);
//补签消耗类型
String
reSignConsumeTypeStr
=
response
.
jsonPath
().
getString
(
"data.reSignConsumeTypeStr"
);
Assert
.
assertEquals
(
hasConsume
,
"true"
,
"补签是否消耗"
);
Assert
.
assertEquals
(
reSignConsumeCount
,
"999999999"
,
"补签消耗数量不正确"
);
Assert
.
assertEquals
(
reSignConsumeTypeStr
,
"积分"
,
"补签消耗类型是否为积分"
);
//补签logid
String
logId
=
response
.
jsonPath
().
getString
(
"data.logId"
);
response
=
signactivityService
.
getSignResult
(
authorization
.
dafuwengLogin
(
uid
),
logId
);
//签到状态
String
status
=
response
.
jsonPath
().
getString
(
"status"
);
//接口异步处理
int
i
=
10
;
while
(
status
.
equals
(
"0"
)&&
i
>
0
){
Thread
.
sleep
(
1000
);
response
=
signactivityService
.
getSignResult
(
authorization
.
dafuwengLogin
(
uid
),
logId
);
status
=
response
.
jsonPath
().
getString
(
"status"
);
i
--;
}
String
message
=
response
.
jsonPath
().
getString
(
"message"
);
//response.prettyPrint();
String
success
=
response
.
jsonPath
().
getString
(
"success"
);
//判断结果
Assert
.
assertEquals
(
status
,
"1"
,
"补签失败状态
不正确"
);
Assert
.
assertEquals
(
message
,
"签到失败,用户积分余额不足"
,
"签到失败,用户积分余额不足
"
);
Assert
.
assertEquals
(
message
,
"您的积分不足"
,
"补签失败提示
不正确"
);
Assert
.
assertEquals
(
success
,
"false"
,
"补签失败状态不正确
"
);
logger
.
info
(
"补签失败用例成功,原因——积分不足"
);
...
...
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