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
b0c10f5e
Commit
b0c10f5e
authored
Jul 04, 2019
by
马博
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
89f93dd8
8ed470f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
28 deletions
+47
-28
兑吧新优惠券_兑换流程测试_ExchangeTest.java
...a/http/cases/ExchangeTest/兑吧新优惠券_兑换流程测试_ExchangeTest.java
+2
-2
兑吧老优惠券_兑换流程测试_ExchangeTest.java
...a/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
+2
-2
补签测试_signTest.java
src/test/java/http/cases/SignTest/补签测试_signTest.java
+43
-24
No files found.
src/test/java/http/cases/ExchangeTest/兑吧新优惠券_兑换流程测试_ExchangeTest.java
View file @
b0c10f5e
...
...
@@ -237,11 +237,11 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"
已达兑换次数
上限"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"
该批次已达兑换
上限"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验success失败"
);
//按钮文案不变
Assert
.
assertEquals
(
exchangeText
,
"
马上兑换
"
,
"校验兑换按钮失败"
);
Assert
.
assertEquals
(
exchangeText
,
"
该批次已达兑换上限
"
,
"校验兑换按钮失败"
);
logger
.
info
(
"校验优惠券每人限购批次限制成功"
);
}
catch
(
Exception
e
){
...
...
src/test/java/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
View file @
b0c10f5e
...
...
@@ -477,8 +477,8 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
String
exchangeText
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"exchangeText\":\"(.*?)\","
,
1
);
logger
.
info
(
"兑换按钮:"
+
exchangeText
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"message"
),
"
已达兑换次数
上限"
,
"校验用户兑换限制失败"
);
Assert
.
assertEquals
(
exchangeText
,
"
已达兑换次数
上限"
,
"校验马上兑换按钮状态失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"message"
),
"
该批次已达兑换
上限"
,
"校验用户兑换限制失败"
);
Assert
.
assertEquals
(
exchangeText
,
"
该批次已达兑换
上限"
,
"校验马上兑换按钮状态失败"
);
logger
.
info
(
"校验优惠券用户批次兑换限制成功"
);
}
catch
(
Exception
e
){
...
...
src/test/java/http/cases/SignTest/补签测试_signTest.java
View file @
b0c10f5e
...
...
@@ -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