Commit 06420dbc authored by 别湘灵's avatar 别湘灵

Merge branch 'master' of /Users/biexiangling/Documents/kejiji with conflicts.

parent 44681908
package com.kjj.bean;
import lombok.Data;
@Data
public class LiveVisitor {
private String confId;
private String resourceBigImg;
private String resourceTitle;
private int resourceType;
private String resourceImg;
private String outLink;
private int outLinkType;
private String outLinkAppId;
private String resourceButtonTitle;
private String resourceSubTitle;
private String testType;
}
......@@ -23,7 +23,7 @@ public class CloseLive implements AdminAuthorization{
public void closeLive() {
Map<String, Object> closeParam = new HashMap<>();
closeParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
closeParam.put("cid", 101);
closeParam.put("cid", 90);
Response closeRes = network.postResponse(closeParam, BasicConfig.ANCHOR_CLOSE);
Object data = closeRes.jsonPath().getJsonObject("data");
System.out.println(data);
......
package com.kjj.cases.live;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.kjj.bean.VoteBean;
import com.kjj.bean.VoteListBean;
import com.kjj.bean.WelfareBean;
......@@ -8,11 +7,11 @@ import com.kjj.bean.WelfareListBean;
import com.kjj.config.BasicConfig;
import com.kjj.utils.BaseUtils;
import com.kjj.utils.JsonUtil;
import groovy.json.JsonBuilder;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.*;
......@@ -35,7 +34,7 @@ public class LiveMaterial implements AdminAuthorization {
saveOrUpdateParam.put("welfareName", "盲盒锦鲤");
saveOrUpdateParam.put("welfarePictures", "https://yun.dui88.com/kjy/image/20210304/1614844198545.jpeg");
saveOrUpdateParam.put("welfarePicturesArr", "https://yun.dui88.com/kjy/image/20210304/1614844198545.jpeg");
saveOrUpdateParam.put("companyId", 101);
saveOrUpdateParam.put("companyId", 90);
Response saveOrUpdatePes = network.postResponse(saveOrUpdateParam, BasicConfig.MANAGER_SAVEORUPDATE6);
boolean data = saveOrUpdatePes.jsonPath().getBoolean("data");
......@@ -47,7 +46,7 @@ public class LiveMaterial implements AdminAuthorization {
public void 查询福利并删除() {
Map<String, Object> params = new HashMap<>();
params.put("companyId", 101);
params.put("companyId", 90);
params.put("pageIndex", 1);
params.put("pageSize", 1);
......@@ -77,7 +76,7 @@ public class LiveMaterial implements AdminAuthorization {
public void 添加投票() {
Map<String, Object> choiceParam = new HashMap<>();
choiceParam.put("companyId", 101);
choiceParam.put("companyId", 90);
choiceParam.put("question", "投票测试一");
List<VoteListBean> votes = new ArrayList<>();
VoteListBean vote = new VoteListBean();
......@@ -104,7 +103,7 @@ public class LiveMaterial implements AdminAuthorization {
public void 查询投票并删除() {
Map<String, Object> choiceListPram = new HashMap<>();
choiceListPram.put("companyId", 101);
choiceListPram.put("companyId", 90);
choiceListPram.put("pageIndex", 1);
choiceListPram.put("pageSize", 1);
......@@ -132,7 +131,7 @@ public class LiveMaterial implements AdminAuthorization {
@Test(description = "问题管理", priority = 5)
public void 添加问题() {
Map<String, Object> questionParam = new HashMap<>();
questionParam.put("companyId", 101);
questionParam.put("companyId", 90);
questionParam.put("question", "测试问题");
Response questionRes = network.postResponse(questionParam, BasicConfig.MANAGER_QUESTION);
......@@ -145,7 +144,7 @@ public class LiveMaterial implements AdminAuthorization {
public void 查询问题并删除() {
Map<String, Object> question1Param = new HashMap<>();
question1Param.put("companyId", 101);
question1Param.put("companyId", 90);
question1Param.put("pageIndex", 1);
question1Param.put("pageSize", 1);
......@@ -173,7 +172,7 @@ public class LiveMaterial implements AdminAuthorization {
@Test(description = "添加图文资料", priority = 7)
public void 添加图文资料() {
Map<String, Object> resourceParam = new HashMap<>();
resourceParam.put("companyId", 101);
resourceParam.put("companyId", 90);
resourceParam.put("resourceTitle", "图文资料2");
resourceParam.put("resourceButtonTitle", "我要报名");
resourceParam.put("resourceImg", "https://yun.dui88.com/kjy/image/20210306/1615023456356.jpeg");
......@@ -191,7 +190,7 @@ public class LiveMaterial implements AdminAuthorization {
public void 查询图文并删除() {
Map<String, Object> imageTextParam = new HashMap<>();
imageTextParam.put("companyId", 101);
imageTextParam.put("companyId", 90);
imageTextParam.put("pageIndex", 1);
imageTextParam.put("pageSize", 1);
imageTextParam.put("resourceTypeList", 1);
......@@ -238,7 +237,7 @@ public class LiveMaterial implements AdminAuthorization {
public void 查询链接并删除() {
Map<String, Object> linkParam = new HashMap<>();
linkParam.put("companyId", 101);
linkParam.put("companyId", 90);
linkParam.put("pageIndex", 1);
linkParam.put("pageSize", 1);
linkParam.put("resourceTypeList", 9);
......@@ -268,7 +267,7 @@ public class LiveMaterial implements AdminAuthorization {
@Test(description = "添加表单", priority = 11)
public void 添加表单() {
Map<String, Object> formParam = new HashMap<>();
formParam.put("companyId", 101);
formParam.put("companyId", 90);
formParam.put("resourceTitle", "表单");
formParam.put("resourceButtonTitle", "我要报名");
formParam.put("resourcePicturesArr", Arrays.asList("https://yun.dui88.com/kjy/image/20210306/1615033326937.jpg"));
......@@ -287,7 +286,7 @@ public class LiveMaterial implements AdminAuthorization {
public void 查询表单并删除() {
Map<String, Object> form1Param = new HashMap<>();
form1Param.put("companyId", 101);
form1Param.put("companyId", 90);
form1Param.put("pageIndex", 1);
form1Param.put("pageSize", 1);
form1Param.put("resourceTypeList", 12);
......@@ -316,7 +315,7 @@ public class LiveMaterial implements AdminAuthorization {
@Test(description = "免费领资料", priority = 13)
public void 免费领资料() {
Map<String, Object> freeParam = new HashMap<>();
freeParam.put("companyId", 101);
freeParam.put("companyId", 90);
freeParam.put("resourceTitle", "免费领资料");
freeParam.put("resourceButtonTitle", "领取资料");
freeParam.put("resourcePicturesArr", Arrays.asList("https://yun.dui88.com/kjy/image/20210306/1615033326937.jpg"));
......@@ -335,7 +334,7 @@ public class LiveMaterial implements AdminAuthorization {
public void 删除免费领资料() {
Map<String, Object> form1Param = new HashMap<>();
form1Param.put("companyId", 101);
form1Param.put("companyId", 90);
form1Param.put("pageIndex", 1);
form1Param.put("pageSize", 1);
form1Param.put("resourceTypeList", 11);
......@@ -364,7 +363,7 @@ public class LiveMaterial implements AdminAuthorization {
@Test(description = "秒薪测试", priority = 15)
public void 秒薪测试() {
Map<String, Object> testParam = new HashMap<>();
testParam.put("companyId", 101);
testParam.put("companyId", 90);
testParam.put("clueType", 1);
testParam.put("mainButtonTitle","领取门票");
testParam.put("resourcePicturesArr", Arrays.asList("https://yun.dui88.com/kjy/image/20210306/1615033326937.jpg"));
......@@ -386,7 +385,7 @@ public class LiveMaterial implements AdminAuthorization {
public void 删除秒薪测试() {
Map<String, Object> test1Param = new HashMap<>();
test1Param.put("companyId", 101);
test1Param.put("companyId", 90);
test1Param.put("pageIndex", 1);
test1Param.put("pageSize", 1);
test1Param.put("resourceTypeList", 13);
......
package com.kjj.cases.live;
import com.alibaba.fastjson.JSON;
import com.kjj.bean.AgentBean;
import com.kjj.bean.LiveVisitor;
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.HashMap;
import java.util.List;
import java.util.Map;
public class LiveVisitors {
public class LiveVisitors implements AdminAuthorization
{
@BeforeClass
public void setUp() {
visitorAuth();
}
public String confId;
/*代理人首页直播列表*/
@Test(description = "代理人首页 ", priority = 1)
public void 代理人直播列表() {
/*访客端权益列表*/
@Test(description = "访客端权益列表", priority = 1)
public void 访客端权益列表()
{
Map<String, Object> params = new HashMap<>();
params.put("pageIndex", 1);
params.put("pageSize", 10);
Response response = network.getResponse(params, BasicConfig.MOBILE_Procurator);
List<AgentBean> agentBeans = JsonUtil.parseResponseToListBean(response, AgentBean.class);
if (agentBeans.size() > 0) {
AgentBean bean = agentBeans.get(0);
params.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_Resource);
List<LiveVisitor> agentBeans = JsonUtil.parseResponseToListBean(response, LiveVisitor.class);
if (agentBeans.size() > 0)
{
LiveVisitor bean = agentBeans.get(0);
System.out.println(JSON.toJSONString(agentBeans));
Assert.assertNotNull(bean, network.message(params, BasicConfig.MOBILE_Procurator, "查询直播列表失败", response.body().asString()));
Assert.assertNotNull(bean, network.message(params, BasicConfig.MOBILE_Resource, "查询权益列表失败", response.body().asString()));
}
}
/*公众号资料-领取*/
@Test(description = "公众号资料领取", priority = 2)
public void 公众号资料领取()
{
Map<String, Object> params = new HashMap<>();
params.put("confId", confId);
params.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_OfficialAccounts);
List<LiveVisitor> agentBeans = JsonUtil.parseResponseToListBean(response, LiveVisitor.class);
LiveVisitor bean = agentBeans.get(0);
System.out.println(JSON.toJSONString(agentBeans));
Assert.assertNotNull(bean, network.message(params, BasicConfig.MOBILE_OfficialAccounts, "领取公众号资料失败", response.body().asString()));
}
/*表单资料-领取*/
@Test(description = "表单资料领取", priority = 3)
public void 表单资料领取()
{
Map<String, Object> params = new HashMap<>();
params.put("confId", confId);
params.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_OfficialAccounts);
List<LiveVisitor> agentBeans = JsonUtil.parseResponseToListBean(response, LiveVisitor.class);
LiveVisitor bean = agentBeans.get(0);
System.out.println(JSON.toJSONString(agentBeans));
Assert.assertNotNull(bean, network.message(params, BasicConfig.MOBILE_OfficialAccounts, "领取表单资料失败", response.body().asString()));
}
/*免费领资料-领取*/
@Test(description = "免费领资料领取", priority = 3)
public void 免费领资料领取()
{
Map<String, Object> params = new HashMap<>();
params.put("confId", confId);
params.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_OfficialAccounts);
List<LiveVisitor> agentBeans = JsonUtil.parseResponseToListBean(response, LiveVisitor.class);
LiveVisitor bean = agentBeans.get(0);
System.out.println(JSON.toJSONString(agentBeans));
Assert.assertNotNull(bean, network.message(params, BasicConfig.MOBILE_OfficialAccounts, "领取表单资料失败", response.body().asString()));
}
}
......@@ -18,7 +18,7 @@ public class OpenLive implements AdminAuthorization {
public void 开启直播() {
Map<String, Object> openParam = new HashMap<>();
openParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
openParam.put("cid", 101);
openParam.put("cid", 90);
Response openRes = network.postResponse(openParam, BasicConfig.ANCHOR_OPEN);
Object data = openRes.jsonPath().getJsonObject("data");
System.out.println(data);
......
......@@ -112,6 +112,22 @@ public class BasicConfig {
public static final String MOBILE_TeamTeamCharts = MOBILE_HOST + "/kjy/live/team/teamCharts";
public static final String MOBILE_AgentPersonalTeamCharts = MOBILE_HOST + "/kjy/live/agent/personalTeamCharts";
//代理人列表//
//访客端领取资料//
//查询资料列表//
public static final String MOBILE_Resource = MOBILE_HOST + "/clue/resource/list";
//公众号领取//
public static final String MOBILE_OfficialAccounts = MOBILE_HOST + "/kjy/live/user/resource/receive";
//表单资料领取//
public static final String MOBILE_ = MOBILE_HOST + "/kjy/live/user/resource/receive";
//访客端领取资料//
public static final String MOBILE_GetAgentPosterInfo = MOBILE_HOST + "/kjy/live/share/getAgentPosterInfo";
......
......@@ -26,6 +26,12 @@
</classes>
</test>
<test preserve-order="true" name="访客领取资料">
<classes>
<class name="com.kjj.cases.live.LiveVisitors"/>
</classes>
</test>
<test preserve-order="true" name="助播-结束直播">
<classes>
<class name="com.kjj.cases.live.CloseLive"/>
......@@ -35,5 +41,7 @@
</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