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

lv

parent b19ba492
......@@ -740,9 +740,10 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
* @param caseName 用例名称打印
* @throws Exception
*/
//@Test(dataProvider = "providerMethod")
// @Test(dataProvider = "providerMethod")
public void 优惠券地区兑换限制测试(int caseNum, String appItemId, String itemId, String token,String caseName) throws Exception{
//测试环境地域判断问题,暂不可运行
logger.info(caseName);
Map<String,String> map = new HashMap<>();
......@@ -752,8 +753,9 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
//商品详情页兑换按钮
Response detailResponse = mobileService.detail(authorization.dafuwengLogin(uid),itemId);
detailResponse.prettyPrint();
// detailResponse.prettyPrint();
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");
......@@ -763,7 +765,7 @@ public class 兑吧老优惠券_兑换流程测试_ExchangeTest extends CheckTem
switch (caseNum){
case 1:
Assert.assertEquals(exchangeText,"所处区域不可兑换","校验兑换按钮失败");
Assert.assertEquals(exchangeText,"该区域不支持兑换","校验兑换按钮失败");
Assert.assertEquals(response.jsonPath().getString("message"),"不在可兑换区域哦,请挑选其他吧(30)","校验兑换结果失败");
logger.info("校验优惠券地区黑名单不可兑换成功");
break;
......
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