Commit 8ee2ea5e authored by 吕雯燕's avatar 吕雯燕

Merge branch 'duiba_wenyan'

parents 060492a5 614497eb
......@@ -9,17 +9,15 @@ import http.service.app.tawService;
import http.service.hd.DeveloperAccountService;
import http.service.hd.DappConfigService;
import org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.*;
import utils.MatcherString;
import base.DuibaLog;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.lang.reflect.Method;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import utils.RedisUtil;
......@@ -68,6 +66,32 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
}
@BeforeMethod
public void before(){
try {
//更新数据表 每人限购批次限制测试
jdbc.update("DELETE FROM credits_dev.consumer_limit_record WHERE item_id = 32514");
jdbc.update("DELETE FROM credits_dev.consumer_limit_record_only WHERE item_id = 32514");
//更新数据表,每人限购永久限制测试
jdbc.update("DELETE FROM credits_dev.consumer_limit_record WHERE item_id = 32513");
jdbc.update("DELETE FROM credits_dev.consumer_limit_record_only WHERE item_id = 32513");
//更新数据表,每人限购每日限制测试
jdbc.update("DELETE FROM credits_dev.consumer_limit_record WHERE item_id = 32512");
//更新数据表,每日限量测试
jdbc.update("DELETE FROM goods.tb_everyday_limit WHERE item_id = 32515");
} catch (SQLException e) {
e.printStackTrace();
}
}
@Test(description = "兑吧新优惠券每人限购每日")
public void 每人限购每日限制测试() throws Exception {
......@@ -77,7 +101,6 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
Map cookies = authorization.dafuwengLogin(uid);
String message = "";
try{
//第一次兑换
Response response = gawService.couponExchange(cookies,appItemId,itemId,skuId);
String orderId = response.jsonPath().getString("data.orderId");
......@@ -118,15 +141,6 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
Assert.assertEquals(exchangeText,"今日已达兑换上限","校验兑换按钮失败");
logger.info("校验优惠券每人限购每日限制成功");
}catch (Exception e){
throw new Exception("异常信息打印:" + e);
}finally {
jdbc.update("DELETE FROM credits_dev.consumer_limit_record WHERE item_id = '"+itemId+"'");
}
}
......@@ -140,7 +154,6 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
Map cookies = authorization.dafuwengLogin(uid);
String message = "";
try{
//第一次兑换
Response response = gawService.couponExchange(cookies,appItemId,itemId,skuId);
String orderId = response.jsonPath().getString("data.orderId");
......@@ -180,16 +193,6 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
Assert.assertEquals(exchangeText,"已达兑换次数上限","校验兑换按钮失败");
logger.info("校验优惠券每人限购永久限制成功");
}catch (Exception e){
throw new Exception("异常信息打印:" + e);
}finally {
jdbc.update("DELETE FROM credits_dev.consumer_limit_record WHERE item_id = '"+itemId+"'");
jdbc.update("DELETE FROM credits_dev.consumer_limit_record_only WHERE item_id = '"+itemId+"'");
}
}
......@@ -203,7 +206,6 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
Map cookies = authorization.dafuwengLogin(uid);
String message = "";
try{
//第一次兑换
Response response = gawService.couponExchange(cookies,appItemId,itemId,skuId);
String orderId = response.jsonPath().getString("data.orderId");
......@@ -244,16 +246,6 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
Assert.assertEquals(exchangeText,"该批次已达兑换上限","校验兑换按钮失败");
logger.info("校验优惠券每人限购批次限制成功");
}catch (Exception e){
throw new Exception("异常信息打印:" + e);
}finally {
jdbc.update("DELETE FROM credits_dev.consumer_limit_record WHERE item_id = '"+itemId+"'");
jdbc.update("DELETE FROM credits_dev.consumer_limit_record_only WHERE item_id = '"+itemId+"'");
}
}
......@@ -267,7 +259,6 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
Map cookies = authorization.dafuwengLogin(uid);
String message = "";
try{
//第一次兑换
Response response = gawService.couponExchange(cookies,appItemId,itemId,skuId);
String orderId = response.jsonPath().getString("data.orderId");
......@@ -307,16 +298,6 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
Assert.assertEquals(exchangeText,"每日限量已兑完","校验兑换按钮失败");
logger.info("校验优惠券每日限量成功");
}catch (Exception e){
throw new Exception("异常信息打印:" + e);
}finally {
jdbc.update("DELETE FROM goods.tb_everyday_limit WHERE item_id = '"+itemId+"'");
}
}
......
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