Commit a202a167 authored by 张震's avatar 张震

完善代理人排行榜、我的客户逻辑;解决线上报错

parent 8cb87fa7
package com.kjj.cases.live; package com.kjj.cases.live;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.kjj.config.BasicConfig; import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants; import com.kjj.constants.LiveConstants;
import io.restassured.response.Response; import io.restassured.response.Response;
...@@ -9,7 +11,9 @@ import org.testng.annotations.Test; ...@@ -9,7 +11,9 @@ import org.testng.annotations.Test;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import static com.kjj.config.BasicConfig.*; import static com.kjj.config.BasicConfig.*;
...@@ -20,6 +24,10 @@ public class LiveAgent implements AdminAuthorization { ...@@ -20,6 +24,10 @@ public class LiveAgent implements AdminAuthorization {
public void setUp() { public void setUp() {
agentAuth(); } agentAuth(); }
public String pageSize; public String pageSize;
public String invitationNum;
public String allNum;
public String moreThan20MinNum;
//代理人直播排行榜; //代理人直播排行榜;
...@@ -32,11 +40,26 @@ public class LiveAgent implements AdminAuthorization { ...@@ -32,11 +40,26 @@ public class LiveAgent implements AdminAuthorization {
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params,BasicConfig.MOBILE_AgentPersonalCharts); Response response = network.getResponse(params,BasicConfig.MOBILE_AgentPersonalCharts);
boolean success = response.jsonPath().getBoolean("success"); boolean success = response.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_AgentPersonalCharts, "获取个人榜单失败", response.body().asString())); Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_AgentPersonalCharts, "获取个人榜单失败", response.body().asString()));
} }
//获取代理人自己的榜单信息
@Test(description="获取代理人自己的榜单信息",priority = 2)
public void 获取代理人自己的榜单信息() throws IOException {
Map<String, Object> params = new HashMap<String, Object>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params,BasicConfig.MOBILE_AgentOwnCharts);
boolean success = response.jsonPath().getBoolean("success");
invitationNum = response.jsonPath().getString("data.invitationNum");
System.out.println("success="+success+",invitationNum="+invitationNum);
Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_AgentOwnCharts, "获取代理人自己的榜单信息", response.body().asString()));
Assert.assertNotNull(invitationNum,network.message(MOBILE_AgentOwnCharts,"获取代理人自己榜单内的邀请人数失败",response.body().asString()));
}
// 获取团队榜; // 获取团队榜;
@Test(description="获取排行榜页面团队榜单",priority = 2) @Test(description="获取排行榜页面团队榜单",priority = 3)
public void 获取排行榜页面团队榜单() throws IOException{ public void 获取排行榜页面团队榜单() throws IOException{
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
params.put("pageIndex",1); params.put("pageIndex",1);
...@@ -44,143 +67,166 @@ public class LiveAgent implements AdminAuthorization { ...@@ -44,143 +67,166 @@ public class LiveAgent implements AdminAuthorization {
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params,BasicConfig.MOBILE_TeamTeamCharts); Response response = network.getResponse(params,BasicConfig.MOBILE_TeamTeamCharts);
boolean success = response.jsonPath().getBoolean("success"); boolean success = response.jsonPath().getBoolean("success");
List<String> list = response.jsonPath().getList("data.list.teamName");
System.out.println("-------"+list.size());
for (String name:list){
System.out.println("success="+success+",teamName="+ name);
Assert.assertTrue(success,network.message(params,BasicConfig.MOBILE_TeamTeamCharts,"获取团队榜单失败",response.body().asString())); Assert.assertTrue(success,network.message(params,BasicConfig.MOBILE_TeamTeamCharts,"获取团队榜单失败",response.body().asString()));
Assert.assertNotNull(name,network.message(MOBILE_TeamTeamCharts,"榜单内团队名称获取失败",response.body().asString()));
}
} }
// 获取队内榜; // 获取队内榜;
@Test(description="获取排行榜页面队内榜单",priority = 3) @Test(description="获取排行榜页面队内榜单",priority = 4)
public void 获取排行榜页面队内榜单() throws IOException{ public void 获取排行榜页面队内榜单() throws IOException{
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
params.put("pageIndex",1); params.put("pageIndex",1);
params.put("pageSize",20); params.put("pageSize",20);
// params.put("liveId",liveID);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params,BasicConfig.MOBILE_AgentPersonalTeamCharts); Response response = network.getResponse(params,BasicConfig.MOBILE_AgentPersonalTeamCharts);
boolean success = response.jsonPath().getBoolean("success"); boolean success = response.jsonPath().getBoolean("success");
List<String> list = response.jsonPath().getList("data.list.agentName");
for (String agentName:list){
System.out.println("success="+success+",agentName="+ agentName);
Assert.assertTrue(success,network.message(params,BasicConfig.MOBILE_AgentPersonalTeamCharts,"获取队内榜单失败",response.body().asString())); Assert.assertTrue(success,network.message(params,BasicConfig.MOBILE_AgentPersonalTeamCharts,"获取队内榜单失败",response.body().asString()));
Assert.assertNotNull(agentName,network.message(MOBILE_AgentPersonalTeamCharts,"队内榜代理人名称获取失败",response.body().asString()));
} }
}
// 获取代理人直播海报信息; // 获取代理人直播海报信息;
@Test(description="获取代理人直播海报信息",priority = 4) @Test(description="获取代理人直播海报信息",priority = 5)
public void 获取代理人直播海报信息() throws IOException{ public void 获取代理人直播海报信息() throws IOException{
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
// params.put("liveId",liveID);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params,MOBILE_GetAgentPosterInfo); Response response = network.getResponse(params,MOBILE_GetAgentPosterInfo);
boolean success = response.jsonPath().getBoolean("success"); boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,BasicConfig.MOBILE_GetAgentPosterInfo,"获取队内榜单失败",response.body().asString())); System.out.println(success);
Assert.assertTrue(success,network.message(params,BasicConfig.MOBILE_GetAgentPosterInfo,"获取代理人直播海报信息失败",response.body().asString()));
} }
//代理人我的客户列表; //代理人我的客户列表;
// 获取代理人各线索等级的线索数; // 获取代理人各线索等级的线索数;
@Test(description="获取线索等级的线索数",priority = 5) @Test(description="获取线索等级的线索数",priority = 6)
public void 获取线索等级的线索数() throws IOException { public void 获取线索等级的线索数() throws IOException {
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
// params.put("liveId",liveID);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params,BasicConfig.MOBILE_ClueNum); Response response = network.getResponse(params,BasicConfig.MOBILE_ClueNum);
boolean success = response.jsonPath().getBoolean("success"); boolean success = response.jsonPath().getBoolean("success");
allNum = response.jsonPath().getString("data.allNum");
moreThan20MinNum = response.jsonPath().getString("data.moreThan20MinNum");
System.out.println("success="+success+",allNum="+allNum+",moreThan20MinNum="+moreThan20MinNum);
Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueNum, "获取线索数失败", response.body().asString())); Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueNum, "获取线索数失败", response.body().asString()));
Assert.assertNotNull(allNum,network.message(MOBILE_TeamTeamCharts,"获取所有线索数量失败",response.body().asString()));
Assert.assertNotNull(moreThan20MinNum,network.message(MOBILE_TeamTeamCharts,"获取观看超过20分钟的人数失败",response.body().asString()));
} }
// 获取直播中直播结束线索列表; // 获取直播中直播结束线索列表;
@Test(description="获取线索列表",priority = 6) @Test(description="获取线索列表",priority = 7)
public void 获取线索列表() throws IOException { public void 获取线索列表() throws IOException {
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
// params.put("liveId",liveID);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("pageIndex",2); params.put("pageIndex",2);
params.put("pageSize",30); params.put("pageSize",30);
params.put("actionTypeList",20); params.put("actionTypeList",20);
Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList); Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList);
boolean success = response.jsonPath().getBoolean("success"); boolean success = response.jsonPath().getBoolean("success");
List<String> list = response.jsonPath().getList("data.list.name");
System.out.println("-------"+list.size());
for (String name:list){
System.out.println("-------"+list.size());
Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取线索列表失败", response.body().asString())); Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取线索列表失败", response.body().asString()));
Assert.assertNotNull(name,network.message(MOBILE_ClueList,"线索列表微信昵称获取失败",response.body().asString()));
} }
}
// 获取线索列表全部tab; // 获取线索列表全部tab;
@Test(description="获取线索列表全部tab数据",priority = 7) @Test(description="获取线索列表全部tab数据",priority = 8)
public void 获取线索列表全部tab数据() throws IOException { public void 获取线索列表全部tab数据() throws IOException {
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
// params.put("liveId",liveID);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("pageIndex",1); params.put("pageIndex",1);
params.put("pageSize",30); params.put("pageSize",30);
Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList); Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList);
boolean success = response.jsonPath().getBoolean("success"); boolean success = response.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取全部tab下数据失败", response.body().asString())); Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取全部tab下数据失败", response.body().asString()));
} }
// 获取线索列表新客户tab; // 获取线索列表新客户tab;
@Test(description="获取线索列表新客户tab数据",priority = 8) @Test(description="获取线索列表新客户tab数据",priority = 9)
public void 获取线索列表新客户tab数据() throws IOException { public void 获取线索列表新客户tab数据() throws IOException {
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
// params.put("liveId",liveID);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("pageIndex",1); params.put("pageIndex",1);
params.put("pageSize",30); params.put("pageSize",30);
params.put("actionTypeList",22); params.put("actionTypeList",22);
Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList); Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList);
boolean success = response.jsonPath().getBoolean("success"); boolean success = response.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取新客户tab下数据失败", response.body().asString())); Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取新客户tab下数据失败", response.body().asString()));
} }
// 获取线索列表老客户tab; // 获取线索列表老客户tab;
@Test(description="获取线索列表老客户tab数据",priority = 9) @Test(description="获取线索列表老客户tab数据",priority = 10)
public void 获取线索列表老客户tab数据() throws IOException { public void 获取线索列表老客户tab数据() throws IOException {
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
// params.put("liveId",liveID);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("pageIndex",1); params.put("pageIndex",1);
params.put("pageSize",30); params.put("pageSize",30);
params.put("actionTypeList",26); params.put("actionTypeList",26);
Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList); Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList);
boolean success = response.jsonPath().getBoolean("success"); boolean success = response.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取老客户tab下数据失败", response.body().asString())); Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取老客户tab下数据失败", response.body().asString()));
} }
// 获取线索列表未观看tab; // 获取线索列表未观看tab;
@Test(description="获取线索列表未观看tab数据",priority = 10) @Test(description="获取线索列表未观看tab数据",priority = 11)
public void 获取线索列表未观看tab数据() throws IOException { public void 获取线索列表未观看tab数据() throws IOException {
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
// params.put("liveId",liveID);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("pageIndex",1); params.put("pageIndex",1);
params.put("pageSize",30); params.put("pageSize",30);
params.put("actionTypeList",24); params.put("actionTypeList",24);
Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList); Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList);
boolean success = response.jsonPath().getBoolean("success"); boolean success = response.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取未观看tab下数据失败", response.body().asString())); Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取未观看tab下数据失败", response.body().asString()));
} }
// 获取线索列表中奖tab; // 获取线索列表中奖tab;
@Test(description="获取线索列表中奖tab数据",priority = 11) @Test(description="获取线索列表中奖tab数据",priority = 12)
public void 获取线索列表中奖tab数据() throws IOException { public void 获取线索列表中奖tab数据() throws IOException {
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
// params.put("liveId",liveID);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("pageIndex",1); params.put("pageIndex",1);
params.put("pageSize",30); params.put("pageSize",30);
params.put("actionTypeList",17); params.put("actionTypeList",17);
Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList); Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList);
boolean success = response.jsonPath().getBoolean("success"); boolean success = response.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取中奖tab下数据失败", response.body().asString())); Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取中奖tab下数据失败", response.body().asString()));
} }
// 获取线索列表报名tab; // 获取线索列表报名tab;
@Test(description="获取线索列表报名tab数据",priority = 12) @Test(description="获取线索列表报名tab数据",priority = 13)
public void 获取线索列表报名tab数据() throws IOException { public void 获取线索列表报名tab数据() throws IOException {
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
// params.put("liveId",liveID);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("pageIndex",1); params.put("pageIndex",1);
params.put("pageSize",30); params.put("pageSize",30);
params.put("actionTypeList",20); params.put("actionTypeList",20);
Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList); Response response = network.getResponse(params,BasicConfig.MOBILE_ClueList);
boolean success = response.jsonPath().getBoolean("success"); boolean success = response.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取报名tab下数据失败", response.body().asString())); Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_ClueList, "获取报名tab下数据失败", response.body().asString()));
} }
......
...@@ -11,7 +11,7 @@ public class BasicConfig { ...@@ -11,7 +11,7 @@ public class BasicConfig {
public static final String OPEN_ID = "osi5w5ggFiEXk0tPJH9b0KO_XU08"; public static final String OPEN_ID = "osi5w5ggFiEXk0tPJH9b0KO_XU08";
//直播管理员(嘿 保险) //直播管理员(嘿 保险)
public static String ADMIN_KEY="LEH7epeHVDJWzhZ6DiexTHnfZY1XcX7aBeCVXnN9q7y4raLKHyfe7RFy96seJBQ9NSPqtdNg8JjgUTDUcMu8pjJVo6Js6"; public static String ADMIN_KEY="LEH7epeHVDJWzhZ6DiexTHnsxr9dj8m9E3cwnnww5M4EuupwiJ3fYP8A6Ahrc22htzmVfYnNSfxHirjfK4BMwzQgtvhqh";
// 直播代理人 (艳玲) // 直播代理人 (艳玲)
public static String AUTH_KEY ="LEH7epeHVDJWzhZ6DiexTHnfZY2NrKorVWS9R85xTeuUZzyc2boHSYWYU56ttSUbcAb9ngEb3LJBB3qZ7a9eCkEoPV5yu"; public static String AUTH_KEY ="LEH7epeHVDJWzhZ6DiexTHnfZY2NrKorVWS9R85xTeuUZzyc2boHSYWYU56ttSUbcAb9ngEb3LJBB3qZ7a9eCkEoPV5yu";
...@@ -121,6 +121,9 @@ public class BasicConfig { ...@@ -121,6 +121,9 @@ public class BasicConfig {
public static final String MOBILE_TeamTeamCharts = MOBILE_HOST + "/kjy/live/team/teamCharts"; 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_AgentPersonalTeamCharts = MOBILE_HOST + "/kjy/live/agent/personalTeamCharts";
public static final String MOBILE_AgentOwnCharts = MOBILE_HOST + "/kjy/live/agent/ownCharts";
//代理人列表// //代理人列表//
......
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