Commit 3366d3d2 authored by 张艳玲's avatar 张艳玲

Merge branch 'feature/20210805-xmc' into 'master'

更新谁看过我

See merge request test-group/kejiji!93
parents 29455e09 34f6ad96
package com.kjj.bean.whoSawMe;
import lombok.Data;
@Data
public class MyTaskList {
private int taskId;
private String contentId;
private int taskStatus;
}
package com.kjj.bean.whoSawMe;
import lombok.Data;
@Data
public class TeamTaskList {
private String contentId;
private int id;
private int taskAchieverNum;
private int taskStatus;
private int taskTargetNum;
}
package com.kjj.bean.whoSawMe;
import lombok.Data;
import java.util.List;
@Data
public class WeeklyList {
private String yearMonth;
private List<weeklyPublication> weeklyPublications;
@Data
public static class weeklyPublication{
private String endDate;
private int freshVisitorNum;
private String id;
private int keyCluesNum;
private boolean newWeekly;
private String startDate;
private int totalShareNum;
private int totalVisitorNum;
}
}
...@@ -3,6 +3,7 @@ package com.kjj.cases.assistant.whoSawMe; ...@@ -3,6 +3,7 @@ package com.kjj.cases.assistant.whoSawMe;
import com.kjj.cases.admin.Authorization; 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 com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response; import io.restassured.response.Response;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
...@@ -19,9 +20,9 @@ public class ForwardAndRead implements Authorization { ...@@ -19,9 +20,9 @@ public class ForwardAndRead implements Authorization {
private Map<String, Object> param; private Map<String, Object> param;
private String articleScId; private String articleScId;
private Long sellerId; private Long sellerId;
private String visitId; private String jjvisitId;
private String insuranceId; private String insuranceId;
private String forwardTime; private long forwardTime;
@BeforeClass @BeforeClass
public void setUp() throws IOException{ public void setUp() throws IOException{
...@@ -32,6 +33,10 @@ public class ForwardAndRead implements Authorization { ...@@ -32,6 +33,10 @@ public class ForwardAndRead implements Authorization {
// 代理人转发素材 // 代理人转发素材
@Test(description = "代理人转发文章", priority = 1) @Test(description = "代理人转发文章", priority = 1)
public void 转发文章() throws IOException{ public void 转发文章() throws IOException{
// 转发文章前记录一个时间
forwardTime = new Date().getTime();
ThreadSleepUtils.sleep(5000);
articleScId = getContentScId(BasicConfig.ARTICLE_CONTENTID); // 获取文章scId articleScId = getContentScId(BasicConfig.ARTICLE_CONTENTID); // 获取文章scId
param = new HashMap<>(); param = new HashMap<>();
param.put("scId", articleScId); param.put("scId", articleScId);
...@@ -41,7 +46,6 @@ public class ForwardAndRead implements Authorization { ...@@ -41,7 +46,6 @@ public class ForwardAndRead implements Authorization {
boolean data = response.jsonPath().getBoolean("data"); boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.FORWARD, "转发素材失败", response.body().asString())); Assert.assertTrue(data, network.message(param, BasicConfig.FORWARD, "转发素材失败", response.body().asString()));
forwardTime = response.jsonPath().getString("timestamp");
} }
@Test(description = "代理人转发名片", priority = 2) @Test(description = "代理人转发名片", priority = 2)
...@@ -70,8 +74,8 @@ public class ForwardAndRead implements Authorization { ...@@ -70,8 +74,8 @@ public class ForwardAndRead implements Authorization {
param.put("visitPath", 0); param.put("visitPath", 0);
response = network.getResponse(param, BasicConfig.CONTENT_READ); response = network.getResponse(param, BasicConfig.CONTENT_READ);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CONTENT_READ, "接口调用失败", response.body().asString())); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CONTENT_READ, "接口调用失败", response.body().asString()));
visitId = response.jsonPath().getString("data.visitId"); jjvisitId = response.jsonPath().getString("data.visitId");
Assert.assertNotNull(visitId, network.message(param, BasicConfig.CONTENT_READ, "visitId为空", response.body().asString())); Assert.assertNotNull(jjvisitId, network.message(param, BasicConfig.CONTENT_READ, "visitId为空", response.body().asString()));
} }
@Test(description = "访客领取赠险", priority = 4) @Test(description = "访客领取赠险", priority = 4)
...@@ -101,7 +105,7 @@ public class ForwardAndRead implements Authorization { ...@@ -101,7 +105,7 @@ public class ForwardAndRead implements Authorization {
public void 访客转发文章() throws IOException{ public void 访客转发文章() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("scId", articleScId); param.put("scId", articleScId);
param.put("visitId", visitId); param.put("visitId", jjvisitId);
param.put("forwardType", 1); param.put("forwardType", 1);
response = network.getResponse(param, BasicConfig.FORWARD); 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("success"), network.message(param, BasicConfig.FORWARD, "接口调用失败", response.body().asString()));
...@@ -109,8 +113,42 @@ public class ForwardAndRead implements Authorization { ...@@ -109,8 +113,42 @@ public class ForwardAndRead implements Authorization {
Assert.assertTrue(data, network.message(param, BasicConfig.FORWARD, "访客转发素材失败", response.body().asString())); Assert.assertTrue(data, network.message(param, BasicConfig.FORWARD, "访客转发素材失败", response.body().asString()));
} }
@Test(description = "二度访客阅读文章", priority = 6) // 获取新用户
@Test(description = "新用户访问", priority = 6)
public void 新用户访问() throws IOException{
ThreadSleepUtils.sleep(5000);
network.agentCookies.put("tku", BaseUtils.tku);
response = network.getResponse(BasicConfig.USER_INFO);
System.out.println(response.body().asString());
param.clear();
param.put("scid", articleScId);
param.put("fromUserId", sellerId);
param.put("cancelPush", false);
param.put("visitPath", 0);
response = network.getResponse(param, BasicConfig.CONTENT_READ);
System.out.println(response.body().asString());
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CONTENT_READ, "接口调用失败", response.body().asString()));
}
// 新用户领取赠险
@Test(description = "新用户领取赠险", priority = 7)
public void 新用户领取赠险() throws IOException{
param.clear();
param.put("clueTypeName", "WELFARE_INSURANCE");
param.put("insuranceId", insuranceId);
param.put("locationSource", 1);
param.put("scId", articleScId);
param.put("sourceId", articleScId);
param.put("sourceType", 1);
response = network.postResponse(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN);
System.out.println(response.body().asString());
String data = response.jsonPath().getString("data");
Assert.assertEquals(data, "success", network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "领取赠险失败", response.body().asString()));
}
@Test(description = "二度访客阅读文章", priority = 8)
public void 二度访客阅读文章() throws IOException{ public void 二度访客阅读文章() throws IOException{
ThreadSleepUtils.sleep(5000);
Long fromUserId = decodeTku(BasicConfig.AGENT_TKU).get("sellerId"); Long fromUserId = decodeTku(BasicConfig.AGENT_TKU).get("sellerId");
network.agentCookies.put("tku", BasicConfig.VISITOR1_TKU); // 切换二度访客 network.agentCookies.put("tku", BasicConfig.VISITOR1_TKU); // 切换二度访客
param = new HashMap<>(); param = new HashMap<>();
...@@ -122,7 +160,16 @@ public class ForwardAndRead implements Authorization { ...@@ -122,7 +160,16 @@ public class ForwardAndRead implements Authorization {
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CONTENT_READ, "接口调用失败", response.body().asString())); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CONTENT_READ, "接口调用失败", response.body().asString()));
} }
@Test(description = "二度访客领取赠险", priority = 7) @Test(description = "添加访问记录", priority = 9)
public void 添加访问记录() throws IOException{
param.clear();
param.put("forwardTime", forwardTime); // 添加访问记录的时间要小于代理人转发时间
param.put("scid", articleScId);
response = network.postResponse(param, BasicConfig.DYNAMIC_ADDVISIT);
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.DYNAMIC_ADDVISIT, "添加访问记录失败", response.body().asString()));
}
@Test(description = "二度访客领取赠险", priority = 10)
public void 二度访客领取赠险() throws IOException{ public void 二度访客领取赠险() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("clueTypeName", "WELFARE_INSURANCE"); param.put("clueTypeName", "WELFARE_INSURANCE");
...@@ -135,9 +182,26 @@ public class ForwardAndRead implements Authorization { ...@@ -135,9 +182,26 @@ public class ForwardAndRead implements Authorization {
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "接口调用失败", response.body().asString())); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "接口调用失败", response.body().asString()));
String data = response.jsonPath().getString("data"); String data = response.jsonPath().getString("data");
Assert.assertEquals(data, "success", network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "领取赠险失败", response.body().asString())); Assert.assertEquals(data, "success", network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "领取赠险失败", response.body().asString()));
}
@Test(description = "获取文章FAQs", priority = 11)
public void 获取文章FAQs() throws IOException{
param.clear();
param.put("scid", articleScId);
param.put("recommend", 1);
param.put("pageIndex", 1);
param.put("pageSize", 2);
response = network.getResponse(param, BasicConfig.ARTICLE_ENHANCEDCOLUMN_GETFAQS);
int totalCount = response.jsonPath().getInt("data.totalCount");
List<Object> lists = response.jsonPath().getList("data.list");
Assert.assertEquals(totalCount, lists.size(), network.message(param, BasicConfig.ARTICLE_ENHANCEDCOLUMN_GETFAQS, "FAQ总数与FAQ列表大小不一致", response.body().asString()));
} }
// @Test(description = "二度访客点击FAQ", priority = 12)
// public void 二度访客点击FAQ() throws IOException{
//
// }
// 通过素材contentId获取线索员文章scId // 通过素材contentId获取线索员文章scId
public String getContentScId(String contentId){ public String getContentScId(String contentId){
param = new HashMap<>(); param = new HashMap<>();
......
...@@ -735,6 +735,15 @@ public class BasicConfig { ...@@ -735,6 +735,15 @@ public class BasicConfig {
public static final String CLUEINFO = HOST + "/kjy/mp/whoSawMe/clue/info"; public static final String CLUEINFO = HOST + "/kjy/mp/whoSawMe/clue/info";
public static final String CLUEADVISE = HOST + "/kjy/mp/whoSawMe/clue/info/advise"; public static final String CLUEADVISE = HOST + "/kjy/mp/whoSawMe/clue/info/advise";
// *************** 运营周报 ***************
public static final String WEEKLY_INDEXINFO = HOST + "/kjy/mp/weekly/getWeeklyIndexInfo";
public static final String WEEKLY_CONTENTSTATS = HOST + "/kjy/mp/weekly/getSellerContentStatsInfo";
public static final String WEEKLY_CARDSTATS = HOST + "/kjy/mp/weekly/getSellerCardStatsInfo";
public static final String WEEKLY_CUSTOMERSTATS = HOST + "/kjy/mp/weekly/getSellerWeeklyCustomerStatsInfo";
public static final String WEEKLY_CLUESTATS = HOST + "/kjy/mp/weekly/getSellerWeeklyClueStatsInfo";
public static final String WEEKLY_DATESTATS = HOST + "/kjy/mp/weekly/getSellerWeeklyDateStatsInfo";
public static final String WEEKLY_POSTERINFO = HOST + "/kjy/mp/weekly/getSellerWeeklyPosterInfo";
// *************** 客户信息 *************** // *************** 客户信息 ***************
public static final String CUSTINFOHEADER = HOST + "/kjy/mp/whoSawMe/custInfoHeader"; public static final String CUSTINFOHEADER = HOST + "/kjy/mp/whoSawMe/custInfoHeader";
public static final String CUSTINFO = HOST + "/kjy/mp/seller/v2/custInfo"; public static final String CUSTINFO = HOST + "/kjy/mp/seller/v2/custInfo";
...@@ -767,6 +776,7 @@ public class BasicConfig { ...@@ -767,6 +776,7 @@ public class BasicConfig {
public static final String RELATIONINFO_LIST = HOST + "/kjy/mp/seller/customer/getRelationInfoList"; public static final String RELATIONINFO_LIST = HOST + "/kjy/mp/seller/customer/getRelationInfoList";
public static final String RELATIONINFO_RANKING = HOST + "/kjy/mp/seller/customer/relation/ranking"; public static final String RELATIONINFO_RANKING = HOST + "/kjy/mp/seller/customer/relation/ranking";
public static final String UPDATECUSTMATERIAL = HOST + "/kjy/mp/seller/v2/customer/material/saveOrUpdate"; public static final String UPDATECUSTMATERIAL = HOST + "/kjy/mp/seller/v2/customer/material/saveOrUpdate";
public static final String UPDATENEWTOOLD = HOST + "/kjy/mp/whoSawMe/updateNewCustomerToOld";
// *************** 标签管理 *************** // *************** 标签管理 ***************
public static final String TAG_ADDORUPDATE = HOST + "/kjy/mp/sellerTag/addOrUpdateTag"; public static final String TAG_ADDORUPDATE = HOST + "/kjy/mp/sellerTag/addOrUpdateTag";
public static final String TAG_GETLIST = HOST + "/kjy/mp/sellerTag/getTagList"; public static final String TAG_GETLIST = HOST + "/kjy/mp/sellerTag/getTagList";
...@@ -776,6 +786,9 @@ public class BasicConfig { ...@@ -776,6 +786,9 @@ public class BasicConfig {
public static final String CHAT_LIST = HOST + "/kjy/mp/chat/list"; public static final String CHAT_LIST = HOST + "/kjy/mp/chat/list";
public static final String CHAT_GETSUBSCRIBESTATUS = HOST + "/kjy/mp/chat/getSubscribeStatus"; public static final String CHAT_GETSUBSCRIBESTATUS = HOST + "/kjy/mp/chat/getSubscribeStatus";
public static final String CHAT_LINKMANLIST = HOST + "/kjy/mp/chat/sellerLinkmanList"; public static final String CHAT_LINKMANLIST = HOST + "/kjy/mp/chat/sellerLinkmanList";
public static final String CHAT_COUNTHISTORY = HOST + "/kjy/mp/chat/countHistory";
public static final String CHAT_READED = HOST + "/kjy/mp/chat/readed";
public static final String CHAT_NEW = HOST + "/kjy/mp/chat/new";
// *************** 文章 *************** // *************** 文章 ***************
...@@ -877,6 +890,9 @@ public class BasicConfig { ...@@ -877,6 +890,9 @@ public class BasicConfig {
public static final String TEAMDATA = HOST + "/kjy/mp/seller/team/data"; public static final String TEAMDATA = HOST + "/kjy/mp/seller/team/data";
public static final String TEAMMEMBERNUM = HOST + "/kjy/mp/seller/team/memberNumber"; public static final String TEAMMEMBERNUM = HOST + "/kjy/mp/seller/team/memberNumber";
public static final String TEAMRANKINGLIST = HOST + "/kjy/mp/seller/team/rankingList"; public static final String TEAMRANKINGLIST = HOST + "/kjy/mp/seller/team/rankingList";
public static final String HASNEWTASK = HOST + "/kjy/mp/seller/team/task/hasNewTask";
public static final String MYTASKHEADER = HOST + "/kjy/mp/seller/team/task/myTaskHeader";
public static final String MYTASKLIST = HOST + "/kjy/mp/seller/team/task/myTaskList";
// 团队管理 // 团队管理
public static final String FINDPAGEBYCONTENTTYPE = HOST + "/kjy/mp/exclusiveItem/findPageByContentType"; public static final String FINDPAGEBYCONTENTTYPE = HOST + "/kjy/mp/exclusiveItem/findPageByContentType";
public static final String TEAMMEMBER = HOST + "/kjy/mp/seller/team/member"; public static final String TEAMMEMBER = HOST + "/kjy/mp/seller/team/member";
......
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