Commit 91e2ce3e authored by xiamengchen's avatar xiamengchen

新增我的客户

parent e5dde0b5
......@@ -60,64 +60,6 @@ public class ForwardAndRead implements Authorization {
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)
public void 访客阅读文章() throws IOException{
......
......@@ -4,7 +4,6 @@ import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.utils.BaseUtils;
import io.restassured.response.Response;
import org.apache.groovy.json.internal.IO;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
......
......@@ -262,8 +262,8 @@ public class WhoSawMe implements Authorization {
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_ROLE, "接口请求失败", response.body().asString()));
boolean hasSubordinate = response.jsonPath().getBoolean("data.hasSubordinate");
int teamNumber = response.jsonPath().getInt("data.teamNumber");
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.assertTrue(hasSubordinate, 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 {
response = network.getResponse(param, BasicConfig.TEAMMEMBERNUM);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMMEMBERNUM, "接口请求失败", response.body().asString()));
int personalNum = response.jsonPath().getInt("data.personalNum");
Assert.assertTrue(personalNum >= 2, network.message(param, BasicConfig.TEAMMEMBERNUM, "代理人团队人数有误", response.body().asString()));
}
// // 获取今日团队数据
// @Test(description = "获取今日团队数据", priority = 21)
// public void 获取今日团队数据() throws IOException{
// param = new HashMap<>();
// param.put("superiorId", xxxSellerId);
// param.put("sortType", 4);
// param.put("team", false);
// response = network.getResponse(param, BasicConfig.TEAMDATA);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMDATA, "接口请求失败", response.body().asString()));
// int forwardMaterialNum = response.jsonPath().getInt("data.forwardMaterialNum");
// int forwardCardNum = response.jsonPath().getInt("data.forwardCardNum");
// int gainSaleClueNum = response.jsonPath().getInt("data.gainSaleClueNum");
// Assert.assertEquals(forwardCardNum, 4, network.message(param, BasicConfig.TEAMDATA, "转发卡片数量不为1", response.body().asString()));
// Assert.assertEquals(forwardMaterialNum, 4, network.message(param, BasicConfig.TEAMDATA, "转发素材数量不为1", response.body().asString()));
// Assert.assertEquals(gainSaleClueNum, 8, network.message(param, BasicConfig.TEAMDATA, "获得线索数量不为2", response.body().asString()));
// }
// // 获取个人排行列表
// @Test(description = "获取个人排行列表", priority = 22)
// public void 获取个人排行列表() throws IOException{
// 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()));
// }
// }
Assert.assertEquals(personalNum, 2, network.message(param, BasicConfig.TEAMMEMBERNUM, "代理人团队人数有误", response.body().asString()));
}
// 获取个人排行列表
@Test(description = "获取个人排行列表", priority = 22)
public void 获取个人排行列表() throws IOException{
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 {
response = network.getResponse(param, BasicConfig.BOSS_TEAMTASKLIST);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_TEAMTASKLIST, "接口请求失败", response.body().asString()));
}
// 查看今日转发素材列表
@Test(description = "查看今日转发素材列表", priority = 29)
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