Commit 73cb6da5 authored by 张艳玲's avatar 张艳玲

update

parent a4b781d8
package com.kjj.bean;
import lombok.Data;
@Data
public class ConfidList {
private String welfareConfId;
}
package com.kjj.bean;
import lombok.Data;
import java.util.List;
@Data
public class LotteryList {
private List<List_Lottery> LotteryList;
private String welfareId;
private String configId;
@Data
public static class List_Lottery
{
private String id;
private String name;
}
}
package com.kjj.cases.live;
import com.alibaba.fastjson.JSON;
import com.kjj.bean.AgentEndList;
import com.kjj.bean.ConfidList;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.JsonUtil;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Lottery implements AdminAuthorization{
@BeforeClass
public void setUp() {
agentAuth();
}
public List<ConfidList> List_Confid;
@Test(description = "抽奖活动弹层福利列表", priority = 1)
public void 抽奖活动弹层福利列表() {
Map<String, Object> listLiveLotterParam = new HashMap<>();
listLiveLotterParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response listLiveLotterRes = network.getResponse(listLiveLotterParam, BasicConfig.USER_listLiveLottery);
Object data = listLiveLotterRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(listLiveLotterParam, BasicConfig.USER_listLiveLottery, "抽奖活动弹层福利列表查询失败", listLiveLotterRes.body().asString()));
}
@Test(description = "查询抽奖奖品列表", priority = 2)
public void 查询抽奖奖品列表() {
Map<String, Object> getLiveAwardListParam = new HashMap<>();
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response getLiveAwardListRes = network.getResponse(getLiveAwardListParam, BasicConfig.USER_getLiveAwardList);
List<ConfidList> list= JsonUtil.parseResponseToListBean(getLiveAwardListRes,ConfidList.class);
System.out.println(list);
this.List_Confid=list;
Assert.assertNotNull(list, network.message(getLiveAwardListParam, BasicConfig.USER_getLiveAwardList, "抽奖标记为false", getLiveAwardListRes.body().asString()));
}
@Test(description = "开始第一轮抽奖", priority = 3)
public void 开始第一轮抽奖() {
Map<String, Object> startParam = new HashMap<>();
startParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
startParam.put("confId", this.List_Confid.get(0).getWelfareConfId());
Response startRes = network.postResponse(startParam, BasicConfig.ANCHOR_start);
Object data = startRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(startParam, BasicConfig.ANCHOR_start, "开启第一轮抽奖失败", startRes.body().asString()));
}
@Test(description = "助播视角_权益列表", priority = 4)
public void 助播端权益列表() {
Map<String, Object> listParam = new HashMap<>();
listParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response listRes = network.getResponse(listParam, BasicConfig.ANCHOR_list);
Object data = listRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(listParam, BasicConfig.ANCHOR_list, "主播端权益列表查询失败", listRes.body().asString()));
}
@Test(description = "抽奖状态查询", priority = 5)
public void 抽奖状态查询() {
Map<String, Object> statusParam = new HashMap<>();
statusParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
statusParam.put("confId", this.List_Confid.get(0).getWelfareConfId());
Response statusRes = network.postResponse(statusParam, BasicConfig.ANCHOR_status);
boolean data = statusRes.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(statusParam, BasicConfig.ANCHOR_status, "抽奖状态查询失败", statusRes.body().asString()));
}
@Test(description = "结束第一轮抽奖", priority = 6)
public void 结束第一轮抽奖() {
try {
Thread.sleep(1000);
Map<String, Object> endParam = new HashMap<>();
endParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
endParam.put("confId", this.List_Confid.get(0).getWelfareConfId());
Response endRes = network.postResponse(endParam, BasicConfig.ANCHOR_end);
Boolean data = endRes.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(endParam, BasicConfig.ANCHOR_end, "结束第一轮抽奖失败", endRes.body().asString()));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
...@@ -4,8 +4,6 @@ import com.kjj.utils.NetworkUtils; ...@@ -4,8 +4,6 @@ import com.kjj.utils.NetworkUtils;
/** /**
* 管理员后台授权 * 管理员后台授权
* @author zhanghuifeng
* date 2021/2/20-13:46
*/ */
public interface MngAuthorization { public interface MngAuthorization {
......
...@@ -13,8 +13,18 @@ public class OpenLive implements AdminAuthorization { ...@@ -13,8 +13,18 @@ public class OpenLive implements AdminAuthorization {
public void setUp() { public void setUp() {
adminAuth(); adminAuth();
} }
@Test(description = "获取直播配置详情", priority = 1)
public void 获取直播配置详情() {
Map<String, Object> ConfDetailParam = new HashMap<>();
ConfDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response ConfDetailRes = network.getResponse(ConfDetailParam, BasicConfig.ANCHOR_getConfDetail);
Object data = ConfDetailRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(ConfDetailParam, BasicConfig.ANCHOR_getConfDetail, "获取直播配置详情失败", ConfDetailRes.body().asString()));
}
@Test(description = "开始直播", priority = 1) @Test(description = "开始直播", priority = 2)
public void 开启直播() { public void 开启直播() {
Map<String, Object> openParam = new HashMap<>(); Map<String, Object> openParam = new HashMap<>();
openParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey())); openParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......
...@@ -9,7 +9,7 @@ public class BasicConfig { ...@@ -9,7 +9,7 @@ public class BasicConfig {
// 代理人的openid(固定) // 代理人的openid(固定)
public static final String OPEN_ID = "osi5w5ggFiEXk0tPJH9b0KO_XU08"; public static final String OPEN_ID = "osi5w5ggFiEXk0tPJH9b0KO_XU08";
//直播管理员(嘿 保险) //直播管理员(嘿 保险)
public static String ADMIN_KEY="LEH7epeHVDJWzhZ6DiexTHnsxr9dj8m9E3cwnnww5M4EuupwiJ3fYP8A6Ahrc22htzmVfYnNSfxHirjfK4BMwzQgtvhqh"; public static String ADMIN_KEY="LEH7epeHVDJWzhZ6DiexTHnsy12nWWyRsr9qezBqCy8rR8eqVZXHyQcwnLYHAkuLohC8Sy9vqcAwUZ3LuJCP5pRfjffr3";
// 直播代理人 (艳玲) // 直播代理人 (艳玲)
public static String AUTH_KEY ="LEH7epeHVDJWzhZ6DiexTHnfZY2NrKorVWS9R85xTeuUZzyc2boHSYWYU56ttSUbcAb9ngEb3LJBB3qZ7a9eCkEoPV5yu"; public static String AUTH_KEY ="LEH7epeHVDJWzhZ6DiexTHnfZY2NrKorVWS9R85xTeuUZzyc2boHSYWYU56ttSUbcAb9ngEb3LJBB3qZ7a9eCkEoPV5yu";
//直播访客 (嘿 保险) //直播访客 (嘿 保险)
...@@ -42,17 +42,32 @@ public class BasicConfig { ...@@ -42,17 +42,32 @@ public class BasicConfig {
// *************** 主播端 *************** // *************** 主播端 ***************
public static final String ANCHOR_OPEN = MOBILE_HOST + "/conf/live/open"; public static final String ANCHOR_OPEN = MOBILE_HOST + "/conf/live/open";
public static final String ANCHOR_getConfDetail = MOBILE_HOST + "/conf/pre/getConfDetail";
public static final String ANCHOR_CLOSE = MOBILE_HOST + "/conf/live/close"; public static final String ANCHOR_CLOSE = MOBILE_HOST + "/conf/live/close";
public static final String ANCHOR_ADDQUESTION = MOBILE_HOST + "/kjy/live/assist/question/addQuestion"; public static final String MOBILE_getSpecifyAwardConf = MOBILE_HOST + "/conf/pre/specifyAward/getSpecifyAwardConf";
public static final String ANCHOR_LIVECARD = MOBILE_HOST + "/kjy/mp/liveCard/getLiveEndSellerCard"; public static final String MOBILE_getAgentParticipateCond = MOBILE_HOST + "/conf/pre/specifyAward/getAgentParticipateCond";
public static final String MOBILE_getLiveAwardList = MOBILE_HOST + "/conf/pre/specifyAward/getLiveAwardList";
public static final String ANCHOR_start = MOBILE_HOST + "/conf/live/lottery/start";
public static final String ANCHOR_status = MOBILE_HOST + "/conf/live/lottery/status";
public static final String ANCHOR_end = MOBILE_HOST + "/conf/live/lottery/end";
public static final String ANCHOR_list = MOBILE_HOST + "/conf/live/lottery/list";
public static final String ANCHOR_List = MOBILE_HOST + "/conf/pre/lottery/pre/list";
public static final String ANCHOR_add = MOBILE_HOST + "/conf/pre/lottery/add";
public static final String ANCHOR_preModify = MOBILE_HOST + "/conf/pre/lottery/pre/modify";
public static final String ANCHOR_Modify = MOBILE_HOST + "/conf/pre/lottery/modify";
public static final String ANCHOR_delete = MOBILE_HOST + "/conf/pre/lottery/delete";
public static final String ANCHOR_getList4Admin = MOBILE_HOST + "/conf/pre/welfare/getList4Admin";
public static final String ANCHOR_list1 = MOBILE_HOST + "/conf/pre/lottery/list";
public static final String ANCHOR_preAdd = MOBILE_HOST + "/conf/pre/lottery/pre/add";
public static final String ANCHOR_preDelete = MOBILE_HOST + "/conf/pre/lottery/pre/delete";
// *************** 直播抽奖 ***************
public static final String USER_getLiveAwardList = MOBILE_HOST + "/kjy/live/conf/specifyAward/getLiveAwardList";
public static final String USER_listLiveLottery = MOBILE_HOST + "/kjy/live/lottery/listLiveLottery";
// *************** 访客端 *************** // *************** 访客端 ***************
public static final String USER_SUBSCRIBE = MOBILE_HOST + "/kjy/live/user/appointment/subscribe"; public static final String USER_SUBSCRIBE = MOBILE_HOST + "/kjy/live/user/appointment/subscribe";
public static final String USER_FIND = MOBILE_HOST + "/kjy/live/user/subscribe/find"; public static final String USER_FIND = MOBILE_HOST + "/kjy/live/user/subscribe/find";
public static final String USER_SYCAPPOINTMENT = MOBILE_HOST + "/kjy/live/user/sycAppointment"; public static final String USER_SYCAPPOINTMENT = MOBILE_HOST + "/kjy/live/user/sycAppointment";
public static final String USER_START = MOBILE_HOST + "/kjy/live/assist/lottery/start";
public static final String USER_DRAW = MOBILE_HOST + "/kjy/live/user/lottery/draw";
public static final String USER_END = MOBILE_HOST + "/kjy/live/assist/lottery/end";
public static final String USER_savePoster = MOBILE_HOST + "/kjy/live/user/share/savePoster"; public static final String USER_savePoster = MOBILE_HOST + "/kjy/live/user/share/savePoster";
public static final String USER_myCount = MOBILE_HOST + "/kjy/live/user/lottery/myCount"; public static final String USER_myCount = MOBILE_HOST + "/kjy/live/user/lottery/myCount";
public static final String USER_wxIdAllList = MOBILE_HOST1 + "/kjy/mp/msg/config/live/user/wxIdAllList"; public static final String USER_wxIdAllList = MOBILE_HOST1 + "/kjy/mp/msg/config/live/user/wxIdAllList";
...@@ -112,11 +127,12 @@ public class BasicConfig { ...@@ -112,11 +127,12 @@ public class BasicConfig {
public static final String MOBILE_Code = MOBILE_HOST + "/clue/invitation/code"; public static final String MOBILE_Code = MOBILE_HOST + "/clue/invitation/code";
public static final String MOBILE_MyLotteryCode = MOBILE_HOST + "/kjy/live/lottery/myLotteryCode"; public static final String MOBILE_MyLotteryCode = MOBILE_HOST + "/kjy/live/lottery/myLotteryCode";
public static final String MOBILE_SpecifyAwardUserSelectList = MOBILE_HOST + "/kjy/live/agent/specifyAwardUserSelectList"; public static final String MOBILE_SpecifyAwardUserSelectList = MOBILE_HOST + "/kjy/live/agent/specifyAwardUserSelectList";
public static final String MOBILE_status = MOBILE_HOST + "/index/status"; public static final String MOBILE_status1 = MOBILE_HOST + "/index/status";
public static final String MOBILE_agentSpecifyAwardUserList = MOBILE_HOST + "/kjy/live/agent/agentSpecifyAwardUserList"; public static final String MOBILE_agentSpecifyAwardUserList = MOBILE_HOST + "/kjy/live/agent/agentSpecifyAwardUserList";
public static final String MOBILE_agentSpecifyAwardInfo = MOBILE_HOST + "/kjy/live/agent/agentSpecifyAwardInfo"; public static final String MOBILE_agentSpecifyAwardInfo = MOBILE_HOST + "/kjy/live/agent/agentSpecifyAwardInfo";
public static final String MOBILE_agentSpecifyAwardConf = MOBILE_HOST + "/kjy/live/agent/agentSpecifyAwardConf"; public static final String MOBILE_agentSpecifyAwardConf = MOBILE_HOST + "/kjy/live/agent/agentSpecifyAwardConf";
//***************直播素材***************** //***************直播素材*****************
public static final String MANAGER_SAVEORUPDATE6 = MANAGER_HOST+ "/kjy/manager/conf/base/welfare/saveOrUpdate"; public static final String MANAGER_SAVEORUPDATE6 = MANAGER_HOST+ "/kjy/manager/conf/base/welfare/saveOrUpdate";
public static final String MANAGER_WELFARELIST = MANAGER_HOST+ "/kjy/manager/conf/base/welfare/list"; public static final String MANAGER_WELFARELIST = MANAGER_HOST+ "/kjy/manager/conf/base/welfare/list";
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<class name="com.kjj.cases.live.Procurator"/> <class name="com.kjj.cases.live.Procurator"/>
</classes> </classes>
</test> </test>
<test preserve-order="true" name="代理人分享直播间"> <test preserve-order="true" name="代理人分享直播间">
<classes> <classes>
<class name="com.kjj.cases.live.Agent"/> <class name="com.kjj.cases.live.Agent"/>
...@@ -42,6 +43,11 @@ ...@@ -42,6 +43,11 @@
<class name="com.kjj.cases.live.OpenLive"/> <class name="com.kjj.cases.live.OpenLive"/>
</classes> </classes>
</test> </test>
<test preserve-order="true" name="直播中抽奖">
<classes>
<class name="com.kjj.cases.live.Lottery"/>
</classes>
</test>
<test preserve-order="true" name="访客领取资料"> <test preserve-order="true" name="访客领取资料">
<classes> <classes>
<class name="com.kjj.cases.live.LiveVisitors"/> <class name="com.kjj.cases.live.LiveVisitors"/>
......
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