Commit 91e2ce3e authored by xiamengchen's avatar xiamengchen

新增我的客户

parent e5dde0b5
...@@ -60,64 +60,6 @@ public class ForwardAndRead implements Authorization { ...@@ -60,64 +60,6 @@ public class ForwardAndRead implements Authorization {
Assert.assertTrue(forwardResult, network.message(param, BasicConfig.FORWARD, "转发名片失败", response.body().asString())); Assert.assertTrue(forwardResult, network.message(param, BasicConfig.FORWARD, "转发名片失败", response.body().asString()));
} }
// @Test(description = "代理人转发抽奖", priority = 3)
// public void 转发抽奖() throws IOException{
// // 获取抽奖素材ID
// lottery_scId = getContentScId(BasicConfig.LOTTERY_CONTENTID);
//
// // 获取指定中奖客户信息
// Map<String, String> custInfos = new HashMap<>();
// custInfos.put("avatar", getUserInfo(BasicConfig.AGENT_TKU).get("avatar"));
// custInfos.put("visitorId", encodeId(decodeTku(BasicConfig.AGENT_TKU).get("userId")));
// custInfos.put("visitorNickname", getUserInfo(BasicConfig.AGENT_TKU).get("wxName"));
//
// // 指定客户中奖
// List<Object> winners = new ArrayList<>();
// winners.add(custInfos);
// param = new HashMap<>();
// param.put("scid", lottery_scId);
// param.put("winners", winners);
// response = network.postResponse(param, BasicConfig.LOTTERRY_addWinnersEn);
// String winnerId = response.jsonPath().getString("data[0].winnerId");
// Assert.assertNotNull(winnerId, network.message(param, BasicConfig.LOTTERRY_addWinnersEn, "添加中奖客户失败", response.body().asString()));
//
// // 保存抽奖配置
// List<String> winnerIds = new ArrayList<>();
// winnerIds.add(winnerId);
// Map<String, Object> prizeDetails = new HashMap<>();
// prizeDetails.put("customPrizeRate", 100);
// prizeDetails.put("customPrizeType", 1);
// prizeDetails.put("prizeImg", "https://yun.duiba.com.cn/kjj-prize-nodeimages/redbag.png");
// prizeDetails.put("prizeName", "奖品红包");
// prizeDetails.put("totalStock", 1);
// prizeDetails.put("winnerIds", winnerIds);
//
// param = new HashMap<>();
// param.put("pageTitle", "暖心冬日好礼");
// param.put("prizeDetails", prizeDetails);
// param.put("scid", lottery_scId);
// response = network.postResponse(param, BasicConfig.LOTTERRY_saveOrUpdateConf);
// activityConfId = response.jsonPath().getString("data");
// Assert.assertNotNull(activityConfId, network.message(param, BasicConfig.LOTTERRY_saveOrUpdateConf, "抽奖配置保存失败,未生成活动ID", response.body().asString()));
//
// // 获取配置详情
// param = new HashMap<>();
// param.put("scid", lottery_scId);
// param.put("activityConfId", activityConfId);
// response = network.getResponse(param, BasicConfig.LOTTERRY_getConf);
// activityCustomPrizeId = response.jsonPath().getString("data.prizeDetails[0].activityCustomPrizeId");
// Assert.assertEquals(response.jsonPath().getString("data.activityConfId"), activityConfId, network.message(param, BasicConfig.LOTTERRY_getConf, "获取配置与预期不对应", response.body().asString()));
// Assert.assertNotNull(activityCustomPrizeId, network.message(param, BasicConfig.LOTTERRY_getConf, "activityCustomPrizeId值为空", response.body().asString()));
//
// // 分享抽奖
// param = new HashMap<>();
// param.put("scId", lottery_scId);
// param.put("forwardType", 1);
// response = network.getResponse(param, BasicConfig.FORWARD);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.FORWARD, "接口请求失败", response.body().asString()));
// Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.FORWARD, "分享抽奖活动失败", response.body().asString()));
// }
// 访客访问素材及产生线索 // 访客访问素材及产生线索
@Test(description = "访客阅读文章", priority = 3) @Test(description = "访客阅读文章", priority = 3)
public void 访客阅读文章() throws IOException{ public void 访客阅读文章() throws IOException{
......
package com.kjj.cases.assistant.whoSawMe; package com.kjj.cases.assistant.whoSawMe;
import com.jogamp.common.util.ArrayHashSet;
import com.kjj.bean.whoSawMe.ChatList; import com.kjj.bean.whoSawMe.ChatList;
import com.kjj.bean.whoSawMe.CustFavorite; import com.kjj.bean.whoSawMe.CustFavorite;
import com.kjj.bean.whoSawMe.LinkList; import com.kjj.bean.whoSawMe.LinkList;
...@@ -32,7 +33,6 @@ public class MyCustomer implements Authorization { ...@@ -32,7 +33,6 @@ public class MyCustomer implements Authorization {
private long visitor1UserId; private long visitor1UserId;
private String sessionId; private String sessionId;
private int visitCount; private int visitCount;
private Long timeStamp;
private String id; // 自定义提醒事项id private String id; // 自定义提醒事项id
@BeforeClass @BeforeClass
...@@ -234,67 +234,34 @@ public class MyCustomer implements Authorization { ...@@ -234,67 +234,34 @@ public class MyCustomer implements Authorization {
} }
// 我的客户首页_获取客户列表_筛选客户 // 我的客户首页_获取客户列表_筛选客户
@Test(description = "客户列表_七日活跃", priority = 12) @Test(description = "客户列表_好友转发", priority = 14)
public void 客户列表_七日活跃() throws IOException{ public void 客户列表_好友转发() throws IOException{
param = new HashMap<>();
param.put("activeType", 1);
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sortType", 3);
response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString()));
List<Object> lists = response.jsonPath().getList("data.list");
Assert.assertTrue(lists.size() >= 1, network.message(param, BasicConfig.CUSTOMERSEARCH, "七日活跃客户数为0", response.body().asString()));
}
// 我的客户首页_获取客户列表_筛选客户
@Test(description = "客户列表_直接转发", priority = 13)
public void 客户列表_直接转发() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("custOrigin", 1); param.put("custOrigin", 2);
param.put("pageIndex", 1); param.put("pageIndex", 1);
param.put("pageSize", 20); param.put("pageSize", 20);
param.put("sortType", 3); param.put("sortType", 3);
response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH); response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString())); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString()));
List<Object> lists = response.jsonPath().getList("data.list"); Long custUserId = response.jsonPath().getLong("data.list[0].userId");
Assert.assertTrue(lists.size() >= 1, network.message(param, BasicConfig.CUSTOMERSEARCH, "直接转发客户数为0", response.body().asString())); Assert.assertEquals(custUserId, far.decodeTku(BasicConfig.VISITOR1_TKU).get("userId"), network.message(param, BasicConfig.CUSTOMERSEARCH, "好友转发的访客userId与预期不一致", response.body().asString()));
} }
// 我的客户首页_获取客户列表_筛选客户 // 客户列表_标签
@Test(description = "客户列表_好友转发", priority = 14) @Test(description = "客户列表_标签", priority = 31)
public void 客户列表_好友转发() throws IOException{ public void 客户列表_标签() throws IOException{
List<String> tagIds = new ArrayList<>();
tagIds.add(createTagId);
param = new HashMap<>(); param = new HashMap<>();
param.put("custOrigin", 2);
param.put("pageIndex", 1); param.put("pageIndex", 1);
param.put("pageSize", 20); param.put("pageSize", 20);
param.put("sortType", 3); param.put("sortType", 3);
param.put("tagIds", tagIds);
response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH); response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString())); long userId = response.jsonPath().getLong("data.list[0].sellerId");
Long custUserId = response.jsonPath().getLong("data.list[0].userId"); Assert.assertEquals(userId, visitor1UserId, network.message(param, BasicConfig.CUSTOMERSEARCH, "筛选结果与预期不符", response.body().asString()));
Assert.assertEquals(custUserId, far.decodeTku(BasicConfig.VISITOR1_TKU).get("userId"), network.message(param, BasicConfig.CUSTOMERSEARCH, "好友转发的访客userId与预期不一致", response.body().asString()));
} }
// // 我的客户首页_搜索客户
// @Test(description = "搜索客户", priority = 15)
// public void 客户列表_搜索客户() throws IOException{
// param = new HashMap<>();
// // 获取用户微信昵称
// network.agentCookies.put("tku", BasicConfig.VISITOR_TKU);
// response = network.getResponse(BasicConfig.USER_INFO);
// String customerName = response.jsonPath().getString("data.wxName");
//
// // 代理人搜索客户
// network.agentCookies.put("tku", BasicConfig.VISITOR2_TKU);
// param.put("content", customerName);
// param.put("pageIndex", 1);
// param.put("pageSize", 20);
// response = network.getResponse(param, BasicConfig.SEARCHCUSTOMERBYCONTENT);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.SEARCHCUSTOMERBYCONTENT, "接口请求失败", response.body().asString()));
// List<Object> cusLists = response.jsonPath().getList("data.list");
// Assert.assertTrue(cusLists.size() > 0, network.message(param, BasicConfig.SEARCHCUSTOMERBYCONTENT, "查询无匹配结果", response.body().asString()));
// }
// 客户详情页_头部信息栏 // 客户详情页_头部信息栏
@Test(description = "客户详情页_头部信息栏", priority = 16) @Test(description = "客户详情页_头部信息栏", priority = 16)
public void 客户详情页_头部信息栏() throws IOException{ public void 客户详情页_头部信息栏() throws IOException{
...@@ -373,17 +340,6 @@ public class MyCustomer implements Authorization { ...@@ -373,17 +340,6 @@ public class MyCustomer implements Authorization {
Assert.assertTrue(drawPresentInsuranceCount >= 1, network.message(param, BasicConfig.CLUESTATISTICS, "客户领取赠险次数小于1", response.body().asString())); Assert.assertTrue(drawPresentInsuranceCount >= 1, network.message(param, BasicConfig.CLUESTATISTICS, "客户领取赠险次数小于1", response.body().asString()));
} }
// // 客户详情页_人脉统计
// @Test(description = "客户详情页_人脉统计", priority = 20)
// public void 客户详情页_人脉统计() throws IOException{
// param = new HashMap<>();
// param.put("custUserId", far.decodeTku(BasicConfig.VISITOR_TKU).get("userId"));
// response = network.getResponse(param, BasicConfig.CUSTRELATION);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTRELATION, "接口请求失败", response.body().asString()));
// int num = response.jsonPath().getInt("data.num");
// Assert.assertTrue(num >= 1, network.message(param, BasicConfig.CUSTRELATION, "客户人脉统计数量小于1", response.body().asString()));
// }
// 客户详情页_线索统计 // 客户详情页_线索统计
@Test(description = "客户详情页_线索统计", priority = 21) @Test(description = "客户详情页_线索统计", priority = 21)
public void 客户详情页_线索统计() throws IOException{ public void 客户详情页_线索统计() throws IOException{
...@@ -406,7 +362,6 @@ public class MyCustomer implements Authorization { ...@@ -406,7 +362,6 @@ public class MyCustomer implements Authorization {
param.put("custUserId", visitor1UserId); param.put("custUserId", visitor1UserId);
response = network.getResponse(param, BasicConfig.CUSTREADPERFERENCE); response = network.getResponse(param, BasicConfig.CUSTREADPERFERENCE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTREADPERFERENCE, "接口请求失败", response.body().asString())); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTREADPERFERENCE, "接口请求失败", response.body().asString()));
} }
// 客户详情页_来访记录 // 客户详情页_来访记录
...@@ -520,7 +475,7 @@ public class MyCustomer implements Authorization { ...@@ -520,7 +475,7 @@ public class MyCustomer implements Authorization {
} }
// 客户信息_客户管理_自定义提醒事项 // 客户信息_客户管理_自定义提醒事项
@Test(description = "客户信息_客户管理_自定义提醒事项", priority = 31) @Test(description = "客户信息_客户管理_自定义提醒事项", priority = 32)
public void 客户信息_客户管理_自定义提醒事项() throws IOException{ public void 客户信息_客户管理_自定义提醒事项() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("remindContent", "自定义提醒"); param.put("remindContent", "自定义提醒");
...@@ -549,7 +504,7 @@ public class MyCustomer implements Authorization { ...@@ -549,7 +504,7 @@ public class MyCustomer implements Authorization {
} }
// 客户信息_客户管理_修改提醒事项 // 客户信息_客户管理_修改提醒事项
@Test(description = "客户信息_客户管理_修改提醒事项", priority = 32) @Test(description = "客户信息_客户管理_修改提醒事项", priority = 33)
public void 客户信息_客户管理_修改提醒事项() throws IOException{ public void 客户信息_客户管理_修改提醒事项() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("id", id); param.put("id", id);
...@@ -575,7 +530,7 @@ public class MyCustomer implements Authorization { ...@@ -575,7 +530,7 @@ public class MyCustomer implements Authorization {
} }
//客户信息_客户管理_删除自定义提醒 //客户信息_客户管理_删除自定义提醒
@Test(description = "客户信息_客户管理_删除自定义提醒", priority = 33) @Test(description = "客户信息_客户管理_删除自定义提醒", priority = 34)
public void 客户信息_客户管理_删除自定义提醒() throws IOException{ public void 客户信息_客户管理_删除自定义提醒() throws IOException{
// 删除待提醒事件 // 删除待提醒事件
param = new HashMap<>(); param = new HashMap<>();
...@@ -607,7 +562,7 @@ public class MyCustomer implements Authorization { ...@@ -607,7 +562,7 @@ public class MyCustomer implements Authorization {
} }
// 客户信息_客户管理_生日提醒 // 客户信息_客户管理_生日提醒
@Test(description = "客户信息_客户管理_生日提醒", priority = 34) @Test(description = "客户信息_客户管理_生日提醒", priority = 35)
public void 客户信息_客户管理_生日提醒() throws IOException{ public void 客户信息_客户管理_生日提醒() throws IOException{
String userId = String.valueOf(visitor1UserId); String userId = String.valueOf(visitor1UserId);
// 开启生日提醒 // 开启生日提醒
...@@ -643,7 +598,7 @@ public class MyCustomer implements Authorization { ...@@ -643,7 +598,7 @@ public class MyCustomer implements Authorization {
} }
// 客户信息_客户管理_节日提醒 // 客户信息_客户管理_节日提醒
@Test(description = "客户信息_客户管理_节日提醒", priority = 35) @Test(description = "客户信息_客户管理_节日提醒", priority = 36)
public void 客户信息_客户管理_节日提醒() throws IOException{ public void 客户信息_客户管理_节日提醒() throws IOException{
String userId = String.valueOf(visitor1UserId); String userId = String.valueOf(visitor1UserId);
// 开启节日提醒 // 开启节日提醒
...@@ -676,7 +631,7 @@ public class MyCustomer implements Authorization { ...@@ -676,7 +631,7 @@ public class MyCustomer implements Authorization {
} }
// 客户信息_客户关系链_统计信息 // 客户信息_客户关系链_统计信息
@Test(description = "客户信息_客户关系链_统计信息", priority = 36) @Test(description = "客户信息_客户关系链_统计信息", priority = 37)
public void 客户信息_客户关系链_统计信息() throws IOException{ public void 客户信息_客户关系链_统计信息() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("custUserId", far.decodeTku(BasicConfig.AGENT_TKU).get("userId")); param.put("custUserId", far.decodeTku(BasicConfig.AGENT_TKU).get("userId"));
...@@ -686,7 +641,7 @@ public class MyCustomer implements Authorization { ...@@ -686,7 +641,7 @@ public class MyCustomer implements Authorization {
} }
// 客户信息_客户关系链_人脉列表 // 客户信息_客户关系链_人脉列表
@Test(description = "客户信息_客户关系链_人脉列表", priority = 37) @Test(description = "客户信息_客户关系链_人脉列表", priority = 38)
public void 客户信息_客户关系链_人脉列表() throws IOException{ public void 客户信息_客户关系链_人脉列表() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("custUserId", far.decodeTku(BasicConfig.AGENT_TKU).get("userId")); param.put("custUserId", far.decodeTku(BasicConfig.AGENT_TKU).get("userId"));
...@@ -699,7 +654,7 @@ public class MyCustomer implements Authorization { ...@@ -699,7 +654,7 @@ public class MyCustomer implements Authorization {
} }
// 客户信息_客户关系链_邀请排行 // 客户信息_客户关系链_邀请排行
@Test(description = "客户信息_客户关系链_邀请排行", priority = 38) @Test(description = "客户信息_客户关系链_邀请排行", priority = 39)
public void 客户信息_客户关系链_邀请排行() throws IOException{ public void 客户信息_客户关系链_邀请排行() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("type", 2); param.put("type", 2);
...@@ -711,7 +666,7 @@ public class MyCustomer implements Authorization { ...@@ -711,7 +666,7 @@ public class MyCustomer implements Authorization {
} }
//客户信息_更多资料 //客户信息_更多资料
@Test(description = "客户信息_更多资料", priority = 39) @Test(description = "客户信息_更多资料", priority = 40)
public void 客户信息_更多资料() throws IOException{ public void 客户信息_更多资料() throws IOException{
// 更新资料信息 // 更新资料信息
List<Object> baseMaterial = new ArrayList<>(); List<Object> baseMaterial = new ArrayList<>();
...@@ -753,7 +708,7 @@ public class MyCustomer implements Authorization { ...@@ -753,7 +708,7 @@ public class MyCustomer implements Authorization {
} }
// 客户详情页_留言 // 客户详情页_留言
@Test(description = "客户详情页_留言", priority = 40) @Test(description = "客户详情页_留言", priority = 41)
public void 客户详情页_留言() throws IOException{ public void 客户详情页_留言() throws IOException{
// 判断销售员是否首次访问新功能(留言) // 判断销售员是否首次访问新功能(留言)
param = new HashMap<>(); param = new HashMap<>();
...@@ -764,7 +719,7 @@ public class MyCustomer implements Authorization { ...@@ -764,7 +719,7 @@ public class MyCustomer implements Authorization {
} }
// 客户详情页_留言_发送消息 // 客户详情页_留言_发送消息
@Test(description = "客户详情页_留言_发送消息", priority = 41) @Test(description = "客户详情页_留言_发送消息", priority = 42)
public void 客户详情页_留言_发送消息() throws IOException{ public void 客户详情页_留言_发送消息() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("content", "Hello"); param.put("content", "Hello");
...@@ -775,7 +730,7 @@ public class MyCustomer implements Authorization { ...@@ -775,7 +730,7 @@ public class MyCustomer implements Authorization {
} }
// 客户详情页_留言_聊天内容 // 客户详情页_留言_聊天内容
@Test(description = "客户详情页_留言_聊天内容", priority = 42) @Test(description = "客户详情页_留言_聊天内容", priority = 43)
public void 客户详情页_留言_聊天内容() throws IOException{ public void 客户详情页_留言_聊天内容() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("pageSize", 30); param.put("pageSize", 30);
...@@ -797,7 +752,7 @@ public class MyCustomer implements Authorization { ...@@ -797,7 +752,7 @@ public class MyCustomer implements Authorization {
} }
// 客户详情页_留言_留言对象是否关注公众号 // 客户详情页_留言_留言对象是否关注公众号
@Test(description = "客户详情页_留言_留言对象是否关注公众号", priority = 43) @Test(description = "客户详情页_留言_留言对象是否关注公众号", priority = 44)
public void 客户详情页_留言_留言对象是否关注公众号() throws IOException{ public void 客户详情页_留言_留言对象是否关注公众号() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("targetSid", far.decodeTku(BasicConfig.VISITOR2_TKU).get("sellerId")); param.put("targetSid", far.decodeTku(BasicConfig.VISITOR2_TKU).get("sellerId"));
...@@ -806,12 +761,6 @@ public class MyCustomer implements Authorization { ...@@ -806,12 +761,6 @@ public class MyCustomer implements Authorization {
Assert.assertEquals(subscribe, 1, network.message(param, BasicConfig.CHAT_GETSUBSCRIBESTATUS, "判断用户是否关注公众号失败", response.body().asString())); Assert.assertEquals(subscribe, 1, network.message(param, BasicConfig.CHAT_GETSUBSCRIBESTATUS, "判断用户是否关注公众号失败", response.body().asString()));
} }
// // 客户详情页_留言_用户回复
// @Test(description = "客户详情页_留言_用户回复", priority = 44)
// public void 客户详情页_留言_用户回复() throws IOException{
//
// }
public Long roundUpToGetCurrentTimestamp(){ public Long roundUpToGetCurrentTimestamp(){
// 向上取整获取当前时间戳(半小时为单位) // 向上取整获取当前时间戳(半小时为单位)
Date current = new Date(); Date current = new Date();
......
...@@ -4,7 +4,6 @@ import com.kjj.cases.admin.Authorization; ...@@ -4,7 +4,6 @@ import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig; import com.kjj.config.BasicConfig;
import com.kjj.utils.BaseUtils; import com.kjj.utils.BaseUtils;
import io.restassured.response.Response; import io.restassured.response.Response;
import org.apache.groovy.json.internal.IO;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
......
...@@ -262,8 +262,8 @@ public class WhoSawMe implements Authorization { ...@@ -262,8 +262,8 @@ public class WhoSawMe implements Authorization {
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_ROLE, "接口请求失败", response.body().asString())); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_ROLE, "接口请求失败", response.body().asString()));
boolean hasSubordinate = response.jsonPath().getBoolean("data.hasSubordinate"); boolean hasSubordinate = response.jsonPath().getBoolean("data.hasSubordinate");
int teamNumber = response.jsonPath().getInt("data.teamNumber"); int teamNumber = response.jsonPath().getInt("data.teamNumber");
Assert.assertTrue(hasSubordinate, network.message(param, BasicConfig.BOSS_ROLE, "用户查询无下级", response.body().asString())); Assert.assertTrue(hasSubordinate, network.message(param, BasicConfig.BOSS_ROLE, "代理人查询无下级", response.body().asString()));
Assert.assertTrue(teamNumber >= 2, network.message(param, BasicConfig.BOSS_ROLE, "代理人团队人数有误", response.body().asString())); Assert.assertEquals(teamNumber, 2, network.message(param, BasicConfig.BOSS_ROLE, "代理人团队人数有误", response.body().asString()));
} }
// 代理人团队成员数 // 代理人团队成员数
...@@ -274,48 +274,31 @@ public class WhoSawMe implements Authorization { ...@@ -274,48 +274,31 @@ public class WhoSawMe implements Authorization {
response = network.getResponse(param, BasicConfig.TEAMMEMBERNUM); response = network.getResponse(param, BasicConfig.TEAMMEMBERNUM);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMMEMBERNUM, "接口请求失败", response.body().asString())); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMMEMBERNUM, "接口请求失败", response.body().asString()));
int personalNum = response.jsonPath().getInt("data.personalNum"); int personalNum = response.jsonPath().getInt("data.personalNum");
Assert.assertTrue(personalNum >= 2, network.message(param, BasicConfig.TEAMMEMBERNUM, "代理人团队人数有误", response.body().asString())); Assert.assertEquals(personalNum, 2, network.message(param, BasicConfig.TEAMMEMBERNUM, "代理人团队人数有误", response.body().asString()));
} }
// // 获取今日团队数据 // 获取个人排行列表
// @Test(description = "获取今日团队数据", priority = 21) @Test(description = "获取个人排行列表", priority = 22)
// public void 获取今日团队数据() throws IOException{ public void 获取个人排行列表() throws IOException{
// param = new HashMap<>(); param= new HashMap<>();
// param.put("superiorId", xxxSellerId); param.put("pageIndex", 1);
// param.put("sortType", 4); param.put("pageSize", 20);
// param.put("team", false); param.put("sortType", 4);
// response = network.getResponse(param, BasicConfig.TEAMDATA); param.put("superiorId", xxxSellerId);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMDATA, "接口请求失败", response.body().asString())); param.put("listType", 4);
// int forwardMaterialNum = response.jsonPath().getInt("data.forwardMaterialNum"); param.put("team", false);
// int forwardCardNum = response.jsonPath().getInt("data.forwardCardNum"); response = network.getResponse(param, BasicConfig.TEAMRANKINGLIST);
// int gainSaleClueNum = response.jsonPath().getInt("data.gainSaleClueNum"); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMRANKINGLIST, "接口请求失败", response.body().asString()));
// Assert.assertEquals(forwardCardNum, 4, network.message(param, BasicConfig.TEAMDATA, "转发卡片数量不为1", response.body().asString())); List<RankingList> rankingLists = JsonUtil.parseResponseToPageBean(response, RankingList.class);
// Assert.assertEquals(forwardMaterialNum, 4, network.message(param, BasicConfig.TEAMDATA, "转发素材数量不为1", response.body().asString())); List<String> memberSids = Lists.newArrayList();
// Assert.assertEquals(gainSaleClueNum, 8, network.message(param, BasicConfig.TEAMDATA, "获得线索数量不为2", response.body().asString())); memberSids.add(far.encodeId(xxxSellerId));
// } memberSids.add(far.encodeId(far.decodeTku(BasicConfig.AGENT_TKU).get("sellerId")));
Assert.assertTrue(rankingLists.size() >= 2, network.message(param, BasicConfig.TEAMRANKINGLIST, "排行榜人员数有误", response.body().asString()));
// // 获取个人排行列表 for (int i = 0; i < rankingLists.size(); i++){
// @Test(description = "获取个人排行列表", priority = 22) boolean isExist = memberSids.contains(rankingLists.get(i).getSellerId());
// public void 获取个人排行列表() throws IOException{ Assert.assertTrue(isExist, network.message(param, BasicConfig.TEAMRANKINGLIST, "排行榜内成员sid有误", response.body().asString()));
// param= new HashMap<>(); }
// param.put("pageIndex", 1); }
// param.put("pageSize", 20);
// param.put("sortType", 4);
// param.put("superiorId", xxxSellerId);
// param.put("listType", 4);
// param.put("team", false);
// response = network.getResponse(param, BasicConfig.TEAMRANKINGLIST);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMRANKINGLIST, "接口请求失败", response.body().asString()));
// List<RankingList> rankingLists = JsonUtil.parseResponseToPageBean(response, RankingList.class);
// List<String> memberSids = Lists.newArrayList();
// memberSids.add(far.encodeId(xxxSellerId));
// memberSids.add(far.encodeId(far.decodeTku(BasicConfig.AGENT_TKU).get("sellerId")));
// Assert.assertTrue(rankingLists.size() >= 2, network.message(param, BasicConfig.TEAMRANKINGLIST, "排行榜人员数有误", response.body().asString()));
// for (int i = 0; i < rankingLists.size(); i++){
// boolean isExist = memberSids.contains(rankingLists.get(i).getSellerId());
// Assert.assertTrue(isExist, network.message(param, BasicConfig.TEAMRANKINGLIST, "排行榜内成员sid有误", response.body().asString()));
// }
// }
// 团队任务 // 团队任务
...@@ -399,6 +382,7 @@ public class WhoSawMe implements Authorization { ...@@ -399,6 +382,7 @@ public class WhoSawMe implements Authorization {
response = network.getResponse(param, BasicConfig.BOSS_TEAMTASKLIST); response = network.getResponse(param, BasicConfig.BOSS_TEAMTASKLIST);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_TEAMTASKLIST, "接口请求失败", response.body().asString())); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_TEAMTASKLIST, "接口请求失败", response.body().asString()));
} }
// 查看今日转发素材列表 // 查看今日转发素材列表
@Test(description = "查看今日转发素材列表", priority = 29) @Test(description = "查看今日转发素材列表", priority = 29)
public void 查看转发素材列表() throws IOException{ public void 查看转发素材列表() throws IOException{
......
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