Commit d733c0d1 authored by 龚小红's avatar 龚小红

Merge remote-tracking branch 'origin/master' into 20210813_gxh

parents 401036fe 99aba342
package com.kjj.bean.whoSawMe;
import lombok.Data;
@Data
public class VipList {
private long id;
private String nickname;
private long userId;
}
package com.kjj.bean.whoSawMe;
import lombok.Data;
@Data
public class tagList {
private int count;
private String id;
private String tagName;
}
......@@ -10,7 +10,6 @@ import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.testng.collections.Lists;
import java.io.IOException;
import java.util.*;
......@@ -67,7 +66,7 @@ public class MyCustomer implements Authorization {
}
// 标签管理页_新建标签
@Test(description = "标签管理_新建标签", priority =3)
@Test(description = "标签管理_新建标签", priority =4)
public void 标签管理_新建标签() throws IOException{
// 添加标签
param = new HashMap<>();
......@@ -87,7 +86,7 @@ public class MyCustomer implements Authorization {
}
// 标签管理_修改标签
@Test(description = "标签管理_修改标签", priority = 4)
@Test(description = "标签管理_修改标签", priority = 5)
public void 标签管理_修改标签() throws IOException{
// 修改标签
param = new HashMap<>();
......@@ -106,24 +105,25 @@ public class MyCustomer implements Authorization {
}
// 标签管理_删除标签
@Test(description = "标签管理_删除标签", priority = 100)
@Test(description = "标签管理_删除标签", priority = 3)
public void 标签管理_删除标签() throws IOException{
// 删除标签
List<String> ids = Lists.newArrayList();
ids.add(createTagId);
List<String> ids = new ArrayList<>();
// 删除所有标签
Response getTagListRes = network.getResponse(BasicConfig.TAG_GETLIST);
List<tagList> tagLists = JsonUtil.parseResponseToListBean(getTagListRes, tagList.class);
for(tagList tagList : tagLists){
String tagId = tagList.getId();
ids.add(tagId);
}
param = new HashMap<>();
param.put("ids", ids);
response = network.postResponse(param, BasicConfig.TAG_DELETE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TAG_DELETE, "接口请求失败", response.body().asString()));
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.TAG_DELETE, "标签删除失败", response.body().asString()));
Response delTagsRes = network.postResponse(param, BasicConfig.TAG_DELETE);
Assert.assertTrue(delTagsRes.jsonPath().getBoolean("data"), network.message(param, BasicConfig.TAG_DELETE, "标签删除失败", delTagsRes.body().asString()));
//查看标签列表
response = network.getResponse(BasicConfig.TAG_GETLIST);
List<Object> tagLists = response.jsonPath().getJsonObject("data");
for(int i = 0; i < tagLists.size(); i++){
String tagId = response.jsonPath().getString("data["+ i + "].id");
Assert.assertNotEquals(tagId, createTagId, network.message(BasicConfig.TAG_GETLIST, "标签未删除成功", response.body().asString()));
}
// 检查是否完全删除
tagLists = JsonUtil.parseResponseToListBean(network.getResponse(BasicConfig.TAG_GETLIST), tagList.class);
Assert.assertEquals(tagLists.size(), 0, network.message(param, BasicConfig.TAG_GETLIST, "标签列表内容未全部删除", network.getResponse(BasicConfig.TAG_GETLIST).body().asString()));
}
// 我的客户首页_获取全部客户列表_最近访问
......
package com.kjj.cases.assistant.whoSawMe;
import com.beust.jcommander.internal.Lists;
import com.kjj.bean.whoSawMe.MyTaskList;
import com.kjj.bean.whoSawMe.RankingList;
import com.kjj.bean.whoSawMe.TeamTaskList;
import com.kjj.bean.whoSawMe.WeeklyList;
import com.kjj.bean.whoSawMe.*;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.utils.BaseUtils;
......@@ -12,13 +9,11 @@ import com.kjj.utils.JsonUtil;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import static com.kjj.config.BasicConfig.*;
......@@ -158,7 +153,6 @@ public class WhoSawMe implements Authorization {
public void 查看我的访客列表() throws IOException{
network.agentCookies.put("tku", BasicConfig.VISITOR2_TKU);
response = network.getResponse(BasicConfig.USER_INFO);
System.out.println(response.body().asString());
List<Object> customerTagIds = Lists.newArrayList();
param = new HashMap<>();
param.put("customerTagIds", customerTagIds);
......@@ -360,14 +354,37 @@ public class WhoSawMe implements Authorization {
@Test(description = "其他代理人加入该代理人团队", priority = 25)
public void 邀请加入团队() throws IOException{
// 切换代理人加入团队
network.agentCookies.put("tku", BasicConfig.AGENT_TKU);
// 获取被邀请人sellerId
childSellerId = ForwardAndRead.decodeTku(BasicConfig.AGENT_TKU).get("sellerId");
// 确定被邀请代理人没有上级
network.agentCookies.put("tku", BasicConfig.AGENT_TKU);
response = network.getResponse(BasicConfig.BOSS_ROLE);
boolean hasSuperior = response.jsonPath().getBoolean("data.hasSuperior");
Assert.assertFalse(hasSuperior, network.message(BasicConfig.BOSS_ROLE, "该代理人已有上级", response.body().asString()));
while (hasSuperior){
// 获取上级昵称
Map<String, Object> bossNamePar = new HashMap<>();
bossNamePar.put("sellerId", childSellerId);
Response getBossNameRes = network.getResponse(bossNamePar, BasicConfig.BOSS_BOSS);
String bossName = getBossNameRes.jsonPath().getString("data");
// 获取上级sellerId
Map<String, Object> bossSIdPar = new HashMap<>();
bossSIdPar.put("sellerName", bossName);
bossSIdPar.put("fuzzyFlag", true);
bossSIdPar.put("pageNo", 1);
bossSIdPar.put("pageSize", 20);
Response getBossSIdRes = network.getResponse(bossSIdPar, BasicConfig.MANAGER_vipList);
List<VipList> list = JsonUtil.parseResponseToPageBean(getBossSIdRes, VipList.class);
Optional<VipList> bossInfos = list.stream().filter(option -> Objects.equals(option.getNickname(), bossName)).findFirst();
long bossSId = bossInfos.get().getId();
// 将被邀请人移除所属上级团队
Map<String, Object> remMemPar = new HashMap<>();
remMemPar.put("childSid", childSellerId);
remMemPar.put("superiorSid", bossSId);
Response remMemRes = network.postResponse(remMemPar, MANAGER_SELLERTEAM_REMOVEMEMBER);
Assert.assertTrue(remMemRes.jsonPath().getBoolean("data"), network.message(remMemPar, MANAGER_SELLERTEAM_REMOVEMEMBER, "删除成员失败", remMemRes.body().asString()));
hasSuperior = Boolean.FALSE;
}
// 代理人加入团队
param = new HashMap<>();
param.put("inviterSid", ForwardAndRead.decodeTku(BasicConfig.VISITOR2_TKU).get("sellerId"));
......@@ -382,8 +399,6 @@ public class WhoSawMe implements Authorization {
@Test(description = "查看被邀请代理人上级名称", priority = 26)
public void 查看上级名称() throws IOException{
// 获取被邀请代理人sellerId
childSellerId = ForwardAndRead.decodeTku(BasicConfig.AGENT_TKU).get("sellerId");
param = new HashMap<>();
param.put("sellerId", childSellerId);
response = network.getResponse(param, BasicConfig.BOSS_BOSS);
......@@ -457,7 +472,6 @@ public class WhoSawMe implements Authorization {
param = new HashMap<>();
param.put("sellerName", "吉吉");
param.put("superiorSid", String.valueOf(xxxSellerId));
System.out.println();
response = network.getResponse(param, BasicConfig.MEMBERSEARCH);
String sellerId = response.jsonPath().getString("data[0].sellerId");
Assert.assertEquals(sellerId, ForwardAndRead.encodeId(jjSellerId), network.message(param, BasicConfig.MEMBERSEARCH, "搜索结果错误", response.body().asString()));
......@@ -478,7 +492,7 @@ public class WhoSawMe implements Authorization {
network.agentCookies.put("tku", BasicConfig.AGENT_TKU);
response = network.getResponse(BasicConfig.BOSS_ROLE);
boolean hasSuperior = response.jsonPath().getBoolean("data.hasSuperior");
Assert.assertFalse(hasSuperior, network.message(param, BasicConfig.BOSS_ROLE, "成员仍有上级", response.body().asString()));
Assert.assertFalse(hasSuperior, network.message(BasicConfig.BOSS_ROLE, "成员仍有上级", response.body().asString()));
}
// 团队任务_新建任务
......@@ -889,7 +903,6 @@ public class WhoSawMe implements Authorization {
String clueSummary = response.jsonPath().getString("data.list.find{it.nickName == '小葡萄'}.clueSummary");
Assert.assertEquals(clueSummary, "TA想要领取风险测评报告", network.message(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "最近访客微信昵称不匹配", response.body().asString()));
clueId = response.jsonPath().getLong("data.list.find{it.nickName == '小葡萄'}.clueId");
System.out.println(response.body().asString());
}
// 销售线索_查看测评报告的领取详情
......@@ -904,7 +917,6 @@ public class WhoSawMe implements Authorization {
String clueSummary = response.jsonPath().getString("data.clueSummary");
Assert.assertEquals(visitClueType, 32, network.message(param, BasicConfig.CLUEINFO, "线索类型错误", response.body().asString()));
Assert.assertEquals(clueSummary, "领评测报告", network.message(param, BasicConfig.CLUEINFO, "线索来源类型错误", response.body().asString()));
System.out.println(response.body().asString());
}
// 代理人_转发评测报告
......@@ -942,5 +954,7 @@ public class WhoSawMe implements Authorization {
response = network.postResponse(param,GAME_consult);
String sCid = response.jsonPath().getString("data");
Assert.assertNotNull(reportScid, network.message(param,GAME_consult,"获取sCid失败",response.body().asString()));
visitor2Tku();
}
}
......@@ -89,7 +89,19 @@ public class LiveAgent implements Authorization {
}
@Test(description="获取直播间线索数统计",priority = 6)
@Test(description = "获取直播间准客户线索",priority = 6)
public void 获取直播间准客户线索(){
Map<String,Object> params = new HashMap<>();
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("pageIndex",1);
params.put("pageSize",30);
Response response = network.getResponse(params,BasicConfig.MOBILE_clueList);
System.out.println(response.body().asString());
boolean success=response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_clueList, "直播中准客户线索为null", response.body().asString()));
}
@Test(description="获取直播间线索数统计",priority = 7)
public void 获取直播间线索数统计() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......
......@@ -105,6 +105,9 @@ public class LiveLater implements Authorization {
long totalCount =response.jsonPath().getLong("data.totalCount");
Assert.assertTrue(totalCount>18, network.message(params, BasicConfig.MOBILE_ClueList, "线索数量不对", response.body().asString()));
Object customerType = response.jsonPath().getJsonObject("data.list.get(0).customerType");
System.out.println(customerType);
Assert.assertEquals(customerType,1,network.message(params,BasicConfig.MOBILE_ClueList,"准客户标签错误",response.body().asString()));
}
......@@ -228,6 +231,8 @@ public class LiveLater implements Authorization {
Assert.assertNotNull(choiceQuestions, network.message(params, BasicConfig.MOBILE_getClueDetail, "投票列表为null", response.body().asString()));
Object testResources=response.jsonPath().getJsonObject("data.testResources");
Assert.assertNotNull(testResources, network.message(params, BasicConfig.MOBILE_getClueDetail, "用户提交测试资源报告为null", response.body().asString()));
int customerType = response.jsonPath().getInt("data.customerType");
Assert.assertEquals(customerType,1,network.message(params,BasicConfig.MOBILE_getClueDetail,"准客户标记错误",response.body().asString()));
List<GrabWelfares>list=JsonUtil.parseResponseToListBean(response,GrabWelfares.class,"grabWelfares");
Boolean specifyAward =list.get(0).getSpecifyAward();
Assert.assertTrue(specifyAward,network.message(params, BasicConfig.MOBILE_getClueDetail, "指定中奖为null", response.body().asString()));
......@@ -264,8 +269,7 @@ public class LiveLater implements Authorization {
//需要校验返回结果
@Test(description="访客邀请列表",priority = 15)
public void
访客邀请列表() {
public void 访客邀请列表() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
// params.put("liveId","Kj21MzYyNjM");
......@@ -311,5 +315,16 @@ public class LiveLater implements Authorization {
}
@Test(description = "查看客户A跟进机会",priority = 18)
public void 查看客户A跟进机会(){
Map<String,Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("liveVisitorId",this.liveUserId.get(0).getLiveUserId());
params.put("pageIndex",1);
params.put("pageSize",5);
Response response = network.getResponse(params,BasicConfig.MOBILE_clueChanceList);
Object clueList = response.jsonPath().getJsonObject("data.list");
System.out.println(clueList);
Assert.assertNotNull(clueList,network.message(params,BasicConfig.MOBILE_clueChanceList,"跟进机会获取失败",response.body().asString()));
}
}
......@@ -12,7 +12,7 @@ public class BasicConfig {
public static String ADMIN_KEY="zFNkBc7JtvLPL6ifAfXbcgXf7k8AofD7jRHCDreREzhP8iW4bahfqRFePosTb9G6ESGPwScVFCQyuZBcc4brtRfaNz";
// 直播代理人 (艳玲)ID:826
public static String AUTH_KEY ="LEH7epeHVDJWzhZ6DiexTHnfZVkhkqorGGQahRCuzyKj3hQkSYMpkYma5RmZHQAbv8fiPzFX5BgoJgjF2gUVz175wz3dY";
// 直播代理人 (小疙瘩)ID:995
// 直播代理人 (小疙瘩)ID:995
public static String agentAuth ="LEH7epeHVDJWzhZ6DiexTHnsaP1faXTzcymSLsZVqAY5WqZQrdzjC38jMagiDc4FuL29DuBPCvuyHwDfmewFfwyW7rFLZ";
//直播访客 (志勇)ID:107
public static String visitorAuth="LEH7epeHVDJWzhZ6DiexTHnfZVkhkqorGGQahRL1y3zwSbNpp1aULAhVJCVAEKsjT2ZbJ5DZhH3ZjeaCEGLsecXdXZW6n";
......@@ -401,6 +401,7 @@ public class BasicConfig {
public static final String MOBILE_RewardAgentList = MOBILE_HOST + "/kjy/live/reward/agent/list";
public static final String MOBILE_signInfo= MOBILE_HOST + "/kjy/live/reward/agent/signInfo";
public static final String MOBILE_getDeliveryWay= MOBILE_HOST + "/kjy/live/getDeliveryWay";
public static final String MOBILE_clueChanceList = MOBILE_HOST + "/kjy/live/agent/clue/followChanceList";
public static final String MOBILE_Procurator = MOBILE_HOST + "/kjy/live/agent/liveList";
......
......@@ -46,7 +46,6 @@
<class name="com.kjj.cases.assistant.homePage.Upload"/>
</classes>
</test>
<test preserve-order="true" name = "获取访客">
<classes>
<class name="com.kjj.cases.assistant.whoSawMe.ForwardAndRead"/>
......
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