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
a1da9b1f
Commit
a1da9b1f
authored
Jun 03, 2020
by
吕雯燕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv
parent
b19ba492
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
兑吧老优惠券_兑换流程测试_ExchangeTest.java
...a/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
+5
-3
No files found.
src/test/java/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
View file @
a1da9b1f
...
@@ -740,9 +740,10 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -740,9 +740,10 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
* @param caseName 用例名称打印
* @param caseName 用例名称打印
* @throws Exception
* @throws Exception
*/
*/
//
@Test(dataProvider = "providerMethod")
//
@Test(dataProvider = "providerMethod")
public
void
优惠券地区兑换限制测试
(
int
caseNum
,
String
appItemId
,
String
itemId
,
String
token
,
String
caseName
)
throws
Exception
{
public
void
优惠券地区兑换限制测试
(
int
caseNum
,
String
appItemId
,
String
itemId
,
String
token
,
String
caseName
)
throws
Exception
{
//测试环境地域判断问题,暂不可运行
logger
.
info
(
caseName
);
logger
.
info
(
caseName
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
...
@@ -752,8 +753,9 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -752,8 +753,9 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
//商品详情页兑换按钮
//商品详情页兑换按钮
Response
detailResponse
=
mobileService
.
detail
(
authorization
.
dafuwengLogin
(
uid
),
itemId
);
Response
detailResponse
=
mobileService
.
detail
(
authorization
.
dafuwengLogin
(
uid
),
itemId
);
detailResponse
.
prettyPrint
();
//
detailResponse.prettyPrint();
String
exchangeText
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"exchangeText\":\"(.*?)\""
,
1
);
String
exchangeText
=
MatcherString
.
getString
(
detailResponse
.
asString
(),
"\"exchangeText\":\"(.*?)\""
,
1
);
logger
.
info
(
"兑换按钮:"
+
exchangeText
);
//优惠券兑换
//优惠券兑换
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
post
(
url
+
"/couponExchange/exchange"
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
post
(
url
+
"/couponExchange/exchange"
);
...
@@ -763,7 +765,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -763,7 +765,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
switch
(
caseNum
){
switch
(
caseNum
){
case
1
:
case
1
:
Assert
.
assertEquals
(
exchangeText
,
"
所处区域不可
兑换"
,
"校验兑换按钮失败"
);
Assert
.
assertEquals
(
exchangeText
,
"
该区域不支持
兑换"
,
"校验兑换按钮失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"message"
),
"不在可兑换区域哦,请挑选其他吧(30)"
,
"校验兑换结果失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"message"
),
"不在可兑换区域哦,请挑选其他吧(30)"
,
"校验兑换结果失败"
);
logger
.
info
(
"校验优惠券地区黑名单不可兑换成功"
);
logger
.
info
(
"校验优惠券地区黑名单不可兑换成功"
);
break
;
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