Commit 595108b4 authored by 吕雯燕's avatar 吕雯燕

lv

parent 039a72e3
......@@ -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);
}
//删除自有活动
......
......@@ -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