Commit ae63d464 authored by 赵然's avatar 赵然

Merge branch 'zr' into develop

parents 4de4f50e c362ce66
......@@ -95,7 +95,7 @@ public class CustomActivity_DuibaTest extends DuibaTestBase {
String androidDL = MatcherString.getString(ManagerResponse.asString(), "androidurl: '(.*?)',", 1);
String iOSDL = MatcherString.getString(ManagerResponse.asString(), "iosurl: '(.*?)',", 1);
String usebtn = MatcherString.getString(ManagerResponse.asString(), "usebtn: '(.*?)',", 1);
String actLinkEx = "//activity.m.duibatest.com.cn/crecord/recordDetailNew/";
String actLinkEx = "//activity.m.duibatest.com.cn/crecord/recordDetailNew";
String linkUrl = MatcherString.getString(LinkResponse.asString(), "target=\"_blank\" href=\"(.*?)\">", 1);
//进行接口测试传参
......
......@@ -54,7 +54,7 @@ public class 优惠券测试_DuibaTest extends AbstractTestNGSpringContextTests
String androidDL = MatcherString.getString(ManagerResponse.asString(), "androidurl: '(.*?)',", 1);
String iOSDL = MatcherString.getString(ManagerResponse.asString(), "iosurl: '(.*?)',", 1);
String actusebtn = MatcherString.getString(ManagerResponse.asString(), "usebtn: '(.*?)',", 1);
String actLinkEx = "//activity.m.duibatest.com.cn/crecord/recordDetailNew/";
String actLinkEx = "//activity.m.duibatest.com.cn/crecord/recordDetailNew";
String linkUrl = MatcherString.getString(LinkResponse.asString(), "target=\"_blank\" href=\"(.*?)\">", 1);
//获取管理员后台优惠券库存
......
......@@ -32,6 +32,7 @@ public class 谢谢参与测试_DuibaTest extends DuibaTestBase {
Assert.assertEquals(response.jsonPath().getString("lottery.type"), "thanks", "校验类型失败");
Assert.assertEquals(response.jsonPath().getString("lottery.id").isEmpty(), false, "校验id失败");
Assert.assertNotNull(response.jsonPath().getString("lottery.id"),"校验id失败");
//校验返回字段
Assert.assertEquals(response.asString().contains("id"),true,"校验id失败");
logger.info("校验type,id成功");
......
......@@ -30,9 +30,10 @@ public class 种红包配置校验_AccessTest extends DuibaTestBase{
//指定用户
private static int uid = 4689;
private static int uid2 = 4552;
private static int uid3 = 3590;
private static int uid4 = 4386;
@Test
public void 出券开关校验_() throws Exception {
public void 出券衰减开关校验_() throws Exception {
//dafuweng登陆获取cookies
Map cookies = authorization.dafuwengLogin(uid);
//校验种红包配置
......@@ -58,11 +59,12 @@ public class 种红包配置校验_AccessTest extends DuibaTestBase{
logger.info("种红包的红包配置接口校验正确");
}
@Test
public void 出券开关校验_() throws Exception {
public void 出券衰减开关校验_() throws Exception {
//dafuweng登陆获取cookies
Map cookies = authorization.dafuwengLogin(uid2);
//校验种红包配置
......@@ -81,4 +83,53 @@ public class 种红包配置校验_AccessTest extends DuibaTestBase{
logger.info("种红包的红包配置接口校验正确");
}
@Test
public void 流量策略打开校验() throws Exception {
//dafuweng登陆获取cookies
Map cookies = authorization.dafuwengLogin(uid3);
//校验种红包配置
Response response = seedRedPacketService.getExtConfig(cookies);
response.prettyPrint();
String adPositions = response.jsonPath().getString("data.adPositions");
String adSwitch = response.jsonPath().getString("data.adSwitch");
String decrBeginTime = response.jsonPath().getString("data.decrBeginTime");
String decrSwitch = response.jsonPath().getString("data.decrSwitch");
Assert.assertNull(adPositions,"发券位置校验异常");
Assert.assertEquals(adSwitch,"false","种红包开关校验异常");
Assert.assertEquals(decrSwitch,"false","种红包衰减开关校验异常");
Assert.assertNull(decrBeginTime,"衰减时间校验异常");
logger.info("种红包的红包配置接口校验正确");
}
@Test
public void 衰减红包校验() throws Exception {
//dafuweng登陆获取cookies
Map cookies = authorization.dafuwengLogin(uid4);
//调用种植seed
Response response = seedRedPacketService.seed(cookies,"1","424","1");
//种子号
String orderId = response.jsonPath().getString("data.orderNum");
Assert.assertNotNull(orderId,"订单号为空");
logger.info("红包订单为:"+orderId);
//红包衰减
Thread.sleep(65000);
//获取种植结果状态getOrderStatus,异步接口,while循环,status为2处理完成,1处理中
response = seedRedPacketService.getOrderStatus(cookies,orderId);
String status = response.jsonPath().getString("data");
int i =5;
while(i>0&&status.equals("1")){
response = seedRedPacketService.getOrderStatus(cookies,orderId);
status = response.jsonPath().getString("data");
i--;
}
//获取种植获得金额
response = seedRedPacketService.reap(cookies,"1",orderId);
response.prettyPrint();
String isDecr = response.jsonPath().getString("data.isDecr");
Assert.assertEquals(isDecr,"true","红包衰减标识校验失败");
}
}
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