Commit e4063a33 authored by wangxiaoshuang's avatar wangxiaoshuang

wxs

parent 25b03f92
......@@ -454,15 +454,15 @@ public class 自有新优惠券_兑换限制测试_ExchangeTest extends CheckTem
String appItemId = "196919";
try{
// Thread.sleep(4000);
Thread.sleep(4000);
//第一次兑换
Response response = gawService.couponExchange(uid, appItemId,157);
response.prettyPrint();
// String orderId = response.jsonPath().getString("data.orderId");
String orderId = response.jsonPath().getString("data.orderId");
//获取兑换结果
// response = mobileService.orderStatusQuery(uid,orderId);
// response.prettyPrint();
/* String message = response.jsonPath().getString("message");
response = mobileService.orderStatusQuery(uid,orderId);
response.prettyPrint();
String message = response.jsonPath().getString("message");
int i = 10;
//异步接口,直到兑换成功
while (i > 0 && "兑换正在处理中...".equals(message)) {
......@@ -473,27 +473,28 @@ public class 自有新优惠券_兑换限制测试_ExchangeTest extends CheckTem
i--;
}
Thread.sleep(4000);
Response detailResponse = mobileService.appItemDetail(authorization.dafuwengLogin(uid),appItemId);
detailResponse.prettyPrint();
// detailResponse.prettyPrint();
String exchangeText = MatcherString.getString(detailResponse.asString(), "\"exchangeText\":\"(.*?)\",", 1);
logger.info("商品兑换按钮:" + exchangeText);
//第二次兑换
Thread.sleep(4000);
try{
response = gawService.couponExchange(uid, appItemId,157);
response.prettyPrint();
// response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
// logger.info(message);
Assert.assertTrue(message.contains("已达兑换批次上限"),"校验message失败");
Assert.assertTrue(message.contains("该批次已达兑换上限"),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
Assert.assertEquals(exchangeText,"已达兑换批次上限","校验兑换按钮失败");
logger.info("校验实物用户周期限制消费成功");*/
Assert.assertEquals(exchangeText,"该批次已达兑换上限","校验兑换按钮失败");
logger.info("校验实物用户周期限制消费成功");
}catch (Exception e){
......
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