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

lv

parent 1f8fa83f
......@@ -443,6 +443,15 @@ public class 兑吧卡密_兑换流程测试_ExchangeTest extends CheckTemplet {
String status = String.valueOf(mapOrder.get("status"));
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(flowWork,"Create-tofail","校验订单节点flowwork失败");
logger.info("校验兑吧卡密SKU库存不足成功");
......
......@@ -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;
// }
//
// }
}
......@@ -430,6 +430,15 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
String status = String.valueOf(mapOrder.get("status"));
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(flowWork,"Create-tofail","校验订单节点flowwork失败");
logger.info("校验兑吧新实物SKU库存不足成功");
......
......@@ -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 = "兑吧优惠券会员等级测试")
public void 会员等级测试()throws Exception{
......
......@@ -146,7 +146,7 @@ public class 多档位话费_兑换流程测试_ExchangeTest extends CheckTemple
message = e.toString();
}
logger.info(message);
logger.info("message: " + message);
//获取按钮状态
Response detailResponse = mobileService.detail(authorization.dafuwengLogin(uid),"1");
......
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