Commit 23dfc2d3 authored by xiamengchen's avatar xiamengchen

新增我的转发页面+我的客户页面cases

修改谁看过我页面cases
parent 6e40e65c
package com.kjj.bean.agent;
import lombok.Data;
@Data
public class CustOrigins {
private String avatar;
private String name;
private long UserId;
}
......@@ -15,6 +15,8 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import static com.kjj.config.BasicConfig.BOSS_EDITCONFIG;
// 谁看过我模块测试前执行一次代理人转发素材及访客访问和产生线索
public class ForwardAndRead implements Authorization {
......@@ -61,7 +63,7 @@ public class ForwardAndRead implements Authorization {
// 访客访问素材及产生线索
@Test(description = "访客阅读文章", priority = 3)
public void 访客阅读文章() throws IOException{
sellerId = getSellerId();
sellerId = (Long) getUserInfo(BasicConfig.AGENT_TKU).get("sellerId");
network.agentCookies.put("tku", BasicConfig.VISITOR_TKU);
param = new HashMap<>();
param.put("scid", articleScId);
......@@ -149,23 +151,18 @@ public class ForwardAndRead implements Authorization {
return contentScid;
}
// 获取代理人sellerId
public Long getSellerId(){
network.agentCookies.put("tku", BasicConfig.AGENT_TKU);
response = network.getResponse(BasicConfig.USER_INFO);
Long sellerId = response.jsonPath().getLong("data.sellerId");
Assert.assertNotNull(sellerId, network.message(BasicConfig.USER_INFO, "获取代理人sellerId失败", response.body().asString()));
return sellerId;
}
// 获取用户信息
public Map<String, Object> getUserInfo(String userTku){
network.agentCookies.put("tku", userTku);
response = network.getResponse(BasicConfig.USER_INFO);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(BasicConfig.USER_INFO, "接口调用失败", response.body().asString()));
String wxName = response.jsonPath().getString("data.wxName");
Long sellerId = response.jsonPath().getLong("data.sellerId");
Long userId = response.jsonPath().getLong("data.userId");
Map<String, Object> infos = new HashMap<>();
infos.put("wxName", wxName);
infos.put("sellerId", sellerId);
infos.put("userId", userId);
network.agentCookies.put("tku", BasicConfig.AGENT_TKU);
return infos;
}
......@@ -197,4 +194,15 @@ public class ForwardAndRead implements Authorization {
Assert.assertNotNull(idEncode, network.message(param, BasicConfig.MANAGER_ID_ENCODE, "加密sellerId失败", response.body().asString()));
return idEncode;
}
// 关闭数据看板演示数据
public void closeDemoData() throws IOException{
param = new HashMap<>();
param.put("configKey", "boss_board_demon_switch");
param.put("configValue", false);
response = network.postResponse(param, BOSS_EDITCONFIG);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BOSS_EDITCONFIG, "接口请求失败", response.body().asString()));
Assert.assertTrue(data, network.message(param, BOSS_EDITCONFIG, "关闭演示数据开关失败",response.body().asString()));
}
}
......@@ -84,7 +84,7 @@ public class CustomerInfo implements Authorization {
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTINFO, "接口请求失败", response.body().asString()));
Long sellerId = response.jsonPath().getLong("data.sellerId");
String custWxName = response.jsonPath().getString("data.custWxName");
Assert.assertEquals(sellerId, far.getSellerId(), network.message(param, BasicConfig.CUSTINFO, "客户代理人的sellerId不符合预期", response.body().asString()));
Assert.assertEquals(sellerId, far.decodeTku(BasicConfig.AGENT_TKU).get("sellerId"), network.message(param, BasicConfig.CUSTINFO, "客户代理人的sellerId不符合预期", response.body().asString()));
Assert.assertEquals(custWxName, visitorWxName, network.message(param, BasicConfig.CUSTINFO, "客户微信昵称与预期不符", response.body().asString()));
}
......
......@@ -31,15 +31,8 @@ public class MyForward implements Authorization {
agentTku();
far = new ForwardAndRead();
// 关闭数据看板演示数据
param = new HashMap<>();
param.put("configKey", "boss_board_demon_switch");
param.put("configValue", false);
response = network.postResponse(param, BOSS_EDITCONFIG);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BOSS_EDITCONFIG, "接口请求失败", response.body().asString()));
Assert.assertTrue(data, network.message(param, BOSS_EDITCONFIG, "关闭演示数据开关失败", response.body().asString()));
far.closeDemoData();
}
// 进入我的转发页面获取转发统计头部信息
......@@ -138,8 +131,8 @@ public class MyForward implements Authorization {
param.put("visitType", 2);
response = network.postResponse(param, BasicConfig.FORWARD_LIST);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.FORWARD_LIST, "接口调用失败", response.body().asString()));
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(param, BasicConfig.FORWARD_LIST, "返回响应为空", response.body().asString()));
String contentId = response.jsonPath().getString("data.list[0].contentVo.contentId");
Assert.assertEquals(contentId, ARTICLE_CONTENTID, network.message(param, FORWARD_LIST, "筛选结果contentId与预期不符", response.body().asString()));
}
// 获取访问次数最多的素材列表
......@@ -246,8 +239,8 @@ public class MyForward implements Authorization {
response = network.getResponse(param, BasicConfig.FORWARD_VISITRECORD);
System.out.println(response.body().asString());
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.FORWARD_VISITRECORD, "接口请求失败", response.body().asString()));
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(param, BasicConfig.FORWARD_VISITRECORD, "接口返回响应为空", response.body().asString()));
String encodeUserId = response.jsonPath().getString("data.list[0].userId");
Assert.assertEquals(encodeUserId, far.encodeId((Long) far.getUserInfo(VISITOR1_TKU).get("userId")), network.message(param, FORWARD_VISITRECORD, "筛选结果首条记录userId与预期不符", response.body().asString()));
}
// 获取素材转发关系链
......@@ -259,7 +252,5 @@ public class MyForward implements Authorization {
param.put("pageSize", 20);
response = network.getResponse(param, BasicConfig.INVITATIONCHAIN);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.INVITATIONCHAIN, "接口请求失败", response.body().asString()));
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(param, BasicConfig.INVITATIONCHAIN, "接口返回响应为空", response.body().asString()));
}
}
\ No newline at end of file
......@@ -31,15 +31,8 @@ public class WhoSawMe implements Authorization {
BaseUtils.ssoLogin();
far = new ForwardAndRead();
// 关闭数据看板演示数据
param = new HashMap<>();
param.put("configKey", "boss_board_demon_switch");
param.put("configValue", false);
response = network.postResponse(param, BOSS_EDITCONFIG);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BOSS_EDITCONFIG, "接口请求失败", response.body().asString()));
Assert.assertTrue(data, network.message(param, BOSS_EDITCONFIG, "关闭演示数据开关失败",response.body().asString()));
far.closeDemoData();
}
// 进入谁看过我主页
......@@ -87,7 +80,7 @@ public class WhoSawMe implements Authorization {
@Test(description = "首页_查询使用版本", priority = 4)
public void 查询代理人当前使用版本() throws IOException {
param = new HashMap<>();
String sellerIdEncode = far.encodeId(far.getSellerId());
String sellerIdEncode = far.encodeId((Long)far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("sellerId", sellerIdEncode);
response = network.getResponse(param, BasicConfig.USING_VERSION);
String userVersion = response.jsonPath().getString("data.userVersion");
......@@ -183,7 +176,7 @@ public class WhoSawMe implements Authorization {
// 获取我的上级名称
param.clear();
param.put("sellerId", far.getSellerId());
param.put("sellerId", far.getUserInfo(AGENT_TKU).get("sellerId"));
response = network.getResponse(param, BasicConfig.BOSS_BOSS);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(BasicConfig.BOSS_BOSS, "获取上级名称失败", response.body().asString()));
......@@ -203,7 +196,7 @@ public class WhoSawMe implements Authorization {
@Test(description = "其他代理人加入该代理人团队", priority = 15)
public void 邀请加入团队() throws IOException{
// 切换代理人加入团队
Long sellerId = far.getSellerId();
Long sellerId = (Long)far.getUserInfo(AGENT_TKU).get("sellerId");
network.agentCookies.put("tku", BasicConfig.VISITOR1_TKU);
// 确定被邀请代理人没有上级
......@@ -239,7 +232,7 @@ public class WhoSawMe implements Authorization {
public void 删除团队成员() throws IOException{
// 登陆管理后台调用管理后台接口删除成员
param = new HashMap<>();
param.put("superiorSid", far.getSellerId());
param.put("superiorSid", far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("childSid", childSellerId);
response = network.postResponse(param, BasicConfig.MANAGER_SELLERTEAM_REMOVEMEMBER);
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.MANAGER_SELLERTEAM_REMOVEMEMBER, "删除成员失败", response.body().asString()));
......@@ -257,7 +250,7 @@ public class WhoSawMe implements Authorization {
@Test(description = "查看今日转发素材列表", priority = 19)
public void 查看转发素材列表() throws IOException{
param = new HashMap<>();
param.put("sellerId", far.getSellerId());
param.put("sellerId", far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("pageSize", 20);
param.put("pageIndex", 1);
param.put("sortType", 4);
......@@ -271,7 +264,7 @@ public class WhoSawMe implements Authorization {
@Test(description = "查看转发名片记录列表", priority = 21)
public void 查看转发名片记录列表() throws IOException{
param = new HashMap<>();
param.put("sellerId", far.getSellerId());
param.put("sellerId", far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("pageSize", 20);
param.put("pageIndex", 1);
param.put("sortType", 4);
......@@ -299,7 +292,7 @@ public class WhoSawMe implements Authorization {
@Test(description = "查看使用工具记录列表", priority = 23)
public void 查看使用工具记录列表() throws IOException{
param = new HashMap<>();
param.put("sellerId", far.getSellerId());
param.put("sellerId", far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("pageSize", 20);
param.put("pageIndex", 1);
param.put("sortType", 4);
......@@ -313,7 +306,7 @@ public class WhoSawMe implements Authorization {
@Test(description = "查看获得线索记录列表", priority = 24)
public void 查看获得线索记录列表() throws IOException{
param = new HashMap<>();
param.put("sellerId", far.getSellerId());
param.put("sellerId", far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("pageSize", 20);
param.put("pageIndex", 1);
param.put("sortType", 4);
......@@ -328,7 +321,7 @@ public class WhoSawMe implements Authorization {
public void 查看转发动态访问列表() throws IOException{
// 获取首条素材列表中首条动态id
param = new HashMap<>();
param.put("sellerId", far.getSellerId());
param.put("sellerId", far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("pageSize", 20);
param.put("pageIndex", 1);
param.put("sortType", 4);
......
......@@ -724,6 +724,9 @@ public class BasicConfig {
public static final String ISDISPLAYSPECIAL = HOST + "/kjy/mp/whoSawMe/isDisplaySpecialCustomerLayer";
public static final String CONTENTVISITRECORD = HOST + "/kjy/mp/whoSawMe/contentVisitRecord";
public static final String INVITATIONCHAIN = HOST + "/kjy/mp/whoSawMe/forward/forwardList";
// *************** 标签管理 ***************
public static final String TAG_ADDORUPDATE = HOST + "/kjy/mp/sellerTag/addOrUpdateTag";
public static final String TAG_GETLIST = HOST + "kjy/mp/sellerTag/getTagList";
// *************** 文章 ***************
......
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