Commit 15bf46bd authored by 龚小红's avatar 龚小红

线索重构,删除客户列表和部分接口,替换部分接口

parent bf2d223d
......@@ -52,6 +52,8 @@ public class HomePage implements Authorization {
public String companyScId; //公司专区scid
private long forwardTime; //转发时间
private String clueId; //线索ID
private String reportId; //测评报告的contentId
private String reportScid; //测评报告的scid
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
......@@ -1328,4 +1330,67 @@ public class HomePage implements Authorization {
Assert.assertTrue(success, network.message(params, MANAGER_solutionPageList, "接口返回失败", response.body().asString()));
Assert.assertEquals(size,0, network.message(params, MANAGER_solutionPageList, "删除失败", response.body().asString()));
}
// 销售线索_测评报告领取线索
@Test(description = "销售线索_测评报告领取线索", priority = 64)
public void 销售线索_测评报告领取线索() throws IOException{
agentTku();
Map<String, Object> params = new HashMap<>();
params.put("pageSize", 20);
Response response = network.getResponse(params, BasicConfig.WHOSAWME_clueList);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(params, BasicConfig.WHOSAWME_clueList, "接口请求失败", response.body().asString()));
int clueBizType = response.jsonPath().getInt("data.list[0].clueInfoList[0].clueBizType");
Assert.assertEquals(clueBizType, 7, network.message(params, BasicConfig.WHOSAWME_clueList, "线索描述错误", response.body().asString()));
clueId = response.jsonPath().getString("data.list[0].clueInfoList[0].clueId");
}
// 销售线索_查看测评报告的领取详情
@Test(description = "销售线索_查看测评报告的领取详情", priority = 65)
public void 销售线索_查看测评报告的领取详情() throws IOException{
Map<String, Object> params = new HashMap<>();
params.put("clueId", clueId);
Response response = network.getResponse(params, BasicConfig.CLUEINFO);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(params, BasicConfig.CLUEINFO, "接口请求失败", response.body().asString()));
int clueBizType = response.jsonPath().getInt("data.clueBizType");
Assert.assertEquals(clueBizType, 7, network.message(params, BasicConfig.CLUEINFO, "线索类型错误", response.body().asString()));
reportId = response.jsonPath().getString("data.testContentId");
}
// 代理人_转发评测报告
@Test(description = "代理人_转发评测报告", priority = 66)
public void 代理人_转发评测报告() throws IOException{
Map<String, Object> params = new HashMap<>();
params.put("contentId",reportId);
Response response = network.getResponse(params,GETSCID);
reportScid = response.jsonPath().getString("data");
Assert.assertNotNull(reportScid, network.message(params,GETSCID,"获取sCid失败",response.body().asString()));
//查看线索客户信息
params.put("clueId",clueId);
response = network.getResponse(params,WHOSAWME_clientInfo);
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(params,WHOSAWME_clientInfo,"线索客户信息错误",response.body().asString()));
}
// 访客_咨询问题
@Test(description = "访客_咨询问题", priority = 67)
public void 访客_咨询问题() throws IOException{
userTku();
//获取问题按钮列表
Map<String, Object> params = new HashMap<>();
params.put("scene",1);
Response response = network.getResponse(params,GAME_button);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size, 4, network.message(params,GAME_button,"问题个数错误",response.body().asString()));
//点击问题
params.clear();
params.put("order",3);
params.put("scene",2);
params.put("scid",reportScid);
response = network.postResponse(params,GAME_consult);
String sCid = response.jsonPath().getString("data");
Assert.assertNotNull(reportScid, network.message(params,GAME_consult,"获取sCid失败",response.body().asString()));
}
}
......@@ -25,6 +25,7 @@ public class ForwardAndRead implements Authorization {
private static Response response;
private static Map<String, Object> param;
private String articleScId;
private Long userOneId;
private Long sellerId;
private String jjvisitId;
private long forwardTime;
......@@ -38,6 +39,7 @@ public class ForwardAndRead implements Authorization {
agent2Tku();
ssoLogin();
fromUserId = decodeTku(BasicConfig.AGENT_TKU).get("userId");
sellerId = decodeTku(BasicConfig.AGENT_TKU).get("sellerId");
}
// 获取二度访客起始线索数据
......@@ -96,11 +98,11 @@ public class ForwardAndRead implements Authorization {
@Test(description = "访客阅读文章", priority = 4)
public void 访客阅读文章() throws IOException{
sleep(1000);
sellerId = decodeTku(BasicConfig.AGENT2_TKU).get("sellerId");
userOneId = decodeTku(BasicConfig.AGENT2_TKU).get("userId");
agentTku();
param = new HashMap<>();
param.put("scid", articleScId);
param.put("fromUserId", sellerId);
param.put("fromUserId", userOneId);
param.put("visitPath", 0);
response = network.postResponse(param, BasicConfig.CONTENT_visit);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CONTENT_visit, "接口调用失败", response.body().asString()));
......@@ -236,20 +238,24 @@ public class ForwardAndRead implements Authorization {
Assert.assertEquals(data, "success", network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "领取资料失败", response.body().asString()));
}
@Test(description = "访客_访问文章并参与测评", priority = 60)
@Test(description = "访客_访问并参与测评", priority = 60)
public void 访客_访问文章并参与测评() {
//打开测评
//转发测评
agent2Tku();
String activityScid = getContentScId(encodingId(4700L)); // 获取文章scId
param.clear();
param.put("contentId",encodingId(4700L));
param.put("sid",encodingId((long) sellerId));
response = network.getResponse(param, GETSCID);
String activityScid = response.jsonPath().getString("data");
Assert.assertNotNull(activityScid,network.message(param, GETSCID,"获取scid失败",response.body().asString()));
param.put("scId", activityScid);
param.put("forwardType", 1);
response = network.getResponse(param, BasicConfig.FORWARD);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.FORWARD, "接口请求失败", response.body().asString()));
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.FORWARD, "转发素材失败", response.body().asString()));
userTku2(); // 切换二度访客
param.clear();
param.put("scid", activityScid);
param.put("fromUserId", fromUserId); //代理人的用户id
param.put("sourceScid", articleScId); //文章对应的Scid
param.put("fromUserId",encodingId(6491L)); //代理人的用户id
param.put("sourceScid", activityScid); //文章对应的Scid
param.put("visitPath", 1);
response = network.postResponse(param, CONTENT_visit);
String visitId = response.jsonPath().getString("data.userVisitId");
......@@ -263,23 +269,6 @@ public class ForwardAndRead implements Authorization {
param.put("sourceScId",articleScId);
param.put("visitExtra", "{\"食物\":\"爱吃垃圾食品\",\"喝酒\":\"爱喝酒\",\"睡觉\":\"习惯早睡\",\"早餐\":\"按时吃早饭\",\"心情\":\"心情烦闷\"}");
response = network. postResponse(param,GAME_sendInfo);
//申请领取报告
param.clear();
param.put("scid", activityScid);
param.put("completed",1);
param.put("sourceScId",articleScId);
param.put("originScId",articleScId);
param.put("riskTestOperateType",2);
param.put("sourceType","1");
param.put("visitId",visitId);
response = network. postResponse(param,GAME_sendInfoForRisk);
System.out.println(response.body().asString());
boolean success = response.jsonPath().getBoolean("success");
boolean result = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success, network.message(param, GAME_sendInfoForRisk, "接口返回失败", response.body().asString()));
Assert.assertTrue(result, network.message(param, GAME_sendInfoForRisk, "申请领取食谱失败", response.body().asString()));
}
@Test(description = "访客领取赠险", priority = 35)
......
......@@ -245,20 +245,20 @@ public class MyCustomer implements Authorization {
int visitCount = response.jsonPath().getInt("data.visitCount");
int grassNum = response.jsonPath().getInt("data.grassNum");
int datagramNum = response.jsonPath().getInt("data.datagramNum");
Assert.assertEquals(grassNum, ForwardAndRead.custClueStatistics.get("grassNum") + 2, network.message(param, BasicConfig.CLUESTATISTICS, "访客阅读种草文章记录次数未正确增加", response.body().asString()));
Assert.assertEquals(visitCount, ForwardAndRead.custClueStatistics.get("visitCount") + 1, network.message(param, BasicConfig.CLUESTATISTICS, "访客来访记录次数未正确增加", response.body().asString()));
Assert.assertEquals(grassNum, ForwardAndRead.custClueStatistics.get("grassNum") + 1, network.message(param, BasicConfig.CLUESTATISTICS, "访客阅读种草文章记录次数未正确增加", response.body().asString()));
Assert.assertEquals(visitCount, ForwardAndRead.custClueStatistics.get("visitCount") + 2, network.message(param, BasicConfig.CLUESTATISTICS, "访客来访记录次数未正确增加", response.body().asString()));
Assert.assertEquals(datagramNum, ForwardAndRead.custClueStatistics.get("datagramNum") + 1, network.message(param, BasicConfig.CLUESTATISTICS, "访客领取资料次数未正确增加", response.body().asString()));
}
//客户详情页_阅读偏好------访问重构未更新
@Test(description = "客户详情页_阅读偏好", priority = 22)
public void 客户详情页_阅读偏好() throws IOException{
param = new HashMap<>();
param.put("custUserId", visitor1UserId);
response = network.getResponse(param, BasicConfig.CUSTREADPERFERENCE);
List<Object> readPerferences = response.jsonPath().getList("data");
Assert.assertTrue(readPerferences.size() > 0, network.message(param, BasicConfig.CUSTREADPERFERENCE, "客户无阅读偏好", response.body().asString()));
}
// //客户详情页_阅读偏好------访问重构未更新
// @Test(description = "客户详情页_阅读偏好", priority = 22)
// public void 客户详情页_阅读偏好() throws IOException{
// param = new HashMap<>();
// param.put("custUserId", visitor1UserId);
// response = network.getResponse(param, BasicConfig.CUSTREADPERFERENCE);
// List<Object> readPerferences = response.jsonPath().getList("data");
// Assert.assertTrue(readPerferences.size() > 0, network.message(param, BasicConfig.CUSTREADPERFERENCE, "客户无阅读偏好", response.body().asString()));
// }
// 客户详情页_来访记录
@Test(description = "客户详情页_来访记录", priority = 23)
......@@ -278,6 +278,7 @@ public class MyCustomer implements Authorization {
String contentId = recordsOfContent.getContentId();
int clueType = recordsOfClue.getClueType();
Assert.assertEquals(contentId, BasicConfig.ARTICLE_CONTENTID, network.message(param ,BasicConfig.CUSTVISITLIST, "访问记录详情有误", response.body().asString()));
Assert.assertEquals(clueType, 3, network.message(param, BasicConfig.CUSTVISITLIST, "访问记录详情有误", response.body().asString()));
}
......
......@@ -131,7 +131,7 @@ public class MyForward implements Authorization {
Assert.assertEquals(contentId, ARTICLE_CONTENTID, network.message(param, FORWARD_LIST, "筛选结果contentId与预期不符", response.body().asString()));
}
// 获取访问次数最多的素材列表
// 获取访问次数最多的素材列表----访问重构
@Test(description = "转发素材列表_最多访问次数", priority = 7)
public void 转发素材列表_最多访问次数() throws IOException{
List<Object> contentTypes = Lists.newArrayList();
......@@ -238,7 +238,7 @@ public class MyForward implements Authorization {
Assert.assertEquals(encodeUserId, visitorEncodeUserId, network.message(param, FORWARD_VISITRECORD, "筛选结果首条记录userId与预期不符", response.body().asString()));
}
// 获取素材转发关系链
// 获取素材转发关系链----访问重构
@Test(description = "文章详情_访客记录_转发关系", priority = 14)
public void 文章详情_访客记录_转发关系() throws IOException{
param = new HashMap<>();
......
......@@ -29,8 +29,6 @@ public class WhoSawMe implements Authorization {
private long xxrUserId;
private Long jjSellerId;
private String tagId0;
private String reportId;
private String reportScid;
private String weeklyPublicationId;
private String scid; // 代理人周报scid
private String taskArticleContentId; // 任务素材contentId
......@@ -164,7 +162,7 @@ public class WhoSawMe implements Authorization {
String visitId = response.jsonPath().getString("data.list[0].customerInfo.customerUserId");
Assert.assertEquals(visitId, IdMakeUtil.encodingId(xxrUserId), network.message(param, BasicConfig.WHOSAWME_visitList, "最近访客微信用户ID不匹配", response.body().asString()));
clueId = response.jsonPath().getString("data.list[1].clueInfoList[1].clueId");
clueId = response.jsonPath().getString("data.list[0].clueInfoList[1].clueId");
}
// 将新用户标记为老用户(小葡萄)
......@@ -747,7 +745,7 @@ public class WhoSawMe implements Authorization {
param.put("pageIndex", 1);
param.put("sortType", 4);
response = network.getResponse(param, BasicConfig.MATERIALLIST);
String contentId = response.jsonPath().getString("data.list[0].contentId");
String contentId = response.jsonPath().getString("data.list[1].contentId");
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.MATERIALLIST, "接口请求失败", response.body().asString()));
Assert.assertEquals(contentId, BasicConfig.ARTICLE_CONTENTID, network.message(param, BasicConfig.MATERIALLIST, "首条转发文章contentId不符合预期", response.body().asString()));
}
......@@ -895,66 +893,4 @@ public class WhoSawMe implements Authorization {
Assert.assertEquals(remarkName, "备注", network.message(param, BasicConfig.GETCUSTAGANDMEMO, "用户备注错误", response.body().asString()));
Assert.assertTrue(tagIsMark, network.message(param, BasicConfig.GETCUSTAGANDMEMO, "用户标签错误", response.body().asString()));
}
// 销售线索_测评报告领取线索
@Test(description = "销售线索_测评报告领取线索", priority = 58)
public void 销售线索_测评报告领取线索() throws IOException{
agentTku();
param = new HashMap<>();
param.put("pageSize", 20);
response = network.getResponse(param, BasicConfig.WHOSAWME_clueList);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.WHOSAWME_clueList, "接口请求失败", response.body().asString()));
int clueBizType = response.jsonPath().getInt("data.list[1].clueInfoList[0].clueBizType");
Assert.assertEquals(clueBizType, 7, network.message(param, BasicConfig.WHOSAWME_clueList, "线索描述错误", response.body().asString()));
clueId = response.jsonPath().getString("data.list[1].clueInfoList[0].clueId");
}
// 销售线索_查看测评报告的领取详情
@Test(description = "销售线索_查看测评报告的领取详情", priority = 59)
public void 销售线索_查看测评报告的领取详情() throws IOException{
param = new HashMap<>();
param.put("clueId", clueId);
response = network.getResponse(param, BasicConfig.CLUEINFO);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CLUEINFO, "接口请求失败", response.body().asString()));
int clueBizType = response.jsonPath().getInt("data.clueBizType");
Assert.assertEquals(clueBizType, 7, network.message(param, BasicConfig.CLUEINFO, "线索类型错误", response.body().asString()));
reportId = response.jsonPath().getString("data.testContentId");
}
// 代理人_转发评测报告
@Test(description = "代理人_转发评测报告", priority = 60)
public void 代理人_转发评测报告() throws IOException{
param = new HashMap<>();
param.put("contentId",reportId);
response = network.getResponse(param,GETSCID);
reportScid = response.jsonPath().getString("data");
Assert.assertNotNull(reportScid, network.message(param,GETSCID,"获取sCid失败",response.body().asString()));
//查看线索客户信息
param.put("clueId",clueId);
Response response = network.getResponse(param,WHOSAWME_clientInfo);
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(param,WHOSAWME_clientInfo,"线索客户信息错误",response.body().asString()));
}
// 访客_咨询问题
@Test(description = "访客_咨询问题", priority = 61)
public void 访客_咨询问题() throws IOException{
userTku();
//获取问题按钮列表
param.put("scene",1);
Response response = network.getResponse(param,GAME_button);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size, 4, network.message(param,GAME_button,"问题个数错误",response.body().asString()));
//点击问题
param.clear();
param.put("order",3);
param.put("scene",2);
param.put("scid",reportScid);
response = network.postResponse(param,GAME_consult);
String sCid = response.jsonPath().getString("data");
Assert.assertNotNull(reportScid, network.message(param,GAME_consult,"获取sCid失败",response.body().asString()));
}
}
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