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
b179cfaa
Commit
b179cfaa
authored
Mar 28, 2019
by
吕雯燕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv
parent
1f8fa83f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
54 deletions
+84
-54
兑吧卡密_兑换流程测试_ExchangeTest.java
...ava/http/cases/ExchangeTest/兑吧卡密_兑换流程测试_ExchangeTest.java
+9
-0
兑吧新优惠券_兑换流程测试_ExchangeTest.java
...a/http/cases/ExchangeTest/兑吧新优惠券_兑换流程测试_ExchangeTest.java
+65
-0
兑吧新实物_兑换流程测试_ExchangeTest.java
...va/http/cases/ExchangeTest/兑吧新实物_兑换流程测试_ExchangeTest.java
+9
-0
兑吧老优惠券_兑换流程测试_ExchangeTest.java
...a/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
+0
-53
多档位话费_兑换流程测试_ExchangeTest.java
...va/http/cases/ExchangeTest/多档位话费_兑换流程测试_ExchangeTest.java
+1
-1
No files found.
src/test/java/http/cases/ExchangeTest/兑吧卡密_兑换流程测试_ExchangeTest.java
View file @
b179cfaa
...
@@ -443,6 +443,15 @@ public class 兑吧卡密_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -443,6 +443,15 @@ public class 兑吧卡密_兑换流程测试_ExchangeTest extends CheckTemplet {
String
status
=
String
.
valueOf
(
mapOrder
.
get
(
"status"
));
String
status
=
String
.
valueOf
(
mapOrder
.
get
(
"status"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
int
i
=
10
;
while
(
i
>
0
&&
!
flowWork
.
equals
(
"Create-tofail"
))
{
Thread
.
sleep
(
1000
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders11
+
" WHERE id = "
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
i
--;
}
Assert
.
assertEquals
(
status
,
"create"
,
"校验订单status失败"
);
Assert
.
assertEquals
(
status
,
"create"
,
"校验订单status失败"
);
Assert
.
assertEquals
(
flowWork
,
"Create-tofail"
,
"校验订单节点flowwork失败"
);
Assert
.
assertEquals
(
flowWork
,
"Create-tofail"
,
"校验订单节点flowwork失败"
);
logger
.
info
(
"校验兑吧卡密SKU库存不足成功"
);
logger
.
info
(
"校验兑吧卡密SKU库存不足成功"
);
...
...
src/test/java/http/cases/ExchangeTest/兑吧新优惠券_兑换流程测试_ExchangeTest.java
View file @
b179cfaa
...
@@ -425,6 +425,71 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -425,6 +425,71 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
}
}
/**
* @param caseNum 用例编号
* @param appItemId 商品入库Id
* @param itemId 商品id
* @param caseName 用例名称打印
* @throws Exception
*/
// @Test(dataProvider = "providerMethod")
// public void 优惠券马上使用按钮测试(int caseNum, String appItemId, String itemId, String caseName)throws Exception{
//
// logger.info(caseName);
//
// //优惠券兑换
// String orderId = this.优惠券兑换订单(appItemId,itemId,uid);
//
// //优惠券兑换结果页
// Response resultResponse = crecordService.recordDetail(orderId,uid);
// //resultResponse.prettyPrint();
// String btnText = MatcherString.getString(resultResponse.asString(),"\"btnText\":\"(.*?)\",",1);
// String actualPay = MatcherString.getString(resultResponse.asString(),"\"actualPay\":\"(.*?)\",",1);
// String androidDownload = MatcherString.getString(resultResponse.asString(),"\"androidDownload\":\"(.*?)\",",1);
// String androidDownloadUrl = MatcherString.getString(resultResponse.asString(),"\"androidDownloadUrl\":\"(.*?)\",",1);
//
//
// //优惠券兑换记录页
// Thread.sleep(3000);
// Response detailResponse = tawService.detailItems(orderId,uid);
// detailResponse.prettyPrint();
// String useButtonText = detailResponse.jsonPath().getString("data[0].useButtonText");
// String iosDownloadUrl = detailResponse.jsonPath().getString("data[0].iosDownloadUrl");
//
// switch (caseNum){
//
// case 1:
// Assert.assertEquals(btnText,"马上使用","校验结果页按钮文案失败");
// Assert.assertEquals(actualPay,"10积分","校验结果页积分文案失败");
// Assert.assertEquals(androidDownload,"https://m2.mobike.com/active/fission_packet_joint/index.html","校验结果页按钮链接失败");
//
// Assert.assertEquals(useButtonText,"去使用","校验兑换记录页按钮文案失败");
// Assert.assertEquals(iosDownloadUrl,"https://m2.mobike.com/active/fission_packet_joint/index.html","校验兑换记录页按钮跳转链接失败");
// logger.info("校验优惠券商家落地页下载链接页面成功");
// break;
// case 2:
// Assert.assertEquals(btnText,"马上领取","校验结果页按钮文案失败");
// Assert.assertEquals(actualPay,"20积分","校验结果页积分文案失败");
// Assert.assertEquals(androidDownload,"https://u.163.com/aoshzxiaoshouxiaoshou4","校验结果页按钮链接失败");
//
// Assert.assertEquals(useButtonText,"去使用","校验兑换记录页按钮文案失败");
// Assert.assertEquals(iosDownloadUrl,"https://u.163.com/aoshzxiaoshouxiaoshou4","校验兑换记录页按钮跳转链接失败");
// logger.info("校验优惠券兑换记录页下载链接页面成功");
// break;
// case 3:
// Assert.assertEquals(btnText,"马上下载","校验结果页按钮文案失败");
// Assert.assertEquals(actualPay,"30积分","校验结果页积分文案失败");
// Assert.assertEquals(androidDownloadUrl,"//activity.m.duibatest.com.cn/log/redirect?url=https%3A%2F%2Fm.wkzuche.com%2Fh5%2F%23%2Factivity%2Fshare%3Fchannel%3Ddb%402018&dpm=2239.25.1.0&dcm=101.29710.172294.0","校验结果页按钮链接失败");
//
// Assert.assertEquals(useButtonText,"去使用","校验兑换记录页按钮文案失败");
// Assert.assertEquals(iosDownloadUrl,"https://m.wkzuche.com/h5/#/activity/share?channel=db@2018","校验兑换记录页按钮跳转链接失败");
// logger.info("校验优惠券链接券页面成功");
// break;
// }
//
// }
}
}
src/test/java/http/cases/ExchangeTest/兑吧新实物_兑换流程测试_ExchangeTest.java
View file @
b179cfaa
...
@@ -430,6 +430,15 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
...
@@ -430,6 +430,15 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
String
status
=
String
.
valueOf
(
mapOrder
.
get
(
"status"
));
String
status
=
String
.
valueOf
(
mapOrder
.
get
(
"status"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
int
i
=
10
;
while
(
i
>
0
&&
!
flowWork
.
equals
(
"Create-tofail"
))
{
Thread
.
sleep
(
1000
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders10
+
" WHERE id = "
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
i
--;
}
Assert
.
assertEquals
(
status
,
"create"
,
"校验订单status失败"
);
Assert
.
assertEquals
(
status
,
"create"
,
"校验订单status失败"
);
Assert
.
assertEquals
(
flowWork
,
"Create-tofail"
,
"校验订单节点flowwork失败"
);
Assert
.
assertEquals
(
flowWork
,
"Create-tofail"
,
"校验订单节点flowwork失败"
);
logger
.
info
(
"校验兑吧新实物SKU库存不足成功"
);
logger
.
info
(
"校验兑吧新实物SKU库存不足成功"
);
...
...
src/test/java/http/cases/ExchangeTest/兑吧老优惠券_兑换流程测试_ExchangeTest.java
View file @
b179cfaa
...
@@ -696,59 +696,6 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -696,59 +696,6 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
}
}
/**
* @param caseNum 用例编号
* @param appItemId 商品入库Id
* @param token token
* @param caseName 用例名称打印
* @throws Exception
*/
//@Test(dataProvider = "providerMethod")
public
void
自有优惠券会员等级测试
(
int
caseNum
,
String
appItemId
,
String
token
,
String
caseName
)
throws
Exception
{
logger
.
info
(
caseName
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appItemId"
,
appItemId
);
map
.
put
(
"token"
,
token
);
//会员等级不符,详情页按钮“如何获得兑换资格”
Response
detailResponse
=
mobileService
.
appItemDetail
(
appItemId
,
uid
);
detailResponse
.
prettyPrint
();
//会员等级不符,兑换
Response
failResponse
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
post
(
url
+
"/couponExchange/exchange"
);
failResponse
.
prettyPrint
();
//会员等级符合条件,兑换,vip=5
Response
response
=
couponExchangeService
.
couponExchange
(
authorization
.
generateSignAutoLogin
(
"2wGQc3MZaQsqYFWcX4gguya5PnnS"
,
3402
),
appItemId
,
""
);
response
.
prettyPrint
();
switch
(
caseNum
){
case
1
:
Assert
.
assertEquals
(
detailResponse
.
asString
().
contains
(
"如何获得兑换资格"
),
true
);
Assert
.
assertEquals
(
failResponse
.
jsonPath
().
getString
(
"success"
),
"false"
,
"校验兑换结果失败"
);
Assert
.
assertEquals
(
failResponse
.
jsonPath
().
getString
(
"message"
),
"会员等级不符,请挑选其他吧(15)"
,
"校验兑换结果消息失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"校验兑换结果失败"
);
logger
.
info
(
"校验优惠券会员等级范围成功"
);
break
;
case
2
:
Assert
.
assertEquals
(
detailResponse
.
asString
().
contains
(
"如何获得兑换资格"
),
true
);
Assert
.
assertEquals
(
failResponse
.
jsonPath
().
getString
(
"success"
),
"false"
,
"校验兑换结果失败"
);
Assert
.
assertEquals
(
failResponse
.
jsonPath
().
getString
(
"message"
),
"会员等级不符,请挑选其他吧(15)"
,
"校验兑换结果消息失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"校验兑换结果失败"
);
logger
.
info
(
"校验优惠券会员特定等级成功"
);
break
;
}
}
@Test
(
description
=
"兑吧优惠券会员等级测试"
)
@Test
(
description
=
"兑吧优惠券会员等级测试"
)
public
void
会员等级测试
()
throws
Exception
{
public
void
会员等级测试
()
throws
Exception
{
...
...
src/test/java/http/cases/ExchangeTest/多档位话费_兑换流程测试_ExchangeTest.java
View file @
b179cfaa
...
@@ -146,7 +146,7 @@ public class 多档位话费_兑换流程测试_ExchangeTest extends CheckTemple
...
@@ -146,7 +146,7 @@ public class 多档位话费_兑换流程测试_ExchangeTest extends CheckTemple
message
=
e
.
toString
();
message
=
e
.
toString
();
}
}
logger
.
info
(
message
);
logger
.
info
(
"message: "
+
message
);
//获取按钮状态
//获取按钮状态
Response
detailResponse
=
mobileService
.
detail
(
authorization
.
dafuwengLogin
(
uid
),
"1"
);
Response
detailResponse
=
mobileService
.
detail
(
authorization
.
dafuwengLogin
(
uid
),
"1"
);
...
...
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