Commit 4cb0424b authored by 马博's avatar 马博

Merge branch 'develop' into mabo

parents 00a83fc8 dbc1286e
......@@ -58,8 +58,14 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
};
}else
if(method.getName().equals("新建自有手动开奖活动")){
result = new Object[][]{
new Object[]{1,"10","everyday","5","everyday","//yun.duiba.com.cn/upload/mhty76ri9b.png","新建自有手动开奖--每日次数"},
};
}
}
return result;
}
......@@ -223,6 +229,52 @@ public class 新建活动测试_DuibaTest extends DuibaTestBase{
}
/**
* @param caseNum 用例编号
* @param consumerDrawLimit 用户抽奖限制次数
* @param consumerDrawLimitScope 用户抽奖限制类型
* @param freeLimit 免费抽奖次数
* @param freeLimitScope 免费抽奖次数类型
* @param bannerImgNew 新版banner图
* @param caseName 用例名称
* @throws Exception
*/
@Test(dataProvider = "providerMethod")
public void 新建自有手动开奖活动(int caseNum,String consumerDrawLimit,String consumerDrawLimitScope,String freeLimit,String freeLimitScope,String bannerImgNew,String caseName) throws Exception{
logger.info("-----------------------------"+caseName+"-----------------------------");
String data = PublicMethod.data();
String title = "【自动化】自有手动开奖"+data;
//新建自有手动开奖
developerService.saveManualLottery(title,consumerDrawLimit,consumerDrawLimitScope,freeLimit,freeLimitScope,bannerImgNew);
//获取活动id
Response listResponse = developerService.list2(title);
String id = String.valueOf(listResponse.jsonPath().getString("data.list[0].activityId"));
//编辑活动,校验活动内容
Response editResponse = developerService.editManualLottery(id);
switch (caseNum){
case 1:
Assert.assertEquals(editResponse.jsonPath().getString("data.credits"),"50","校验活动积分失败");
Assert.assertEquals(editResponse.jsonPath().getString("data.freeLimit"),"5","校验活动免费抽奖次数失败");
Assert.assertEquals(editResponse.jsonPath().getString("data.freeLimitScope"),"everyday","校验活动免费抽奖次数类型失败");
Assert.assertEquals(editResponse.jsonPath().getString("data.consumerDrawLimit"),"10","校验用户抽奖限制次数失败");
Assert.assertEquals(editResponse.jsonPath().getString("data.consumerDrawLimitScope"),"everyday","校验用户抽奖限制类型失败");
Assert.assertEquals(editResponse.jsonPath().getString("data.bannerImgNew"),"//yun.duiba.com.cn/upload/mhty76ri9b.png","校验活动新版banner图失败");
logger.info("校验新建自有手动开奖-1内容成功");
break;
case 2:
break;
}
//删除测试数据
this.删除自有活动(title);
}
//删除自有活动
......
......@@ -243,7 +243,8 @@ public class ContractSign_signTest extends DuibaTestBase {
success = signRes.jsonPath().getString("success");
Assert.assertEquals(success, "true", "uid4打卡失败");
logger.info("uid4七日打卡成功");
homeInfoRes = ContractSignService.getHomeInfo(actId,uid3);
homeInfoRes = ContractSignService.getHomeInfo(actId,uid4);
homeInfoRes.prettyPrint();
status = homeInfoRes.jsonPath().getString("data.status");
Assert.assertEquals(status,"6","完成7日打卡状态不正确");
String hasReward = homeInfoRes.jsonPath().getString("data.hasReward");
......
......@@ -61,13 +61,15 @@ public class 周期签到测试_signTest extends DuibaTestBase {
// }
@Test(description = "活动id:79,规则:周期2天,签到第3天循环第一天奖励,加一次抽奖机会,加10积分")
//@Test(description = "活动id:79,规则:周期2天,签到第3天循环第一天奖励,加一次抽奖机会,加10积分")
public void 周期签到测试() throws Exception {
logger.info("Current Thread Id: " + Thread.currentThread().getId());
//补签前天,凑足连续签到2天
Response response_1 = this.resign("79",-2);
Thread.sleep(1000);
Response response_2 = this.resign("79",-1);
// response_2.prettyPrint();
response_1.prettyPrint();
response_2.prettyPrint();
//当日签到之前插件信息查询
Response response_plug = activityPlugDrawInfoService.getPrizeInfo(map,"1179");
......@@ -97,6 +99,7 @@ public class 周期签到测试_signTest extends DuibaTestBase {
String lastDays = response.jsonPath().getString("signInfoVO.lastDays");//连续签到天数
String todaySigned = response.jsonPath().getString("signInfoVO.todaySigned"); //今日是否签到
response.prettyPrint();
Assert.assertEquals(acmDay,"2","历史累积签到次数不正确");
Assert.assertEquals(acmDays,"2","周期内累计签到天数不正确");
Assert.assertEquals(activityCount,"1","今日奖励抽奖次数不正确");
......
......@@ -142,6 +142,7 @@ public class SignService {
map.put("cirReward","{\"rwType\":\"CIRCLE\",\"plActSkinId\":100,\"plActId\":null,\"items\":[{\"days\":null,\"credits\":1,\"activityCount\":1}],\"plSkinOpen2Dev\":true,\"open\":true}");
map.put("acmReward","{\"rwType\":\"ACCUMULATE\",\"plActSkinId\":100,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":1,\"activityCount\":1}],\"plSkinOpen2Dev\":true,\"open\":true}");
map.put("firstSignReward","{\"rwType\":\"FIRST_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}");
map.put("cntOnceReward", "{\"rwType\":null,\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":null,\"open\":false}");
map.put("fullSignReward","{\"rwType\":\"FULL_SIGN\",\"plActSkinId\":100,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":100,\"activityCount\":100}],\"plSkinOpen2Dev\":true,\"open\":true}");
map.put("firstSignReward","[]");
......
......@@ -915,7 +915,7 @@ public class DeveloperService {
}
//创建自有活动工具-所有字段
//保存自有活动工具-所有字段
public Response saveHdAll(String id,String creditsType,String title,String limitCount,String limitScope,String freeLimit,String freeScope,String awards,String bannerImgNew) throws Exception {
String url=hdHost+"/launch/save";
......@@ -976,7 +976,7 @@ public class DeveloperService {
return response;
}
//创建保存自有单品抽奖
//保存自有单品抽奖--所有字段
public Response saveDpAll(String id,String title,String mainAppItemId,String appItemTitle,String appItemType, String mainAppItemRemaining,String freeDrawLimit,String freeDrawLimitScope,String bannerImgNew,String vipLimitType,String vipLimits,String exchangeLimit) throws Exception {
String url=hdHost+"/appSingleLottery/saveOrUpdate";
......@@ -1053,5 +1053,61 @@ public class DeveloperService {
return response;
}
//保存自有手动开奖--所有字段
public Response saveManualLottery(String title,String consumerDrawLimit,String consumerDrawLimitScope,String freeLimit,String freeLimitScope,String bannerImgNew) throws Exception {
String url=hdHost+"/appManualLottery/create";
Map<String,String> map = new HashMap<>();
map.put("title",title);
map.put("credits","50");
map.put("bannerImage","//yun.duiba.com.cn/upload/buctmou88a.png");
map.put("smallImage","//yun.duiba.com.cn/upload/wf0u6dtq7e.png");
map.put("image","//yun.duiba.com.cn/upload/nwmcomavqu.png");
map.put("bannerImgNew",bannerImgNew);
map.put("appId","2239");
map.put("marketPrice","10");
map.put("introduction","测试奖品说明");
map.put("consumerDrawLimit",consumerDrawLimit);
map.put("consumerDrawLimitScope",consumerDrawLimitScope);
map.put("freeLimit",freeLimit);
map.put("freeLimitScope",freeLimitScope);
map.put("overDate","2020-11-01");
logger.info("请求创建自有手动开奖url:"+url);
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLogin()).params(map).post("http://"+url);
response.prettyPrint();
try{
Assert.assertEquals(response.jsonPath().getString("desc"),"成功");
}catch(Exception e){
throw new Exception("创建自有手动开奖接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("创建自有手动开奖接口失败,返回信息:"+response.asString());
}
return response;
}
//编辑自有手动开奖
public Response editManualLottery(String manualLotteryId) throws Exception {
String url=hdHost+"/appManualLottery/edit";
Map<String,String> map = new HashMap<>();
map.put("appId","2239");
map.put("manualLotteryId",manualLotteryId);
logger.info("请求编辑自有手动开奖url:"+url);
Response response=given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLogin()).params(map).get("http://"+url);
response.prettyPrint();
try{
Assert.assertEquals(response.jsonPath().getString("desc"),"成功");
}catch(Exception e){
throw new Exception("编辑自有手动开奖接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("编辑自有手动开奖接口失败,返回信息:"+response.asString());
}
return response;
}
}
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