Commit 55679348 authored by xiamengchen's avatar xiamengchen

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

修改谁看过我页面cases
parent 23dfc2d3
...@@ -11,9 +11,11 @@ import io.restassured.response.Response; ...@@ -11,9 +11,11 @@ import io.restassured.response.Response;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.testng.collections.Lists;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.AccessibleObject; import java.lang.reflect.AccessibleObject;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -23,7 +25,8 @@ public class HomePage implements Authorization { ...@@ -23,7 +25,8 @@ public class HomePage implements Authorization {
private Response response; private Response response;
private Map<String, Object> param; private Map<String, Object> param;
private ForwardAndRead far; private ForwardAndRead far;
private Object createTagId; private String createTagId;
private long visitor1_UserId;
@BeforeClass @BeforeClass
public void setUp() throws IOException{ public void setUp() throws IOException{
...@@ -95,8 +98,24 @@ public class HomePage implements Authorization { ...@@ -95,8 +98,24 @@ public class HomePage implements Authorization {
Assert.assertEquals(newTagName, "新标签2", network.message(BasicConfig.TAG_GETLIST, "新增标签名称错误", response.body().asString())); Assert.assertEquals(newTagName, "新标签2", network.message(BasicConfig.TAG_GETLIST, "新增标签名称错误", response.body().asString()));
} }
// 标签管理_删除标签
@Test(description = "标签管理_删除标签", priority = 5)
public void 标签管理_删除标签() throws IOException{
// 删除标签
param = new HashMap<>();
List<String> ids = Lists.newArrayList();
ids.add(createTagId);
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 = network.getResponse(BasicConfig.TAG_GETLIST);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(BasicConfig.TAG_GETLIST, "接口请求失败", response.body().asString()));
}
// 我的客户首页_获取全部客户列表_最近访问 // 我的客户首页_获取全部客户列表_最近访问
@Test(description = "客户列表_最近访问", priority = 3) @Test(description = "客户列表_最近访问", priority = 6)
public void 客户列表_最近访问() throws IOException{ public void 客户列表_最近访问() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("pageIndex", 1); param.put("pageIndex", 1);
...@@ -109,7 +128,7 @@ public class HomePage implements Authorization { ...@@ -109,7 +128,7 @@ public class HomePage implements Authorization {
} }
// 我的客户首页_获取全部客户列表_按照访问次数排列 // 我的客户首页_获取全部客户列表_按照访问次数排列
@Test(description = "客户列表_访问次数", priority = 4) @Test(description = "客户列表_访问次数", priority = 7)
public void 客户列表_访问次数() throws IOException{ public void 客户列表_访问次数() throws IOException{
// 降序排列 // 降序排列
param = new HashMap<>(); param = new HashMap<>();
...@@ -143,7 +162,7 @@ public class HomePage implements Authorization { ...@@ -143,7 +162,7 @@ public class HomePage implements Authorization {
} }
// 我的客户首页_获取全部客户列表_按客户意向排列 // 我的客户首页_获取全部客户列表_按客户意向排列
@Test(description = "客户列表_客户意向", priority = 5) @Test(description = "客户列表_客户意向", priority = 8)
public void 客户列表_客户意向() throws IOException{ public void 客户列表_客户意向() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("pageIndex", 1); param.put("pageIndex", 1);
...@@ -161,7 +180,7 @@ public class HomePage implements Authorization { ...@@ -161,7 +180,7 @@ public class HomePage implements Authorization {
} }
//我的客户首页_获取客户列表_特别关注客户 //我的客户首页_获取客户列表_特别关注客户
@Test(description = "客户列表_特别关注", priority = 6) @Test(description = "客户列表_特别关注", priority = 9)
public void 客户列表_特别关注() throws IOException{ public void 客户列表_特别关注() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("isSpecialCustomer", 1); param.put("isSpecialCustomer", 1);
...@@ -175,7 +194,7 @@ public class HomePage implements Authorization { ...@@ -175,7 +194,7 @@ public class HomePage implements Authorization {
} }
// 我的客户首页_获取客户列表_筛选客户 // 我的客户首页_获取客户列表_筛选客户
@Test(description = "客户列表_七日活跃", priority = 7) @Test(description = "客户列表_七日活跃", priority = 10)
public void 客户列表_七日活跃() throws IOException{ public void 客户列表_七日活跃() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("activeType", 1); param.put("activeType", 1);
...@@ -189,7 +208,7 @@ public class HomePage implements Authorization { ...@@ -189,7 +208,7 @@ public class HomePage implements Authorization {
} }
// 我的客户首页_获取客户列表_筛选客户 // 我的客户首页_获取客户列表_筛选客户
@Test(description = "客户列表_直接转发", priority = 8) @Test(description = "客户列表_直接转发", priority = 11)
public void 客户列表_直接转发() throws IOException{ public void 客户列表_直接转发() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("custOrigin", 1); param.put("custOrigin", 1);
...@@ -203,7 +222,7 @@ public class HomePage implements Authorization { ...@@ -203,7 +222,7 @@ public class HomePage implements Authorization {
} }
// 我的客户首页_获取客户列表_筛选客户 // 我的客户首页_获取客户列表_筛选客户
@Test(description = "客户列表_好友转发", priority = 9) @Test(description = "客户列表_好友转发", priority = 12)
public void 客户列表_好友转发() throws IOException{ public void 客户列表_好友转发() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("custOrigin", 2); param.put("custOrigin", 2);
...@@ -212,12 +231,13 @@ public class HomePage implements Authorization { ...@@ -212,12 +231,13 @@ public class HomePage implements Authorization {
param.put("sortType", 3); param.put("sortType", 3);
response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH); response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString())); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString()));
System.out.println(response.body().asString());
Long custUserId = response.jsonPath().getLong("data.list[0].userId"); Long custUserId = response.jsonPath().getLong("data.list[0].userId");
Assert.assertEquals(custUserId, far.decodeTku(BasicConfig.VISITOR1_TKU).get("userId"), network.message(param, BasicConfig.CUSTOMERSEARCH, "好友转发的访客userId与预期不一致", response.body().asString())); Assert.assertEquals(custUserId, far.decodeTku(BasicConfig.VISITOR1_TKU).get("userId"), network.message(param, BasicConfig.CUSTOMERSEARCH, "通过好友转发的访客userId与预期不一致", response.body().asString()));
} }
// 我的客户首页_搜索客户 // 我的客户首页_搜索客户
@Test(description = "搜索客户", priority = 20) @Test(description = "搜索客户", priority = 13)
public void 客户列表_搜索客户() throws IOException{ public void 客户列表_搜索客户() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
// 获取用户微信昵称 // 获取用户微信昵称
...@@ -235,12 +255,14 @@ public class HomePage implements Authorization { ...@@ -235,12 +255,14 @@ public class HomePage implements Authorization {
} }
// 客户详情页_头部信息栏 // 客户详情页_头部信息栏
@Test(description = "客户详情页_头部信息栏", priority = 10) @Test(description = "客户详情页_头部信息栏", priority = 14)
public void 客户详情页_头部信息栏() throws IOException{ public void 客户详情页_头部信息栏() throws IOException{
visitor1_UserId = far.decodeTku(BasicConfig.VISITOR1_TKU).get("userId");
param = new HashMap<>(); param = new HashMap<>();
param.put("custUserId", far.decodeTku(BasicConfig.VISITOR1_TKU).get("userId")); param.put("custUserId", visitor1_UserId);
response = network.getResponse(param, BasicConfig.CUSTINFOHEADER); response = network.getResponse(param, BasicConfig.CUSTINFOHEADER);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTINFOHEADER, "接口请求失败", response.body().asString())); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTINFOHEADER, "接口请求失败", response.body().asString()));
System.out.println(response.body().asString());
List<CustOrigins> custOrigins = JsonUtil.parseResponseToPageBean(response, CustOrigins.class); List<CustOrigins> custOrigins = JsonUtil.parseResponseToPageBean(response, CustOrigins.class);
Assert.assertEquals(custOrigins.size(), 3, network.message(param, BasicConfig.CUSTINFOHEADER, "用户被邀链路长度不为3", response.body().asString())); Assert.assertEquals(custOrigins.size(), 3, network.message(param, BasicConfig.CUSTINFOHEADER, "用户被邀链路长度不为3", response.body().asString()));
Long selfUserId = custOrigins.get(2).getUserId(); Long selfUserId = custOrigins.get(2).getUserId();
...@@ -252,10 +274,10 @@ public class HomePage implements Authorization { ...@@ -252,10 +274,10 @@ public class HomePage implements Authorization {
} }
// 客户详情页_客户信息 // 客户详情页_客户信息
@Test(description = "客户详情页_客户信息", priority = 2) @Test(description = "客户详情页_客户信息", priority = 15)
public void 客户详情页_客户信息() throws IOException{ public void 客户详情页_客户信息() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("userId", far.decodeTku(BasicConfig.VISITOR1_TKU).get("userId")); param.put("userId", visitor1_UserId);
response = network.getResponse(param, BasicConfig.CUSTINFO); response = network.getResponse(param, BasicConfig.CUSTINFO);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTINFO, "接口请求失败", response.body().asString())); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTINFO, "接口请求失败", response.body().asString()));
List<CustOrigins> origins = JsonUtil.parseResponseToPageBean(response, CustOrigins.class); List<CustOrigins> origins = JsonUtil.parseResponseToPageBean(response, CustOrigins.class);
...@@ -268,10 +290,10 @@ public class HomePage implements Authorization { ...@@ -268,10 +290,10 @@ public class HomePage implements Authorization {
} }
// 客户详情页_意向详情 // 客户详情页_意向详情
@Test(description = "客户详情页_意向详情", priority = 3) @Test(description = "客户详情页_意向详情", priority = 16)
public void 客户详情页_意向详情() throws IOException{ public void 客户详情页_意向详情() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("userId", far.decodeTku(BasicConfig.VISITOR1_TKU).get("userId")); param.put("userId", visitor1_UserId);
response = network.getResponse(param, BasicConfig.CLUESTATISTICS); response = network.getResponse(param, BasicConfig.CLUESTATISTICS);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CLUESTATISTICS, "接口请求失败", response.body().asString())); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CLUESTATISTICS, "接口请求失败", response.body().asString()));
int drawPresentInsuranceCount = response.jsonPath().getInt("data.drawPresentInsuranceCount"); int drawPresentInsuranceCount = response.jsonPath().getInt("data.drawPresentInsuranceCount");
...@@ -279,13 +301,49 @@ public class HomePage implements Authorization { ...@@ -279,13 +301,49 @@ public class HomePage implements Authorization {
} }
// 客户详情页_人脉统计 // 客户详情页_人脉统计
@Test(description = "客户详情页_人脉统计", priority = 4) @Test(description = "客户详情页_人脉统计", priority = 17)
public void 客户详情页_人脉统计() throws IOException{ public void 客户详情页_人脉统计() throws IOException{
param = new HashMap<>(); param = new HashMap<>();
param.put("custUserId", far.decodeTku(BasicConfig.VISITOR1_TKU).get("userId")); param.put("custUserId", visitor1_UserId);
response = network.getResponse(param, BasicConfig.CUSTRELATION); response = network.getResponse(param, BasicConfig.CUSTRELATION);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTRELATION, "接口请求失败", response.body().asString())); Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTRELATION, "接口请求失败", response.body().asString()));
Integer num = response.jsonPath().getInt("data.hasNew"); Integer num = response.jsonPath().getInt("data.hasNew");
Assert.assertNotNull(num, network.message(param, BasicConfig.CUSTRELATION, "客户人脉统计数量为null", response.body().asString())); Assert.assertNotNull(num, network.message(param, BasicConfig.CUSTRELATION, "客户人脉统计数量为null", response.body().asString()));
} }
// 客户详情页_阅读偏好
@Test(description = "客户详情页_阅读偏好", priority = 18)
public void 客户详情页_阅读偏好() throws IOException{
param = new HashMap<>();
param.put("custUserId", visitor1_UserId);
response = network.getResponse(param, BasicConfig.CUSTREADPERFERENCE);
System.out.println(response.body().asString());
}
// 客户详情页_最近线索
@Test(description = "获取客户最近线索统计", priority = 19)
public void 获取客户最近线索统计() throws IOException{
param = new HashMap<>();
param.put("custUserId", visitor1_UserId);
param.put("type", 2);
response = network.getResponse(param, BasicConfig.CUSTSTATISTIC);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTSTATISTIC, "接口请求失败", response.body().asString()));
int welfareInsuranceNum = response.jsonPath().getInt("data.welfareInsuranceNum");
Assert.assertTrue(welfareInsuranceNum >= 1, network.message(param, BasicConfig.CLUESTATISTICS, "客户最近领取赠险次数小于1", response.body().asString()));
}
// 客户详情页_最近访问详情列表
@Test(description = "客户详情页_最近访问详情列表", priority = 20)
public void 客户详情页_最近访问详情列表() throws IOException{
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("custUserId", visitor1_UserId);
param.put("filterType", 1);
param.put("timeType", 2);
param.put("timeOrderType", 2);
response = network.getResponse(param, BasicConfig.CUSTVISITLIST);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTVISITLIST, "接口请求失败", response.body().asString()));
System.out.println(response.body().asString());
}
} }
...@@ -73,6 +73,8 @@ public class BasicConfig { ...@@ -73,6 +73,8 @@ public class BasicConfig {
public static String VISITOR_TKU = "T3gM31f18jCGvqvoyJRzyMTdpcPDJWUJJP4VQje7p9sfC4HKmj5NJfCUkxusAyFb5SpkWS31srDTYr6KtV"; public static String VISITOR_TKU = "T3gM31f18jCGvqvoyJRzyMTdpcPDJWUJJP4VQje7p9sfC4HKmj5NJfCUkxusAyFb5SpkWS31srDTYr6KtV";
// 基础线访客(小雪人) TKU // 基础线访客(小雪人) TKU
public static String VISITOR1_TKU = "T3gM31f18jCFXzk692pKjJCqJZdDv8Nb3htkzNk983cPMspUQD6pVEn2FNMefM2nieKPicXG9c1tDg8qtN"; public static String VISITOR1_TKU = "T3gM31f18jCFXzk692pKjJCqJZdDv8Nb3htkzNk983cPMspUQD6pVEn2FNMefM2nieKPicXG9c1tDg8qtN";
// 基础线访客(做二度访客) TKU
public static String VISITOR2_TKU = "";
// 访客的sids // 访客的sids
public static final String sids = "Kj21MjMwNTU"; public static final String sids = "Kj21MjMwNTU";
// 访客的userId(固定) // 访客的userId(固定)
...@@ -718,7 +720,7 @@ public class BasicConfig { ...@@ -718,7 +720,7 @@ public class BasicConfig {
public static final String CLUESTATISTICS = HOST + "/kjy/mp/whoSawMe/clue/statistics"; public static final String CLUESTATISTICS = HOST + "/kjy/mp/whoSawMe/clue/statistics";
public static final String CUSTRELATION = HOST + "/kjy/mp/seller/customer/relation"; public static final String CUSTRELATION = HOST + "/kjy/mp/seller/customer/relation";
public static final String CUSTOMERSTATISTICS = HOST + "/kjy/mp/whoSawMe/customerStatistics"; public static final String CUSTOMERSTATISTICS = HOST + "/kjy/mp/whoSawMe/customerStatistics";
public static final String CUSTREADPERFERENCE = HOST + "n/kjy/mp/seller/customer/getReadPerference"; public static final String CUSTREADPERFERENCE = HOST + "/kjy/mp/seller/customer/getReadPerference";
public static final String CUSTSTATISTIC = HOST + "/kjy/mp/whoSawMe/customerInfo/statistic"; public static final String CUSTSTATISTIC = HOST + "/kjy/mp/whoSawMe/customerInfo/statistic";
public static final String CUSTVISITLIST = HOST + "/kjy/mp/whoSawMe/customerInfo/list"; public static final String CUSTVISITLIST = HOST + "/kjy/mp/whoSawMe/customerInfo/list";
public static final String ISDISPLAYSPECIAL = HOST + "/kjy/mp/whoSawMe/isDisplaySpecialCustomerLayer"; public static final String ISDISPLAYSPECIAL = HOST + "/kjy/mp/whoSawMe/isDisplaySpecialCustomerLayer";
...@@ -726,7 +728,8 @@ public class BasicConfig { ...@@ -726,7 +728,8 @@ public class BasicConfig {
public static final String INVITATIONCHAIN = HOST + "/kjy/mp/whoSawMe/forward/forwardList"; 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_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";
public static final String TAG_DELETE = HOST + "/kjy/mp/sellerTag/deleteTag";
// *************** 文章 *************** // *************** 文章 ***************
......
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