Commit f80eef12 authored by 张艳玲's avatar 张艳玲

新增团队分配奖品

parent 40dde93e
......@@ -5,5 +5,5 @@ import lombok.Data;
@Data
public class SaveLimitBean {
public Integer confName;
public Integer confValue;
public String confValue;
}
......@@ -4,6 +4,5 @@ import lombok.Data;
@Data
public class TeamList {
public int id;
private Integer id;
}
......@@ -106,4 +106,5 @@ public interface AdminAuthorization {
}
......@@ -34,6 +34,7 @@ public class Agent implements AdminAuthorization {
@Test(description = "代理人B分享直播间", priority = 2)
public void 代理人B分享直播间() {
agentAuth1();
ThreadSleepUtils.sleep(500);
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 1);
......@@ -49,9 +50,10 @@ public class Agent implements AdminAuthorization {
@Test(description = "访客H关系绑定", priority = 3)
public void 访客H关系绑定() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign1);
bindingParam.put("shareSign", shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
......@@ -62,6 +64,7 @@ public class Agent implements AdminAuthorization {
@Test(description = "中奖任务邀请H绑定结果和绑定凭证", priority = 4)
public void 获取访客H绑定结果和绑定凭证() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
......@@ -89,6 +92,7 @@ public class Agent implements AdminAuthorization {
@Test(description = "访客I关系绑定", priority = 6)
public void 访客I关系绑定() {
visitorAuth8();
ThreadSleepUtils.sleep(1000);
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign1);
......@@ -102,6 +106,7 @@ public class Agent implements AdminAuthorization {
@Test(description = "中奖任务邀请I绑定结果和绑定凭证", priority = 7)
public void 获取访客I绑定结果和绑定凭证() {
visitorAuth8();
ThreadSleepUtils.sleep(1000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
......@@ -116,7 +121,7 @@ public class Agent implements AdminAuthorization {
@Test(description = "邀请I根据绑定凭证发放抽奖码", priority = 8)
public void 邀请I根据绑定凭证发放抽奖码() {
visitorAuth8();
ThreadSleepUtils.sleep(500);
ThreadSleepUtils.sleep(1000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
......
......@@ -118,8 +118,8 @@ public class DesignatedWinner implements AdminAuthorization {
addParam.put("lotteryType",1);
addParam.put("welfareId",this.List_Lottery.get(0).getId());
addParam.put("afterMin",20);
addParam.put("showInteractNum",200);
addParam.put("interactNum",200);
addParam.put("showInteractNum",100);
addParam.put("interactNum",100);
Response addRes = network.postResponse(addParam, BasicConfig.ANCHOR_add);
Object data = addRes.jsonPath().getJsonObject("data");
System.out.println(data);
......@@ -146,11 +146,11 @@ public class DesignatedWinner implements AdminAuthorization {
adminAuth();
Map<String, Object> addParam = new HashMap<>();
addParam.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
addParam.put("welfareId",this.welfareId.get(3).getWelfareId());
addParam.put("configId",this.welfareId.get(3).getConfigId());
addParam.put("welfareId",this.welfareId.get(4).getWelfareId());
addParam.put("configId",this.welfareId.get(4).getConfigId());
addParam.put("afterMin",30);
addParam.put("showInteractNum",200);
addParam.put("interactNum",200);
addParam.put("showInteractNum",500);
addParam.put("interactNum",500);
Response addRes = network.postResponse(addParam, BasicConfig.ANCHOR_Modify);
boolean success = addRes.jsonPath().getBoolean("success");
System.out.println(success);
......@@ -163,7 +163,7 @@ public class DesignatedWinner implements AdminAuthorization {
adminAuth();
Map<String, Object> addParam = new HashMap<>();
addParam.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
addParam.put("configId",this.welfareId.get(3).getConfigId());
addParam.put("configId",this.welfareId.get(4).getConfigId());
Response addRes = network.postResponse(addParam, BasicConfig.ANCHOR_delete);
boolean success = addRes.jsonPath().getBoolean("success");
System.out.println(success);
......
......@@ -149,23 +149,23 @@ public class LotteryRule implements AdminAuthorization {
savelimitParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
List<SaveLimitBean> savelimit = new ArrayList<>();
SaveLimitBean limitlist = new SaveLimitBean();
limitlist.setConfValue(3);
limitlist.setConfName(1);
limitlist.setConfName(3);
limitlist.setConfValue("1");
savelimit.add(limitlist);
SaveLimitBean limitlist1 = new SaveLimitBean();
limitlist1.setConfValue(4);
limitlist1.setConfName(1);
limitlist1.setConfName(4);
limitlist1.setConfValue("1");
savelimit.add(limitlist1);
SaveLimitBean limitlist2 = new SaveLimitBean();
limitlist2.setConfValue(11);
limitlist2.setConfName(1);
limitlist2.setConfName(11);
limitlist2.setConfValue("1");
savelimit.add(limitlist2);
SaveLimitBean limitlist3 = new SaveLimitBean();
limitlist3.setConfValue(12);
limitlist3.setConfName(0);
limitlist3.setConfName(12);
limitlist3.setConfValue("0");
savelimit.add(limitlist3);
savelimitParam.put("list",savelimit);
Response response = network.postResponse(savelimitParam, BasicConfig.MANAGER_saveLimit);
......
......@@ -64,6 +64,7 @@ public class SaveAndUpdate implements AdminAuthorization {
save2.setCityCode(330100);
provinceCityCode.add(save2);
saveAndUpdateParam.put("provinceCityCodeList", provinceCityCode);
Response response = network.postResponse(saveAndUpdateParam, BasicConfig.MANAGER_SAVEANDUPDATE);
liveID = response.jsonPath().getString("data");
......
package com.kjj.cases.live.manager;
import com.kjj.bean.manager.TeamList;
import com.kjj.bean.manager.TreasureList;
import com.kjj.cases.live.admin.AdminAuthorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.BaseUtils;
import com.kjj.utils.JsonUtil;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TeamLottery implements AdminAuthorization {
public long confId;
public long teamId;
public long Id;
public Integer taskId;
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
}
@Test(description = "获取抽奖轮次信息", priority = 1)
public void 获取抽奖轮次信息() {
Map<String, Object> listParam = new HashMap<>();
listParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(listParam, BasicConfig.MANAGER_list);
List data = response.jsonPath().getList("data");
Map resultMap = (Map) data.get(3);
System.out.println(resultMap.get("confId"));
confId =Long.parseLong(resultMap.get("confId").toString());
Assert.assertNotNull(confId, network.message(listParam, BasicConfig.MANAGER_list, "获取抽奖轮次信息失败", response.body().asString()));
}
@Test(description = "查询新增时团队列表", priority = 2)
public void 查询新增时团队列表() {
Map<String, Object> searchParam = new HashMap<>();
searchParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
searchParam.put("confId",confId);
searchParam.put("pageSize",20);
searchParam.put("pageIndex",1);
Response response = network.getResponse(searchParam, BasicConfig.MANAGER_search);
Object data=response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(searchParam, BasicConfig.MANAGER_search, "查询新增时团队列表失败", response.body().asString()));
}
@Test(description = "新增团队配置", priority = 3)
public void 新增团队配置() {
Map<String, Object> saveParam = new HashMap<>();
saveParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
saveParam.put("confId",confId);
// saveParam.put("teamId",teamId);
saveParam.put("teamId",3817);
saveParam.put("totalNum",100);
Response response = network.postResponse(saveParam, BasicConfig.MANAGER_saveteam);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(saveParam, BasicConfig.MANAGER_saveteam, "新增团队失败", response.body().asString()));
}
@Test(description = "查询团队份数配置列表", priority = 4)
public void 查询团队份数配置列表() {
ThreadSleepUtils.sleep(500);
Map<String, Object> searchParam = new HashMap<>();
searchParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
searchParam.put("confId",confId);
searchParam.put("pageSize",20);
searchParam.put("pageIndex",1);
Response response = network.getResponse(searchParam, BasicConfig.MANAGER_teamlist);
List data = response.jsonPath().getList("data.list");
Map resultMap = (Map) data.get(0);
System.out.println(resultMap.get("id"));
Id =Long.parseLong(resultMap.get("id").toString());
Assert.assertNotNull(Id, network.message(searchParam, BasicConfig.MANAGER_teamlist, "查询团队份数配置列表失败", response.body().asString()));
}
@Test(description = "修改团队份数", priority = 5)
public void 修改团队份数() {
Map<String, Object> changeNumParam = new HashMap<>();
changeNumParam.put("id",Id);
changeNumParam.put("totalNum",99);
Response response = network.postResponse(changeNumParam, BasicConfig.MANAGER_changeNum);
boolean data=response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(changeNumParam, BasicConfig.MANAGER_changeNum, "修改团队份数失败", response.body().asString()));
}
@Test(description = "删除团队奖品配置", priority = 6)
public void 删除团队奖品配置() {
Map<String, Object> delParam = new HashMap<>();
delParam.put("id",Id);
Response response = network.postResponse(delParam, BasicConfig.MANAGER_del0);
boolean data=response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(delParam, BasicConfig.MANAGER_del0, "删除团队配置失败", response.body().asString()));
}
@Test(description = "批量导入团队份数配置", priority = 7)
public void 批量导入团队份数配置() {
Map<String, Object> importParam = new HashMap<>();
importParam.put("bizId",confId);
importParam.put("excelUrl", "https://yun.dui88.com/kjy/media/file/20210512/6437a7cc360c4217f9927a1cd53e5750.xlsx");
importParam.put("fileName", "团队配置份数模板.xlsx");
Response response = network.postResponse(importParam, BasicConfig.MANAGER_import0);
taskId = response.jsonPath().getInt("data");
System.out.println(taskId);
Assert.assertNotNull(taskId, network.message(importParam, BasicConfig.MANAGER_import0, "批量导入团队份数配置失败", response.body().asString()));
}
@Test(description = "获取导入任务结果", priority = 8)
public void 获取导入任务结果() throws InterruptedException {
Map<String, Object> resultParam = new HashMap<>();
resultParam.put("taskId", taskId);
Response response = null;
for (int i=0; i<10; i++) {
response = network.getResponse(resultParam, BasicConfig.MANAGER_result);
boolean hasFinish= response.jsonPath().getBoolean("data.hasFinish");
System.out.println(hasFinish);
if(hasFinish) return;
Thread.sleep(500);
}
Assert.fail(network.message(resultParam, BasicConfig.MANAGER_result, "获取导入任务结果失败", response.body().asString()));
}
@Test(description = "查询新增团队份数配置列表", priority = 9)
public void 查询新增团队份数配置列表() {
Map<String, Object> searchParam = new HashMap<>();
searchParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
searchParam.put("confId",confId);
searchParam.put("pageSize",20);
searchParam.put("pageIndex",1);
Response response = network.getResponse(searchParam, BasicConfig.MANAGER_teamlist);
List data = response.jsonPath().getList("data.list");
Map resultMap = (Map) data.get(0);
System.out.println(resultMap.get("id"));
Id =Long.parseLong(resultMap.get("id").toString());
Assert.assertNotNull(Id, network.message(searchParam, BasicConfig.MANAGER_teamlist, "查询团队份数配置列表失败", response.body().asString()));
}
@Test(description = "开启按团队配置份数开关", priority = 10)
public void 开启按团队配置份数开关() {
Map<String, Object> changeStatusParam = new HashMap<>();
changeStatusParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
changeStatusParam.put("confId",confId);
changeStatusParam.put("status",1);
Response response = network.postResponse(changeStatusParam, BasicConfig.MANAGER_changeStatus1);
boolean data=response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(changeStatusParam, BasicConfig.MANAGER_changeStatus1, "开启按团队配置份数开关失败", response.body().asString()));
}
}
......@@ -288,6 +288,16 @@ public class BasicConfig {
public static final String MANAGER_result1 = MANAGER_HOST+ "/kjy/manager/live/import/result";
public static final String MANAGER_importGroupProvider= MANAGER_HOST+ "/kjy/manager/live/prize/provide/conf/importGroupProvider";
//***************团队分配奖品*****************
public static final String MANAGER_search = MANAGER_HOST+ "/kjy/manager/live/lottery/team/search";
public static final String MANAGER_teamlist = MANAGER_HOST+ "/kjy/manager/live/lottery/team/list";
public static final String MANAGER_saveteam= MANAGER_HOST+ "/kjy/manager/live/lottery/team/save";
public static final String MANAGER_changeNum= MANAGER_HOST+ "/kjy/manager/live/lottery/team/changeNum";
public static final String MANAGER_del0= MANAGER_HOST+ "/kjy/manager/live/lottery/team/delete";
public static final String MANAGER_import0= MANAGER_HOST+ "/kjy/manager/live/lottery/team/import";
public static final String MANAGER_changeStatus1= MANAGER_HOST+ "/kjy/manager/live/lottery/team/changeStatus";
//***************直播中奖规则配置*****************
public static final String MANAGER_list = MANAGER_HOST+ "/kjy/manager/live/lottery/rule/list";
public static final String MANAGER_limit = MANAGER_HOST+ "/kjy/manager/live/lottery/limit";
......
......@@ -57,6 +57,12 @@
</classes>
</test>
<test preserve-order="true" name="按团队配置份数">
<classes>
<class name="com.kjj.cases.live.manager.TeamLottery"/>
</classes>
</test>
<test preserve-order="true" name="企业指定中奖名单上传">
<classes>
<class name="com.kjj.cases.live.manager.LiveLottery"/>
......@@ -87,6 +93,7 @@
</classes>
</test>
<test preserve-order="true" name="直播前-我的客户页">
<classes>
<class name="com.kjj.cases.live.agent.LiveBefore"/>
......@@ -208,7 +215,5 @@
<class name="com.kjj.cases.live.manager.spec"/>
</classes>
</test>
</suite>
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