Commit db5e5601 authored by 吕雯燕's avatar 吕雯燕

lv

parent 0c57c7de
......@@ -56,6 +56,14 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
new Object[]{3, "193855", "32518","52", "兑吧新优惠券日期兑换限制已结束"}, //case3
};
}
if (method.getName().equals("优惠券马上使用按钮测试")){
result = new Object[][]{
new Object[]{1, "194709", "32594", "92","兑吧新优惠券普通券码跳转"}, //case1
new Object[]{2, "194708", "32595", "91", "兑吧新优惠券跳转链接"}, //case2
new Object[]{3, "194707", "32596","90", "兑吧新优惠券重复券跳转"}, //case3
};
}
return result;
}
......@@ -429,65 +437,62 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
* @param caseNum 用例编号
* @param appItemId 商品入库Id
* @param itemId 商品id
* @param skuId skuId
* @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;
// }
//
// }
@Test(dataProvider = "providerMethod")
public void 优惠券马上使用按钮测试(int caseNum, String appItemId, String itemId, String skuId, String caseName)throws Exception{
logger.info(caseName);
Map cookies = authorization.dafuwengLogin(uid);
//优惠券兑换
Response response = gawService.couponExchange(cookies,appItemId,itemId,skuId);
String orderId = response.jsonPath().getString("data.orderId");
//获取兑换结果
response = tawService.orderStatus(orderId,uid);
response.prettyPrint();
String status = response.jsonPath().getString("data.status");
int i = 10;
//异步接口,直到兑换成功
while (i > 0 && status.equals("processing")) {
Thread.sleep(1000);
response = tawService.orderStatus(orderId,uid);
response.prettyPrint();
status = response.jsonPath().getString("data.status");
i--;
}
//优惠券订单结果页
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");
String credits = detailResponse.jsonPath().getString("data[0].credits");
switch (caseNum){
case 1:
Assert.assertEquals(useButtonText,"去使用","校验结果页按钮文案失败");
Assert.assertEquals(credits,"100","校验结果页积分文案失败");
Assert.assertEquals(iosDownloadUrl,"http://www.iqiyi.com","校验结果页按钮链接失败");
logger.info("校验兑吧新优惠券普通券码跳转成功");
break;
case 2:
Assert.assertEquals(useButtonText,"去使用","校验结果页按钮文案失败");
Assert.assertEquals(iosDownloadUrl,"https://gogokid.jimeng.mobi/magic/runtime/gogokid/?id=4022&channel_id=1663","校验结果页按钮链接失败");
logger.info("校验兑吧新优惠券跳转链接成功");
break;
case 3:
Assert.assertEquals(useButtonText,"去使用","校验结果页按钮文案失败");
Assert.assertEquals(iosDownloadUrl,"https://m.aomygod.com/act-richang-waituibinggan19.9.html?tk=cf40QIFiVx9","校验结果页按钮链接失败");
logger.info("校验兑吧新优惠券重复券跳转链接成功");
break;
}
}
......
......@@ -193,7 +193,7 @@ public class 多档位话费_兑换流程测试_ExchangeTest extends CheckTemple
//会员等级无法兑换
try{
Thread.sleep(3000);
// Thread.sleep(3000);
Response response = couponExchangeService.phonebillExchange(authorization.dafuwengLogin(uid),degreeId);
response.prettyPrint();
......@@ -207,7 +207,7 @@ public class 多档位话费_兑换流程测试_ExchangeTest extends CheckTemple
Response response = couponExchangeService.phonebillExchange(authorization.generateSignAutoLogin("42vkFzeLnoNjXt6AhMM7LPj4G8pT",vipUid),degreeId);
response.prettyPrint();
Assert.assertTrue(message.contains("会员等Qb兑换审核通过测试级不符,请挑选其他吧(15)"),"校验message失败");
Assert.assertTrue(message.contains("会员等级不符,请挑选其他吧(15)"),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
Assert.assertEquals(response.jsonPath().getString("success"),"true","校验兑换结果失败");
logger.info("校验多档位话费会员等级成功");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment