Commit 6683a357 authored by 龚小红's avatar 龚小红

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

# Conflicts:
#	src/test/java/com/kjj/config/BasicConfig.java
#	src/test/wechatTestNG.xml
parents 343521e0 16e37d73
package com.kjj.bean.whoSawMe;
import lombok.Data;
@Data
public class ArticlePage {
private String contentType;
private String contentId;
}
package com.kjj.bean.whoSawMe;
import lombok.Data;
@Data
public class ChatList {
private int chatContentType;
private String content;
private long id;
private boolean mine;
private int readFlag;
private Long receiverId;
private Long senderId;
}
package com.kjj.bean.whoSawMe;
import lombok.Data;
@Data
public class CustFavorite {
private String contentId;
private String userActionTypeEnum;
}
package com.kjj.bean.whoSawMe;
import lombok.Data;
import java.util.List;
import java.util.Map;
@Data
public class LinkList {
private Map<String, Object> session;
}
package com.kjj.bean.whoSawMe;
import lombok.Data;
@Data
public class RankingList {
private String sellerId;
}
package com.kjj.bean.whoSawMe;
import lombok.Data;
@Data
public class RemindInfo {
private String id;
private String remindContent;
private int remindStatus;
private Long remindTime;
}
package com.kjj.bean.whoSawMe;
import lombok.Data;
import java.util.List;
@Data
public class VisitRecords {
private List<recordsList> records;
@Data
public static class recordsList{
private String clueId;
private int clueType;
private String contentId;
private String contentType;
private String scid;
}
}
......@@ -20,25 +20,30 @@ public interface Authorization {
System.out.println("用户AUTH_KEY:"+ADMIN_KEY);
}
/**
* 集客助手相关授权
*/
//代理人
//代理人吉吉 sid:2991
default void agentTku() {
network.agentCookies.put("tku", AGENT_TKU);
System.out.println("代理人tku:" + AGENT_TKU);
}
// 获取访客tku:Su Yi
//代理人
default void visitor2Tku() {
network.agentCookies.put("tku", VISITOR2_TKU);
System.out.println("代理人tku:" + VISITOR2_TKU);
}
// 获取访客tku:Su Yi
default void userTku() {
network.agentCookies.put("tku", VISITOR_UserTku);
System.out.println("访客tku:" + VISITOR_UserTku);
}
// 获取访客tku:请勿打扰
default void userTku1() {
network.agentCookies.put("tku", VISITOR_TKU);
......@@ -52,14 +57,6 @@ public interface Authorization {
}
// // 获取访客tku
// default void userTkuw() {
// AGENT_TKU = BaseUtils.createTku();
// VISITOR_TKU = BaseUtils.getTku(VISITOR_USERID);
// network.agentCookies.put("tku", VISITOR_TKU);
// System.out.println("访客tku:" + VISITOR_TKU);
// }
/**
* 直播业务相关
......@@ -158,7 +155,7 @@ public interface Authorization {
System.out.println("用户AUTH_KEY:" + visitorAuth13);
}
//访客N(光头强)非实名用户授权,ID:540
//访客N(光头强)非实名用户授权,ID:1495
default void visitorAuth14() {
network.agentCookies.put("authKey", visitorAuth14);
System.out.println("用户AUTH_KEY:" + visitorAuth14);
......
package com.kjj.cases.assistant;
package com.kjj.cases.assistant.homePage;
import static com.kjj.config.BasicConfig.*;
......
package com.kjj.cases.assistant;
package com.kjj.cases.assistant.homePage;
import static com.kjj.config.BasicConfig.*;
import com.kjj.cases.admin.Authorization;
......@@ -12,7 +12,7 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class homePage implements Authorization {
public class HomePage implements Authorization {
public int firstTagId; //获取种草素材标签ID
public String contentId; //获取素材文章id
public String tagId; //获取发圈素材标签ID
......@@ -20,11 +20,14 @@ public class homePage implements Authorization {
public int hotTagId; //获取热榜标签ID
public int posterTagId; //获取海报标签ID
public String posterContentId; //获取海报的的contentId
public int caseId; //获取成功案例id
@BeforeClass
public void setUp() {
agentTku();
userTku();
//管理后台登录
BaseUtils.ssoLogin();
}
//获取种草素材列表页
......@@ -217,4 +220,102 @@ public class homePage implements Authorization {
Object obj = response.jsonPath().getJsonObject("data.list");
Assert.assertNotNull(obj, network.message(params,HOME_getContentList,"获取首页视频列表失败",response.body().asString()));
}
//获取首页公司专区
@Test(description = "首页_公司专区列表",priority = 15)
public void 首页_公司专区列表(){
Response response = network.getResponse(HOME_getExclusiveArea);
String desc = response.jsonPath().getString("desc");
Assert.assertEquals(desc,"OK",network.message(HOME_getExclusiveArea,"获取公司专区列表失败",response.body().asString()));
}
//管理后台新增成功案例
@Test(description = "管理后台_新增成功案例",priority = 15)
public void 新增成功案例(){
//根据内容ID匹配内容标题
Map<String,Object> params = new HashMap<>();
params.put("itemId",9398);
Response response = network.getResponse(params,MANAGER_getPushContent);
String desc = response.jsonPath().getString("desc");
boolean success = response.jsonPath().getBoolean("success");
Assert.assertEquals(desc,"OK", network.message(params,MANAGER_getPushContent,"内容ID匹配内容标题失败",response.body().asString()));
Assert.assertTrue(success, network.message(params,MANAGER_getPushContent,"内容ID匹配内容标题请求失败",response.body().asString()));
//新增成功案例
Map<String,Object> addParams = new HashMap<>();
addParams.put("beltImg","//yun.dui88.com/kjy/image/20210727/1627369041241.jpeg");
addParams.put("blockImg","//yun.dui88.com/kjy/image/20210727/1627369049937.jpeg");
addParams.put("contentId",9398);
addParams.put("layerImg","//yun.dui88.com/kjy/image/20210727/1627369034207.jpg");
addParams.put("thumbnailImg","//yun.dui88.com/kjy/image/20210727/1627369057234.jpeg");
long timeOpening = System.currentTimeMillis();
addParams.put("timeOpening",timeOpening);
Response addRes = network.postResponse(addParams,MANAGER_addOrUpdateCases);
String addDesc = addRes.jsonPath().getString("desc");
boolean addSuccess = addRes.jsonPath().getBoolean("success");
Assert.assertEquals(addDesc,"OK", network.message(addParams,MANAGER_addOrUpdateCases,"新增成功案例失败",addRes.body().asString()));
Assert.assertTrue(addSuccess, network.message(addParams,MANAGER_addOrUpdateCases,"新增成功案例失败",addRes.body().asString()));
}
@Test(description = "管理后台_获取成功案例列表",priority = 16)
public void 获取成功案例列表(){
Response response = network.getResponse(MANAGER_caseList);
Object list = response.jsonPath().getJsonObject("data.list");
caseId = response.jsonPath().getInt("data.list.get(0).id");
Assert.assertNotNull(list,network.message(MANAGER_caseList,"获取成功案例列表失败",response.body().asString()));
}
@Test(description = "管理后台_获取案例详情",priority = 17)
public void 获取案例详情(){
Map<String,Object> params = new HashMap<>();
params.put("id",caseId);
Response response = network.getResponse(params,MANAGER_successCaseDetail);
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data,network.message(params,MANAGER_successCaseDetail,"获取案例详情失败",response.body().asString()));
}
@Test(description = "管理后台_编辑案例",priority = 18)
public void 编辑案例(){
//编辑成功案例
Map<String,Object> params = new HashMap<>();
params.put("beltImg","//yun.dui88.com/kjy/image/20210727/1627369041241.jpeg");
params.put("blockImg","//yun.dui88.com/kjy/image/20210727/1627369049937.jpeg");
params.put("contentId",9398);
params.put("id",caseId);
params.put("layerImg","//yun.dui88.com/kjy/image/20210727/1627369034207.jpg");
params.put("thumbnailImg","//yun.dui88.com/kjy/image/20210727/1627369057234.jpeg");
long timeOpening = System.currentTimeMillis();
params.put("timeOpening",timeOpening);
Response addRes = network.postResponse(params,MANAGER_addOrUpdateCases);
String addDesc = addRes.jsonPath().getString("desc");
boolean addSuccess = addRes.jsonPath().getBoolean("success");
Assert.assertEquals(addDesc,"OK", network.message(params,MANAGER_addOrUpdateCases,"编辑成功案例失败",addRes.body().asString()));
Assert.assertTrue(addSuccess, network.message(params,MANAGER_addOrUpdateCases,"编辑成功案例失败",addRes.body().asString()));
}
@Test(description = "管理后台_上架/下架成功案例",priority = 19)
public void 上架成功案例(){
//上架成功案例 status = 2
Map<String,Object> params = new HashMap<>();
params.put("id",caseId);
params.put("status",2);
Response response = network.postResponse(params,MANAGER_updateStatus);
boolean data = response.jsonPath().getBoolean("data");
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(data,network.message(params,MANAGER_updateStatus,"上架成功案例失败",response.body().asString()));
Assert.assertTrue(success,network.message(params,MANAGER_updateStatus,"上架成功案例失败",response.body().asString()));
//下架成功案例 status = 1
Map<String,Object> updateParams = new HashMap<>();
updateParams.put("id",caseId);
updateParams.put("status",1);
Response updateRes = network.postResponse(params,MANAGER_updateStatus);
boolean updateData = updateRes.jsonPath().getBoolean("data");
boolean updateSuccess = updateRes.jsonPath().getBoolean("success");
Assert.assertTrue(updateData,network.message(params,MANAGER_updateStatus,"下架成功案例失败",updateRes.body().asString()));
Assert.assertTrue(updateSuccess,network.message(params,MANAGER_updateStatus,"下架成功案例失败",updateRes.body().asString()));
}
}
package com.kjj.cases.assistant;
package com.kjj.cases.assistant.homePage;
import static com.kjj.config.BasicConfig.*;
......
package com.kjj.cases.basics;
package com.kjj.cases.assistant.homePage;
import static com.kjj.config.BasicConfig.*;
import com.kjj.utils.NetworkUtils;
import com.kjj.cases.admin.Authorization;
import com.kjj.utils.BaseUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.*;
......@@ -12,12 +14,15 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class Upload {
private static final NetworkUtils network = NetworkUtils.getInstance();
public class Upload implements Authorization {
@BeforeClass
public void setUp() {
System.out.println();
// System.out.println();
agentTku();
// userTku();
//管理后台登录
BaseUtils.ssoLogin();
}
// @Test(description="会员判断",priority = 1)
......@@ -27,7 +32,44 @@ public class Upload {
// Assert.assertTrue(true, network.message(ISVIPSUBSCRIBE,"会员判断错误",response.body().asString()));
// }
@Test(description = "上传_文章链接",priority = 2)
@Test(description = "获取首页上传链接配置",priority = 1)
public void 上传链接配置(){
Map<String,Object> params = new HashMap<>();
params.put("type",1);
Response response = network.getResponse(params,Daily_getHomeConf);
Object resourceLocatorName = response.jsonPath().getJsonObject("data.get(4).resourceLocatorName");
Assert.assertEquals(resourceLocatorName,"上传链接", network.message(params,Daily_getHomeConf,"获取上传链接配置失败",response.body().asString()));
}
@Test(description = "爬虫支持的域名",priority = 2)
public void 爬虫支持的域名(){
Response response = network.getResponse(UPLOAD_supportDomain);
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(UPLOAD_supportDomain,"获取域名列表失败",response.body().asString()));
}
@Test(description = "判断是否第一次访问",priority = 3)
public void 判断是否第一次访问(){
Map<String,Object> params = new HashMap<>();
params.put("type",8);
Response response = network.getResponse(params,UPLOAD_sellerFirstVisit);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params,UPLOAD_sellerFirstVisit,"判断是否第一次访问失败",response.body().asString()));
}
@Test(description = "上传_查看tips",priority = 4)
public void 查看tips(){
Map<String,Object> params = new HashMap<>();
params.put("page","upload_link");
long timestamp = System.currentTimeMillis();
params.put("timestamp",timestamp);
Response response = network.getResponse(params,UPLOAD_getTipsByPage);
boolean isShowTips = response.jsonPath().getBoolean("data.isShowTips");
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(isShowTips, network.message(params,UPLOAD_getTipsByPage,"tips展示成功",response.body().asString()));
Assert.assertTrue(success,network.message(params,UPLOAD_getTipsByPage,"查看tips请求失败",response.body().asString()));
}
@Test(description = "上传_文章链接",priority = 5)
public void 上传_文章链接() throws IOException {
//待上传的文章链接
String articleLink = "https://mp.weixin.qq.com/s/j4qnDM98d2ZPW35ozFra8w";
......@@ -51,10 +93,11 @@ public class Upload {
Assert.assertEquals(contentType,"article", network.message(taskParams, UPLOAD_TASKSTATUS,"上传文章链接-查询调用失败",response.body().asString()));
}
@Test(description="上传_视频链接",priority = 3)
@Test(description="上传_视频链接",priority = 6)
public void 上传_视频链接() throws IOException{
//待上传的视频链接
String videoLink = "https://v.douyin.com/oEahcd/ 复制此链接,打开【抖音短视频】,直接观看视频!";
//String videoLink = "https://www.douyin.com/video/6935725226881715460?previous_page=video_detail";
//开始上传
Map<String, Object> params = new HashMap<String, Object>();
......@@ -75,7 +118,7 @@ public class Upload {
Assert.assertEquals(responseTaskId,taskId,network.message(taskParams, UPLOAD_TASKSTATUS,"上传视频链接-查询调用失败",response.body().asString()));
}
@Test(description = "上传_其他链接",priority = 4)
@Test(description = "上传_其他链接",priority = 7)
public void 上传_其他链接() throws IOException {
//待上传的其他链接
String network_link = "https://tieba.baidu.com/p/6688007444";
......@@ -114,26 +157,8 @@ public class Upload {
Assert.assertEquals(shareLink, network_link,network.message(updateParams, UPLOAD_UPDATEANDSHARE,"传其他链接-上传和分享调用失败",response.body().asString()));
}
@Test(description = "上传_本地视频",priority = 5)
public void 上传_本地视频() throws IOException {
//1.上传视频到oss
String videoFile = "src/test/java/com/kjj/resource/uploadCase.mp4";
Response response = network.postFileResponse(videoFile, UPLOAD_UPLOADVEDIO);
String videoUrl = response.jsonPath().getString("data.videoUrl");
String firstFrameUrl = response.jsonPath().getString("data.firstFrameUrl");
Assert.assertNotNull(videoUrl, network.message(UPLOAD_UPLOADVEDIO,"上传本地视频-上传oss失败",response.body().asString()));
//2.开始上传视频
// Map<String, Object> params = new HashMap<String, Object>();
// params.put("videoUrl",videoUrl);
// params.put("firstFrameUrl",firstFrameUrl);
// params.put("contentTitle","=自动化测试=");
// response = network.postResponse(params, UPLOAD_SELLERUPLOADVEDIO);
// String contentId = response.jsonPath().getString("data.contentId");
// Assert.assertNotNull(contentId,network.message(params, UPLOAD_SELLERUPLOADVEDIO,"上传本地视频-上传第2步失败"));
}
@Test(description="大家都在转_榜单列表",priority = 6)
@Test(description="大家都在转_榜单列表",priority = 8)
public void 大家都在转_榜单列表() throws IOException{
//获取文章的榜单
Response response = network.getResponse(UPLOAD_HOT);
......@@ -151,7 +176,7 @@ public class Upload {
}
//我的上传:
@Test(description="我的上传",priority = 7)
@Test(description="我的上传",priority = 9)
public void 我的上传() throws IOException{
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageIndex",1);
......@@ -160,29 +185,30 @@ public class Upload {
//获取文章的列表
params.put("type","article");
Response response = network.getResponse(params,UPLOAD_LIST);
Response response = network.getResponse(params,UPLOAD_listV2);
int length = response.jsonPath().getInt("data.size()");
String contentType = response.jsonPath().getString("data[0].contentType");
Assert.assertEquals(length, 1, network.message(params, UPLOAD_LIST,"获取我的上传-文章列表内容有误",response.body().asString()));
Assert.assertEquals(contentType, "article", network.message(params, UPLOAD_LIST,"获取我的上传-文章列表数量有误",response.body().asString()));
Assert.assertEquals(length, 1, network.message(params, UPLOAD_listV2,"获取我的上传-文章列表内容有误",response.body().asString()));
Assert.assertEquals(contentType, "article", network.message(params, UPLOAD_listV2,"获取我的上传-文章列表数量有误",response.body().asString()));
//获取视频的列表
params.put("type","video");
response = network.getResponse(params, UPLOAD_LIST);
params.put("pageNo",1);
response = network.getResponse(params, UPLOAD_listV2);
length = response.jsonPath().getInt("data.size()");
contentType = response.jsonPath().getString("data[0].contentType");
Assert.assertEquals(length, 1, network.message(params, UPLOAD_LIST,"获取我的上传-视频列表内容有误",response.body().asString()));//因为有一篇抖音,一篇本地,所以数量是2
Assert.assertEquals(contentType, "video", network.message(params, UPLOAD_LIST,"获取我的上传-视频列表数量有误",response.body().asString()));
Assert.assertEquals(length, 1, network.message(params, UPLOAD_listV2,"获取我的上传-视频列表内容有误",response.body().asString()));//因为有一篇抖音,一篇本地,所以数量是2
Assert.assertEquals(contentType, "video", network.message(params, UPLOAD_listV2,"获取我的上传-视频列表数量有误",response.body().asString()));
//获取其他的列表
params.put("type","network_link");
response = network.getResponse(params, UPLOAD_LIST);
response = network.getResponse(params, UPLOAD_listV2);
String network_linkId = response.jsonPath().getString("data[0].id");//获取列表的第一篇素材
length = response.jsonPath().getInt("data.size()");
contentType = response.jsonPath().getString("data[0].contentType");
Assert.assertEquals(length, 1, network.message(params, UPLOAD_LIST,"获取我的上传-其他列表失败",response.body().asString()));
Assert.assertEquals(contentType, "network_link", network.message(params, UPLOAD_LIST,"获取我的上传-其他列表数量有误",response.body().asString()));
Assert.assertEquals(length, 1, network.message(params, UPLOAD_listV2,"获取我的上传-其他列表失败",response.body().asString()));
Assert.assertEquals(contentType, "network_link", network.message(params, UPLOAD_listV2,"获取我的上传-其他列表数量有误",response.body().asString()));
//删除其他列表的素材
Map<String, Object> unbindParams = new HashMap<String, Object>();
......@@ -192,14 +218,10 @@ public class Upload {
Assert.assertTrue(data,network.message(unbindParams, UPLOAD_UNBIND,"删除我的上传-其他列表的素材失败",response.body().asString()));
//再次获取其他的列表, 检查删除是否生效
response = network.getResponse(params, UPLOAD_LIST);
response = network.getResponse(params, UPLOAD_listV2);
length = response.jsonPath().getInt("data.size()");
Assert.assertEquals(length, 0, network.message(params, UPLOAD_LIST,"获取我的上传-其他列表数量有误",response.body().asString()));
}
Assert.assertEquals(length, 0, network.message(params, UPLOAD_listV2,"获取我的上传-其他列表数量有误",response.body().asString()));
@AfterClass
public static void tearDown(){
apiCount += 13;
}
}
\ No newline at end of file
......@@ -298,7 +298,7 @@ public class GameLottery implements Authorization {
@Test(description="访客_打开抽奖链接",priority = 13)
public void 访客_打开抽奖链接(){
//切换为访客-请勿打扰
userTku1();
// userTku1();
//添加访问记录
Map<String, Object> params = new HashMap<String, Object>();
......@@ -550,7 +550,7 @@ public class GameLottery implements Authorization {
@Test(description="访客_第二个客户未中奖",priority = 21)
public void 访客_第二个客户未中奖(){
//切换为请勿打扰
userTku1();
// userTku1();
//添加访问记录
Map<String, Object> params = new HashMap<String, Object>();
......@@ -659,7 +659,7 @@ public class GameLottery implements Authorization {
Assert.assertNotNull(data,network.message(params, LOTTERRY_getDrawRecord,"返回数据为空",response.body().asString()));
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size==2,network.message(params, LOTTERRY_getDrawRecord,"中奖奖品名称错误",response.body().asString()));
Assert.assertTrue(size==1,network.message(params, LOTTERRY_getDrawRecord,"中奖奖品名称错误",response.body().asString()));
}
@Test(description="代理人_获取概率中奖抽奖活动的中奖人列表(未领奖)",priority = 26)
......
package com.kjj.cases.assistant.pay;
import com.kjj.cases.admin.Authorization;
import com.kjj.utils.BaseUtils;
import io.restassured.response.Response;
import org.apache.commons.lang3.StringUtils;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.HashMap;
import java.util.Map;
import static com.kjj.config.BasicConfig.*;
import static com.kjj.config.BasicConfig.PAY_CALLOUT;
public class Cashback implements Authorization {
@BeforeClass
public void setUp() {
userTku();
}
public String comboId;
@Test(description = "用户绑定分享关系",priority = 1)
public void 用户绑定分享关系() {
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("fromStr",1);
Params.put("inviterSid",2991);
Params.put("accessSource",22);
Response response = network.getResponse(Params,PAY_distribute);
System.out.println(response.body().asString());
boolean data=response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(PAY_distribute,"用户绑定失败",response.body().asString()));
}
@Test (description = "用户支付后是否有180天打卡权限",priority = 2)
public void 用户支付后是否有180天打卡权限() {
Response response = network.getResponse(PAY_clockPayInfo);
System.out.println(response.body().asString());
boolean isClockPay=response.jsonPath().getBoolean("data.isClockPay");
Assert.assertFalse(isClockPay,network.message(PAY_clockPayInfo,"有180天打卡权限",response.body().asString()));
}
@Test (description = "返现用户付费_微信支付后回调",priority = 3)
public void 返现用户付费_微信支付后回调() {
//获取付费价格
Response actualPayMoneyResponse = network.getResponse(PAY_combo);
System.out.println(actualPayMoneyResponse.body().asString());
comboId=actualPayMoneyResponse.jsonPath().getString("data[0].id");
Assert.assertNotNull(comboId,network.message(PAY_combo,"套餐ID为null",actualPayMoneyResponse.body().asString()));
String actualPayMoney = actualPayMoneyResponse.jsonPath().getString("data[0].actualPayMoney");
Assert.assertEquals(actualPayMoney,"365",network.message(PAY_combo,"获取付费价格:价格不是365",actualPayMoneyResponse.body().asString()));
//创建支付
Map<String, Object> payParams = new HashMap<String, Object>();
payParams.put("userVersion", 2); // 1 通用版 2 保险版
payParams.put("comboId", comboId);
payParams.put("oaId", "1");
payParams.put("paySource", "2");
Response response = network.postResponse(payParams, PAY_create);
String tradeNo = response.jsonPath().getString("data.tradeNo");
// mock微信回调失败
Map<String, Object> callbackParams = new HashMap<String, Object>();
callbackParams.put("tradeNo", tradeNo);
callbackParams.put("payResult", true);
callbackParams.put("payTradeNo", "test");
response = network.getResponse(callbackParams, PAY_CALLOUT);
boolean result = response.jsonPath().getBoolean("data");
response.body().prettyPrint();
Assert.assertTrue(result, network.message(callbackParams, PAY_CALLOUT, "mock微信支付回调成功,但我们订单处理失败", response.body().asString()));
}
@Test(description = "获取用户版本信息",priority = 4)
public void 获取用户版本信息() {
agentTku();
Response response = network.getResponse(USER_INFO);
System.out.println(response.body().asString());
boolean isInsuranceVersion=response.jsonPath().getBoolean("data.isInsuranceVersion");
Assert.assertTrue(isInsuranceVersion,network.message(USER_INFO,"不是保险版本",response.body().asString()));
}
@Test(description = "邀请的好友列表",priority = 5)
public void 邀请的好友列表() {
agentTku();
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("distributionListType",1);
Params.put("pageIndex",1);
Params.put("pageSize",10);
Response response = network.getResponse(Params,PAY_distributionList);
System.out.println(response.body().asString());
Object list=response.jsonPath().getJsonObject("data.list");
Assert.assertNotNull(list,network.message(PAY_distributionList,"待付款好友列表为null",response.body().asString()));
Params.put("distributionListType",2);
response = network.getResponse(Params,PAY_distributionList);
System.out.println(response.body().asString());
Object list1=response.jsonPath().getJsonObject("data.list");
Assert.assertNotNull(list1,network.message(PAY_distributionList,"已付款好友列表为null",response.body().asString()));
}
@Test(description = "代理人账户信息",priority = 6)
public void 代理人账户信息() {
agentTku();
Response response = network.getResponse(PAY_accInfo);
System.out.println(response.body().asString());
double balance=Double.parseDouble(response.jsonPath().getString("data.balance"));
Assert.assertTrue(balance>0,network.message(PAY_accInfo,"当前余额为0",response.body().asString()));
double totalPromotionEarnings=Double.parseDouble(response.jsonPath().getString("data.totalPromotionEarnings"));
Assert.assertTrue(totalPromotionEarnings>0,network.message(PAY_accInfo,"总收益为0",response.body().asString()));
double settleMoney=Double.parseDouble(response.jsonPath().getString("data.settleMoney"));
Assert.assertTrue(settleMoney>0,network.message(PAY_accInfo,"待结算金额为0",response.body().asString()));
int canWithdraw=response.jsonPath().getInt("data.canWithdraw");
Assert.assertTrue(canWithdraw==1,network.message(PAY_accInfo,"不可以提现",response.body().asString()));
int minWithdrawMoney=response.jsonPath().getInt("data.minWithdrawMoney");
Assert.assertTrue(minWithdrawMoney==1,network.message(PAY_accInfo,"最小可提现金额不等于1",response.body().asString()));
int maxWithdrawMoney=response.jsonPath().getInt("data.maxWithdrawMoney");
Assert.assertTrue(maxWithdrawMoney==5000,network.message(PAY_accInfo,"最大可提现金额不等于5000",response.body().asString()));
}
@Test(description = "代理人账户明细",priority = 7)
public void 代理人账户明细() {
agentTku();
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("type", 1);
Params.put("pageNo", 1);
Params.put("pageSize", 20);
Response response = network.getResponse(Params, PAY_accDetail);
System.out.println(response.body().asString());
int changeType = response.jsonPath().getInt("data[0].changeType");
Assert.assertTrue(changeType ==1, network.message(PAY_accDetail, "提现记录为null", response.body().asString()));
Params.put("type", 2);
response = network.getResponse(Params, PAY_accDetail);
System.out.println(response.body().asString());
int changeType1 = response.jsonPath().getInt("data[0].changeType");
Assert.assertTrue(changeType1 ==2, network.message(PAY_accDetail, "收益明细为null", response.body().asString()));
}
@Test(description = "代理人提现",priority = 8)
public void 代理人提现() {
agentTku();
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("withdrawMoney", 1);
Response response = network.getResponse(Params, PAY_withdraw);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(PAY_withdraw, "提现失败", response.body().asString()));
}
}
package com.kjj.cases.assistant;
package com.kjj.cases.assistant.pay;
import static com.kjj.config.BasicConfig.*;
......@@ -19,19 +19,17 @@ import java.util.HashMap;
import java.util.Map;
public class Pay implements Authorization {
private static final NetworkUtils network = NetworkUtils.getInstance();
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
agentTku();
userTku();
}
public String comboId;
public long id;
public String promotionCode;
@Test (description = "默认付费_付费页",priority = 1) //priority 方法执行优先级
public void 默认付费_付费页() {
//付款中间页判断
......@@ -262,8 +260,5 @@ public class Pay implements Authorization {
}
}
}
package com.kjj.cases.assistant.whoSawMe;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.utils.BaseUtils;
......@@ -7,8 +8,7 @@ import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
import static com.kjj.config.BasicConfig.BOSS_EDITCONFIG;
......@@ -21,10 +21,11 @@ public class ForwardAndRead implements Authorization {
private Long sellerId;
private String visitId;
private String insuranceId;
private String forwardTime;
@BeforeClass
public void setUp() throws IOException{
agentTku();
visitor2Tku();
BaseUtils.ssoLogin();
}
......@@ -39,6 +40,8 @@ public class ForwardAndRead implements Authorization {
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()));
forwardTime = response.jsonPath().getString("timestamp");
}
@Test(description = "代理人转发名片", priority = 2)
......@@ -58,8 +61,8 @@ public class ForwardAndRead implements Authorization {
// 访客访问素材及产生线索
@Test(description = "访客阅读文章", priority = 3)
public void 访客阅读文章() throws IOException{
sellerId = (Long) getUserInfo(BasicConfig.AGENT_TKU).get("sellerId");
network.agentCookies.put("tku", BasicConfig.VISITOR_TKU);
sellerId = decodeTku(BasicConfig.VISITOR2_TKU).get("sellerId");
network.agentCookies.put("tku", BasicConfig.AGENT_TKU);
param = new HashMap<>();
param.put("scid", articleScId);
param.put("fromUserId", sellerId);
......@@ -108,7 +111,7 @@ public class ForwardAndRead implements Authorization {
@Test(description = "二度访客阅读文章", priority = 6)
public void 二度访客阅读文章() throws IOException{
Long fromUserId = decodeTku(BasicConfig.VISITOR_TKU).get("sellerId");
Long fromUserId = decodeTku(BasicConfig.AGENT_TKU).get("sellerId");
network.agentCookies.put("tku", BasicConfig.VISITOR1_TKU); // 切换二度访客
param = new HashMap<>();
param.put("scid", articleScId);
......@@ -147,18 +150,16 @@ public class ForwardAndRead implements Authorization {
}
// 获取用户信息
public Map<String, Object> getUserInfo(String userTku){
public Map<String, String> 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 avatar = response.jsonPath().getString("data.avatar");
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<>();
Map<String, String> infos = new HashMap<>();
infos.put("avatar", avatar);
infos.put("wxName", wxName);
infos.put("sellerId", sellerId);
infos.put("userId", userId);
network.agentCookies.put("tku", BasicConfig.AGENT_TKU);
network.agentCookies.put("tku", BasicConfig.VISITOR2_TKU);
return infos;
}
......
package com.kjj.cases.assistant.whoSawMe;
import com.kjj.bean.whoSawMe.*;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.utils.BaseUtils;
import com.kjj.utils.JsonUtil;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.testng.collections.Lists;
import java.io.IOException;
import java.util.*;
// 我的客户-首页
public class MyCustomer implements Authorization {
private Response response;
private Map<String, Object> param;
private ForwardAndRead far;
private String createTagId;
private long visitor1UserId;
private String sessionId;
private int visitCount;
private String id; // 自定义提醒事项id
@BeforeClass
public void setUp() throws IOException{
BaseUtils.ssoLogin();
visitor2Tku();
far = new ForwardAndRead();
}
// 我的客户首页_客户统计
@Test(description = "首页_客户统计", priority = 1)
public void 首页_客户统计() throws IOException{
response = network.getResponse(BasicConfig.CUSTOMERSTATISTICS);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(BasicConfig.CUSTOMERSTATISTICS, "接口请求失败", response.body().asString()));
int sevenDaysActiveCount = response.jsonPath().getInt("data.sevenDaysActiveCount");
int totalCount = response.jsonPath().getInt("data.totalCount");
Assert.assertTrue(sevenDaysActiveCount >= 1, network.message(BasicConfig.CUSTOMERSTATISTICS, "七日活跃客户数小于1", response.body().asString()));
Assert.assertTrue(totalCount >= 1, network.message(BasicConfig.CUSTOMERSTATISTICS, "累计获客数小于1", response.body().asString()));
}
// 我的客户首页_查询未读信息
@Test(description = "首页_查询未读信息", priority = 2)
public void 首页_查询未读信息() throws IOException{
response = network.getResponse(BasicConfig.SELLERUNREADMESSAGE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(BasicConfig.SELLERUNREADMESSAGE, "接口请求失败", response.body().asString()));
Object unreadCount = response.jsonPath().getJsonObject("data.unreadCount");
Assert.assertNotNull(unreadCount, network.message(BasicConfig.SELLERUNREADMESSAGE, "获取未读消息数失败", response.body().asString()));
}
// 消息通知页_对话记录
@Test(description = "消息通知页_对话记录", priority = 99)
public void 消息通知页_对话记录() throws IOException{
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 90);
response = network.getResponse(param, BasicConfig.CHAT_LINKMANLIST);
List<LinkList> linkLists = JsonUtil.parseResponseToPageBean(response, LinkList.class);
String sessionIds = (String) linkLists.get(0).getSession().get("sessionId");
String lastContent = (String) linkLists.get(0).getSession().get("lastContent");
Assert.assertEquals(sessionIds, sessionId, network.message(param, BasicConfig.CHAT_LINKMANLIST, "对话记录sessionId有误", response.body().asString()));
Assert.assertEquals(lastContent, "Hello", network.message(param, BasicConfig.CHAT_LINKMANLIST, "对话记录最后一条内容错误", response.body().asString()));
}
// 标签管理页_新建标签
@Test(description = "标签管理_新建标签", priority =3)
public void 标签管理_新建标签() throws IOException{
// 添加标签
param = new HashMap<>();
param.put("tagName", "新标签");
response = network.postResponse(param, BasicConfig.TAG_ADDORUPDATE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TAG_ADDORUPDATE, "接口请求失败", response.body().asString()));
createTagId = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(createTagId, network.message(param, BasicConfig.TAG_ADDORUPDATE, "data数据为空", response.body().asString()));
// 查看标签列表
response = network.getResponse(BasicConfig.TAG_GETLIST);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(BasicConfig.TAG_GETLIST, "接口请求失败", response.body().asString()));
String newTagId = response.jsonPath().getString("data[0].id");
String newTagName = response.jsonPath().getString("data[0].tagName");
Assert.assertEquals(newTagId, (String) createTagId, network.message(BasicConfig.TAG_GETLIST, "新增标签id错误", response.body().asString()));
Assert.assertEquals(newTagName, "新标签", network.message(BasicConfig.TAG_GETLIST, "新增标签名称错误", response.body().asString()));
}
// 标签管理_修改标签
@Test(description = "标签管理_修改标签", priority = 4)
public void 标签管理_修改标签() throws IOException{
// 修改标签
param = new HashMap<>();
param.put("id", createTagId);
param.put("tagName", "新标签2");
response = network.postResponse(param, BasicConfig.TAG_ADDORUPDATE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TAG_ADDORUPDATE, "接口请求失败", response.body().asString()));
// 查看标签列表
response = network.getResponse(BasicConfig.TAG_GETLIST);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(BasicConfig.TAG_GETLIST, "接口请求失败", response.body().asString()));
String newTagId = response.jsonPath().getString("data[0].id");
String newTagName = response.jsonPath().getString("data[0].tagName");
Assert.assertEquals(newTagId, (String) createTagId, network.message(BasicConfig.TAG_GETLIST, "新增标签id错误", response.body().asString()));
Assert.assertEquals(newTagName, "新标签2", network.message(BasicConfig.TAG_GETLIST, "新增标签名称错误", response.body().asString()));
}
// 标签管理_删除标签
@Test(description = "标签管理_删除标签", priority = 100)
public void 标签管理_删除标签() throws IOException{
// 删除标签
List<String> ids = Lists.newArrayList();
ids.add(createTagId);
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 = 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()));
}
}
// 我的客户首页_获取全部客户列表_最近访问
@Test(description = "客户列表_最近访问", priority = 6)
public void 客户列表_最近访问() throws IOException{
visitor1UserId = far.decodeTku(BasicConfig.VISITOR1_TKU).get("userId");
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sortType", 3);
response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString()));
long userId = response.jsonPath().getLong("data.list[0].userId");
Assert.assertEquals(userId, visitor1UserId, network.message(param, BasicConfig.CUSTOMERSEARCH, "最新访问记录首位用户userId错误", response.body().asString()));
}
// 我的客户首页_获取全部客户列表_按照访问次数排列
@Test(description = "客户列表_访问次数", priority = 7)
public void 客户列表_访问次数() throws IOException{
// 降序排列
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sortType", 1);
response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString()));
int visitCountFirst = response.jsonPath().getInt("data.list[0].visitCount");
int visitCountSecond = response.jsonPath().getInt("data.list[1].visitCount");
int visitCountThird = response.jsonPath().getInt("data.list[2].visitCount");
boolean compareOne = visitCountFirst >= visitCountSecond;
boolean compareTwo = visitCountSecond >= visitCountThird;
Assert.assertTrue(compareOne, network.message(param, BasicConfig.CUSTOMERSEARCH, "访问次数筛选结果排列顺序错误", response.body().asString()));
Assert.assertTrue(compareTwo, network.message(param, BasicConfig.CUSTOMERSEARCH, "访问次数筛选结果排列顺序错误", response.body().asString()));
// 升序排列
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sortType", 2);
response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString()));
visitCountFirst = response.jsonPath().getInt("data.list[0].visitCount");
visitCountSecond = response.jsonPath().getInt("data.list[1].visitCount");
visitCountThird = response.jsonPath().getInt("data.list[2].visitCount");
compareOne = visitCountFirst <= visitCountSecond;
compareTwo = visitCountSecond <= visitCountThird;
Assert.assertTrue(compareOne, network.message(param, BasicConfig.CUSTOMERSEARCH, "访问次数筛选结果排列顺序错误", response.body().asString()));
Assert.assertTrue(compareTwo, network.message(param, BasicConfig.CUSTOMERSEARCH, "访问次数筛选结果排列顺序错误", response.body().asString()));
}
// 我的客户首页_获取全部客户列表_按客户意向排列
@Test(description = "客户列表_客户意向", priority = 8)
public void 客户列表_客户意向() throws IOException{
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sortType", 5);
response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString()));
int customerIntentionFirst = response.jsonPath().getInt("data.list[0].customerIntention");
int customerIntentionSecond = response.jsonPath().getInt("data.list[1].customerIntention");
int customerIntentionThird = response.jsonPath().getInt("data.list[2].customerIntention");
boolean compareOne = customerIntentionFirst >= customerIntentionSecond;
boolean compareTwo = customerIntentionSecond >= customerIntentionThird;
Assert.assertTrue(compareOne, network.message(param, BasicConfig.CUSTOMERSEARCH, "客户意向筛选结果排列顺序错误", response.body().asString()));
Assert.assertTrue(compareTwo, network.message(param, BasicConfig.CUSTOMERSEARCH, "客户意向筛选结果排列顺序错误", response.body().asString()));
}
//我的客户首页_获取客户列表_特别关注客户
@Test(description = "客户列表_特别关注", priority = 10)
public void 客户列表_特别关注() throws IOException{
ThreadSleepUtils.sleep(5000);
param = new HashMap<>();
param.put("isSpecialCustomer", 1);
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sortType", 3);
response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString()));
long userId = response.jsonPath().getLong("data.list[0].userId");
Assert.assertEquals(userId, visitor1UserId, network.message(param, BasicConfig.CUSTOMERSEARCH, "客户userId不匹配", response.body().asString()));
List<Object> specialCustLists = response.jsonPath().getJsonObject("data.list");
for(int i = 0; i < specialCustLists.size(); i++){
int isSpecialCustomer = response.jsonPath().getInt("data.list["+ i +"].isSpecialCustomer");
Assert.assertEquals(isSpecialCustomer, 1, network.message(param, BasicConfig.CUSTOMERSEARCH, "筛选结果包含非特殊关注客户", response.body().asString()));
}
// 特别关注客户总数
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sortType", 3);
response = network.postResponse(param, BasicConfig.totalSpecial);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.totalSpecial, "接口请求失败", response.body().asString()));
int specialCustomerTotal = response.jsonPath().getInt("data.specialCustomerTotal");
Assert.assertEquals(specialCustomerTotal, specialCustLists.size(), network.message(param, BasicConfig.totalSpecial, "特别关注客户总数错误", response.body().asString()));
}
// 我的客户首页_获取客户列表_筛选客户
@Test(description = "客户列表_七日活跃", priority = 12)
public void 客户列表_七日活跃() throws IOException{
param = new HashMap<>();
param.put("activeType", 1);
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sortType", 3);
response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString()));
List<Object> lists = response.jsonPath().getList("data.list");
Assert.assertTrue(lists.size() >= 1, network.message(param, BasicConfig.CUSTOMERSEARCH, "七日活跃客户数为0", response.body().asString()));
}
// 我的客户首页_获取客户列表_筛选客户
@Test(description = "客户列表_直接转发", priority = 13)
public void 客户列表_直接转发() throws IOException{
param = new HashMap<>();
param.put("custOrigin", 1);
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sortType", 3);
response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString()));
List<Object> lists = response.jsonPath().getList("data.list");
Assert.assertTrue(lists.size() >= 1, network.message(param, BasicConfig.CUSTOMERSEARCH, "直接转发客户数为0", response.body().asString()));
}
// 我的客户首页_获取客户列表_筛选客户
@Test(description = "客户列表_好友转发", priority = 14)
public void 客户列表_好友转发() throws IOException{
param = new HashMap<>();
param.put("custOrigin", 2);
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sortType", 3);
response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTOMERSEARCH, "接口请求失败", response.body().asString()));
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()));
}
// 客户列表_标签
@Test(description = "客户列表_标签", priority = 31)
public void 客户列表_标签() throws IOException{
// 等待5s获取新建的标签
ThreadSleepUtils.sleep(5000);
List<String> tagIds = new ArrayList<>();
tagIds.add(createTagId);
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sortType", 3);
param.put("tagIds", tagIds);
response = network.postResponse(param, BasicConfig.CUSTOMERSEARCH);
System.out.println(response.body().asString());
long userId = response.jsonPath().getLong("data.list[0].userId");
Assert.assertEquals(userId, visitor1UserId, network.message(param, BasicConfig.CUSTOMERSEARCH, "筛选结果与预期不符", response.body().asString()));
}
// 客户详情页_头部信息栏
@Test(description = "客户详情页_头部信息栏", priority = 16)
public void 客户详情页_头部信息栏() throws IOException{
param = new HashMap<>();
param.put("custUserId", visitor1UserId);
response = network.getResponse(param, BasicConfig.CUSTINFOHEADER);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTINFOHEADER, "接口请求失败", response.body().asString()));
List<Object> custOrigins = response.jsonPath().getList("data.custOrigins");
Assert.assertEquals(custOrigins.size(), 3, network.message(param, BasicConfig.CUSTINFOHEADER, "二度客户来源链路长度不为3", response.body().asString()));
int cameFrom = response.jsonPath().getInt("data.cameFrom");
Assert.assertEquals(cameFrom, 2, network.message(param, BasicConfig.CUSTINFOHEADER, "访客来源不为二度访客", response.body().asString()));
}
// 客户详情页_客户信息
@Test(description = "客户详情页_客户信息", priority = 17)
public void 客户详情页_客户信息() throws IOException{
param = new HashMap<>();
param.put("userId", visitor1UserId);
response = network.getResponse(param, BasicConfig.CUSTINFO);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTINFO, "接口请求失败", response.body().asString()));
Long sellerId = response.jsonPath().getLong("data.sellerId");
sessionId = response.jsonPath().getString("data.sessionId");
Assert.assertEquals(sellerId, far.decodeTku(BasicConfig.VISITOR2_TKU).get("sellerId"), network.message(param, BasicConfig.CUSTINFO, "访客所属销售员sellerId不符", response.body().asString()));
Assert.assertNotNull(sessionId, network.message(param, BasicConfig.CUSTINFO, "访客sessionId为空", response.body().asString()));
}
// 客户详情页_设置特别关注
@Test(description = "客户详情页_设置特别关注", priority = 9)
public void 客户详情页_设置特别关注() throws IOException{
param = new HashMap<>();
param.put("custUserId", visitor1UserId);
param.put("isSpecialCustomer", 1);
response = network.postResponse(param, BasicConfig.UPDATESPECIAL);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.UPDATESPECIAL, "接口请求失败", response.body().asString()));
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.UPDATESPECIAL, "设置特别关注失败", response.body().asString()));
}
// 客户详情页_取消特别关注
@Test(description = "客户详情页_设置特别关注", priority = 11)
public void 客户详情页_取消特别关注() throws IOException{
param = new HashMap<>();
param.put("custUserId", visitor1UserId);
param.put("isSpecialCustomer", 0);
response = network.postResponse(param, BasicConfig.UPDATESPECIAL);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.UPDATESPECIAL, "接口请求失败", response.body().asString()));
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.UPDATESPECIAL, "取消特别关注失败", response.body().asString()));
}
// 客户详情页_设置备注
@Test(description = "客户详情页_设置备注", priority = 18)
public void 客户详情页_设置备注() throws IOException{
// 设置备注
param = new HashMap<>();
param.put("custUserId", visitor1UserId);
param.put("remarkName", "备注名");
response = network.postResponse(param, BasicConfig.UPDATEREMARKNAME);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.UPDATEREMARKNAME, "接口请求失败", response.body().asString()));
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.UPDATEREMARKNAME, "设置备注失败", response.body().asString()));
// 查看用户头部信息
param = new HashMap<>();
param.put("custUserId", visitor1UserId);
response = network.getResponse(param, BasicConfig.CUSTINFOHEADER);
String remarkName = response.jsonPath().getString("data.remarkName");
Assert.assertEquals(remarkName, "备注名", network.message(param, BasicConfig.CUSTINFOHEADER, "用户备注名与预期不符", response.body().asString()));
}
// 客户详情页_意向详情
@Test(description = "客户详情页_意向详情", priority = 19)
public void 客户详情页_意向详情() throws IOException{
param = new HashMap<>();
param.put("userId", visitor1UserId);
response = network.getResponse(param, BasicConfig.CLUESTATISTICS);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CLUESTATISTICS, "接口请求失败", response.body().asString()));
int drawPresentInsuranceCount = response.jsonPath().getInt("data.drawPresentInsuranceCount");
Assert.assertTrue(drawPresentInsuranceCount >= 1, network.message(param, BasicConfig.CLUESTATISTICS, "客户领取赠险次数小于1", response.body().asString()));
}
// 客户详情页_线索统计
@Test(description = "客户详情页_线索统计", priority = 21)
public void 客户详情页_线索统计() throws IOException{
param = new HashMap<>();
param.put("custUserId", visitor1UserId);
param.put("type", 2);
response = network.getResponse(param, BasicConfig.CUSTSTATISTIC);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTSTATISTIC, "接口请求失败", response.body().asString()));
visitCount = response.jsonPath().getInt("data.visitCount");
int grassNum = response.jsonPath().getInt("data.grassNum");
Assert.assertTrue(visitCount >= 1, network.message(param, BasicConfig.CUSTSTATISTIC, "用户来访次数小于1", response.body().asString()));
Assert.assertTrue(grassNum >= 1, network.message(param, BasicConfig.CUSTSTATISTIC, "用户阅读种草文章次数小于1", response.body().asString()));
Assert.assertEquals(visitCount, grassNum, network.message(param, BasicConfig.CUSTSTATISTIC, "用户来访次数与阅读种草文章次数不相等", response.body().asString()));
}
// 客户详情页_阅读偏好
@Test(description = "客户详情页_阅读偏好", priority = 22)
public void 客户详情页_阅读偏好() throws IOException{
param = new HashMap<>();
param.put("custUserId", visitor1UserId);
response = network.getResponse(param, BasicConfig.CUSTREADPERFERENCE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTREADPERFERENCE, "接口请求失败", response.body().asString()));
}
// 客户详情页_来访记录
@Test(description = "客户详情页_来访记录", priority = 23)
public void 客户详情页_来访记录() throws IOException{
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("custUserId", visitor1UserId);
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()));
List<VisitRecords> visitRecords = JsonUtil.parseResponseToPageBean(response, VisitRecords.class);
VisitRecords.recordsList recordsOfContent = visitRecords.get(0).getRecords().get(0);
VisitRecords.recordsList recordsOfClue = visitRecords.get(0).getRecords().get(1);
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, 31, network.message(param, BasicConfig.CUSTVISITLIST, "访问记录详情有误", response.body().asString()));
}
// 客户详情页_任务蒙层
@Test(description = "客户详情页_任务蒙层", priority = 24)
public void 客户详情页_任务蒙层() throws IOException{
param = new HashMap<>();
param.put("sceneCode", "noviceTask_visitorsCustomerInfoComplete");
response = network.postResponse(param, BasicConfig.NOVICE_MONGOLIANLAYERISPLAY);
boolean isDisplay = response.jsonPath().getBoolean("data.isDisplay");
Assert.assertFalse(isDisplay, network.message(param, BasicConfig.NOVICE_MONGOLIANLAYERISPLAY, "任务蒙层展示判断错误", response.body().asString()));
}
// 客户详情页_特别关注弹层
@Test(description = "客户详情页_特别关注弹层", priority = 25)
public void 客户详情页_特别关注弹层() throws IOException{
response = network.getResponse(BasicConfig.ISDISPLAYSPECIAL);
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(param, BasicConfig.ISDISPLAYSPECIAL, "接口返回数据为空", response.body().asString()));
}
// 客户详情页_素材访问记录
@Test(description = "客户详情页_素材访问记录", priority = 26)
public void 客户详情页_素材访问记录() throws IOException{
param = new HashMap<>();
param.put("custUserId", visitor1UserId);
param.put("pageIndex", 1);
param.put("paheSize", 30);
response = network.getResponse(param, BasicConfig.CONTENTVISITRECORD);
int totalCount = response.jsonPath().getInt("data.custVisitList.totalCount");
Assert.assertEquals(totalCount, visitCount, network.message(param, BasicConfig.CONTENTVISITRECORD, "访问记录总数与来访次数不符", response.body().asString()));
}
// 客户详情页_关键线索_提交资料
@Test(description = "客户详情页_资料信息", priority = 27)
public void 关键线索_提交资料() throws IOException{
param = new HashMap<>();
param.put("custUserId", visitor1UserId);
response = network.getResponse(param, BasicConfig.CUSTMATERIALS);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTMATERIALS, "接口请求失败", response.body().asString()));
}
// 客户详情页_关键线索_中奖记录
@Test(description = "客户详情页_关键信息_中奖记录",priority = 28)
public void 关键线索_中奖记录() throws IOException{
param = new HashMap<>();
param.put("custUserId", visitor1UserId);
response = network.getResponse(param, BasicConfig.CUSTLOTTERIES);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTLOTTERIES, "接口请求失败", response.body().asString()));
}
// 客户详情页_关键信息_喜欢的内容
@Test(description = "关键信息_喜欢的内容", priority = 29)
public void 关键信息_喜欢的内容() throws IOException{
param = new HashMap<>();
param.put("custUserId", visitor1UserId);
response = network.getResponse(param, BasicConfig.CUSTFAVORITE);
List<CustFavorite> custFavorites = JsonUtil.parseResponseToListBean(response, CustFavorite.class);
Assert.assertTrue(custFavorites.size() >= 1, network.message(param, BasicConfig.CUSTFAVORITE, "数据记录数有误", response.body().asString()));
String userActionTypeEnum = custFavorites.get(0).getUserActionTypeEnum();
String contentId = custFavorites.get(0).getContentId();
Assert.assertEquals(userActionTypeEnum, "FORWARD", network.message(param, BasicConfig.CUSTFAVORITE, "用户动作类型记录有误", response.body().asString()));
Assert.assertEquals(contentId, BasicConfig.ARTICLE_CONTENTID, network.message(param, BasicConfig.CUSTFAVORITE, "用户产生动作的素材ID有误", response.body().asString()));
}
// 客户信息_客户管理_备注和标签
@Test(description = "备注和标签", priority = 30)
public void 客户信息_客户管理_备注和标签() throws IOException{
List<String> tagIds = new ArrayList<>();
tagIds.add(createTagId);
String custUserId = String.valueOf(visitor1UserId);
// 设置客户备注和标签信息
param = new HashMap<>();
param.put("custUserId", custUserId);
param.put("memo", "备忘录内容");
param.put("remarkName", "备注昵称");
param.put("tagIds", tagIds);
response = network.postResponse(param, BasicConfig.UPDATETAGANDMEMO);
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.UPDATETAGANDMEMO, "设置备注信息失败", response.body().asString()));
// 查询用户头部信息
param = new HashMap<>();
param.put("custUserId", visitor1UserId);
response = network.getResponse(param, BasicConfig.CUSTINFOHEADER);
String remarkName = response.jsonPath().getString("data.remarkName");
Assert.assertEquals(remarkName, "备注昵称", network.message(param, BasicConfig.CUSTINFOHEADER, "备注昵称与预期不符", response.body().asString()));
// 查询用户标签和备注信息
param = new HashMap<>();
param.put("userId", visitor1UserId);
response = network.getResponse(param, BasicConfig.GETTAGANDREMIND);
String memo = response.jsonPath().getString("data.memo");
String tagId = response.jsonPath().getString("data.tagList[0].id");
Assert.assertEquals(memo, "备忘录内容", network.message(param, BasicConfig.GETTAGANDREMIND, "备忘内容与预期不符", response.body().asString()));
Assert.assertEquals(tagId, createTagId, network.message(param, BasicConfig.GETTAGANDREMIND, "标签id与预期不符", response.body().asString()));
}
// 客户信息_客户管理_自定义提醒事项
@Test(description = "客户信息_客户管理_自定义提醒事项", priority = 32)
public void 客户信息_客户管理_自定义提醒事项() throws IOException{
param = new HashMap<>();
param.put("remindContent", "自定义提醒");
param.put("remindTime", roundUpToGetCurrentTimestamp());
param.put("userId", visitor1UserId);
response = network.postResponse(param, BasicConfig.UPDATECUSTREMIND);
String remindId = response.jsonPath().getString("data");
Assert.assertNotNull(remindId, network.message(param, BasicConfig.UPDATECUSTREMIND, "自定义提醒id为空", response.body().asString()));
// 查询未提醒事件列表
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("userId", visitor1UserId);
param.put("remindStatus", 0);
response = network.getResponse(param, BasicConfig.GETREMINDINFOS);
List<RemindInfo> remindInfos = JsonUtil.parseResponseToPageBean(response, RemindInfo.class);
for(RemindInfo remindInfo : remindInfos){
int remindStatus = remindInfo.getRemindStatus();
Assert.assertEquals(remindStatus, 0, network.message(param, BasicConfig.GETREMINDINFOS, "有状态为非未提醒事件", response.body().asString()));
}
id = remindInfos.get(0).getId();
Long stamp = remindInfos.get(0).getRemindTime();
Assert.assertEquals(id, remindId, network.message(param, BasicConfig.GETREMINDINFOS, "事件id与预期不符", response.body().asString()));
Assert.assertEquals(stamp, roundUpToGetCurrentTimestamp(), network.message(param, BasicConfig.GETREMINDINFOS, "事件触发时间与预期不符", response.body().asString()));
}
// 客户信息_客户管理_修改提醒事项
@Test(description = "客户信息_客户管理_修改提醒事项", priority = 33)
public void 客户信息_客户管理_修改提醒事项() throws IOException{
param = new HashMap<>();
param.put("id", id);
param.put("remindContent", "修改自定义提醒");
param.put("remindTime", roundUpToGetCurrentTimestamp());
param.put("userId", visitor1UserId);
response = network.postResponse(param, BasicConfig.UPDATECUSTREMIND);
String desc = response.jsonPath().getString("desc");
Assert.assertEquals(desc, "OK", network.message(param, BasicConfig.UPDATECUSTREMIND, "修改提醒事项失败", response.body().asString()));
// 查询未提醒事件列表
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("userId", visitor1UserId);
param.put("remindStatus", 0);
response = network.getResponse(param, BasicConfig.GETREMINDINFOS);
List<RemindInfo> remindInfos = JsonUtil.parseResponseToPageBean(response, RemindInfo.class);
String id = remindInfos.get(0).getId();
String remindContent = remindInfos.get(0).getRemindContent();
Assert.assertEquals(id, id, network.message(param, BasicConfig.GETREMINDINFOS, "事件id与预期不符", response.body().asString()));
Assert.assertEquals(remindContent, "修改自定义提醒", network.message(param, BasicConfig.GETREMINDINFOS, "修改提醒内容未生效", response.body().asString()));
}
//客户信息_客户管理_删除自定义提醒
@Test(description = "客户信息_客户管理_删除自定义提醒", priority = 34)
public void 客户信息_客户管理_删除自定义提醒() throws IOException{
// 删除待提醒事件
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("userId", visitor1UserId);
param.put("remindStatus", 0);
response = network.getResponse(param, BasicConfig.GETREMINDINFOS);
List<RemindInfo> remindInfos = JsonUtil.parseResponseToPageBean(response, RemindInfo.class);
for (RemindInfo remindInfo : remindInfos){
String id = remindInfo.getId();
param = new HashMap<>();
param.put("id", id);
param.put("userId", visitor1UserId);
response = network.postResponse(param, BasicConfig.DELETEREMIND);
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.DELETEREMIND, "删除失败", response.body().asString()));
}
// 确认全部删除
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("userId", visitor1UserId);
param.put("remindStatus", 0);
response = network.getResponse(param, BasicConfig.GETREMINDINFOS);
List<Object> list = response.jsonPath().getList("data.list");
Assert.assertEquals(list.size(), 0, network.message(param, BasicConfig.GETREMINDINFOS, "待提醒事件未全部删除", response.body().asString()));
}
// 客户信息_客户管理_查询已提醒事件列表
@Test(description = "客户信息_客户管理_查询已提醒事件列表", priority = 35)
public void 客户信息_客户管理_查询已提醒事件列表() throws IOException{
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("userId", visitor1UserId);
param.put("remindStatus", 1);
response = network.getResponse(param, BasicConfig.GETREMINDINFOS);
List<RemindInfo> remindInfos = JsonUtil.parseResponseToPageBean(response, RemindInfo.class);
String remindContent = remindInfos.get(0).getRemindContent();
int remindStatus = remindInfos.get(0).getRemindStatus();
Assert.assertEquals(remindContent, "吃饭", network.message(param, BasicConfig.GETREMINDINFOS, "筛选结果事件内容不正确", response.body().asString()));
Assert.assertEquals(remindStatus, 1, network.message(param, BasicConfig.GETREMINDINFOS, "筛选结果状态非已提醒", response.body().asString()));
}
// 客户信息_客户管理_生日提醒
@Test(description = "客户信息_客户管理_生日提醒", priority = 36)
public void 客户信息_客户管理_生日提醒() throws IOException{
String userId = String.valueOf(visitor1UserId);
// 开启生日提醒
param = new HashMap<>();
param.put("birthRemind", true);
param.put("birthday", "07-30");
param.put("userId", userId);
response = network.postResponse(param, BasicConfig.UPDATEBIRTHREMIND);
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.UPDATEBIRTHREMIND, "开启生日提醒失败", response.body().asString()));
// 检查是否开启
param = new HashMap<>();
param.put("userId", visitor1UserId);
response = network.getResponse(param, BasicConfig.GETCUSTREMINDINFO);
boolean birthRemind = response.jsonPath().getBoolean("data.birthRemind");
String birthday = response.jsonPath().getString("data.birthday");
Assert.assertTrue(birthRemind, network.message(param, BasicConfig.GETCUSTREMINDINFO, "生日提醒未开启", response.body().asString()));
Assert.assertEquals(birthday, "07-30", network.message(param, BasicConfig.GETCUSTREMINDINFO, "生日日期不正确", response.body().asString()));
// 关闭生日提醒
param = new HashMap<>();
param.put("birthRemind", false);
param.put("userId", userId);
response = network.postResponse(param, BasicConfig.UPDATEBIRTHREMIND);
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.UPDATEBIRTHREMIND, "关闭生日提醒失败", response.body().asString()));
// 检查是否关闭
param = new HashMap<>();
param.put("userId", visitor1UserId);
response = network.getResponse(param, BasicConfig.CUSTOMERDETAIL);
birthRemind = response.jsonPath().getBoolean("data.birthRemind");
Assert.assertFalse(birthRemind, network.message(param, BasicConfig.CUSTOMERDETAIL, "生日提醒未关闭", response.body().asString()));
}
// 客户信息_客户管理_节日提醒
@Test(description = "客户信息_客户管理_节日提醒", priority = 37)
public void 客户信息_客户管理_节日提醒() throws IOException{
String userId = String.valueOf(visitor1UserId);
// 开启节日提醒
param = new HashMap<>();
param.put("holidayRemind", true);
param.put("userId", userId);
response = network.postResponse(param, BasicConfig.UPDATEHOLIDAYREMIND);
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.UPDATEHOLIDAYREMIND, "节日提醒开启失败", response.body().asString()));
// 检查是否开启
param = new HashMap<>();
param.put("userId", visitor1UserId);
response = network.getResponse(param, BasicConfig.GETTAGANDREMIND);
boolean holidayRemind = response.jsonPath().getBoolean("data.holidayRemind");
Assert.assertTrue(holidayRemind, network.message(param, BasicConfig.GETTAGANDREMIND, "节日提醒未开启", response.body().asString()));
// 关闭节日提醒
param.clear();
param.put("holidayRemind", false);
param.put("userId", userId);
response = network.postResponse(param, BasicConfig.UPDATEHOLIDAYREMIND);
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.UPDATEHOLIDAYREMIND, "节日提醒关闭失败", response.body().asString()));
// 检查是否关闭
param = new HashMap<>();
param.put("userId", visitor1UserId);
response = network.getResponse(param, BasicConfig.GETCUSTREMINDINFO);
holidayRemind = response.jsonPath().getBoolean("data.holidayRemind");
Assert.assertFalse(holidayRemind, network.message(param, BasicConfig.GETTAGANDREMIND, "节日提醒未关闭", response.body().asString()));
}
// 客户信息_客户关系链_统计信息
@Test(description = "客户信息_客户关系链_统计信息", priority = 38)
public void 客户信息_客户关系链_统计信息() throws IOException{
param = new HashMap<>();
param.put("custUserId", far.decodeTku(BasicConfig.AGENT_TKU).get("userId"));
response = network.getResponse(param, BasicConfig.RELATIONINFO_HEADER);
String name = response.jsonPath().getString("data.name");
Assert.assertEquals(name, BasicConfig.WECHAT_NAME, network.message(param, BasicConfig.RELATIONINFO_HEADER, "客户姓名不正确", response.body().asString()));
}
// 客户信息_客户关系链_人脉列表
@Test(description = "客户信息_客户关系链_人脉列表", priority = 39)
public void 客户信息_客户关系链_人脉列表() throws IOException{
param = new HashMap<>();
param.put("custUserId", far.decodeTku(BasicConfig.AGENT_TKU).get("userId"));
param.put("type", 1);
param.put("pageSize", 20);
param.put("pageIndex", 1);
response = network.getResponse(param, BasicConfig.RELATIONINFO_LIST);
Object data =response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(param, BasicConfig.RELATIONINFO_LIST, "返回响应为空", response.body().asString()));
}
// 客户信息_客户关系链_邀请排行
@Test(description = "客户信息_客户关系链_邀请排行", priority = 40)
public void 客户信息_客户关系链_邀请排行() throws IOException{
param = new HashMap<>();
param.put("type", 2);
param.put("pageSize", 20);
param.put("pageIndex", 1);
response = network.getResponse(param, BasicConfig.RELATIONINFO_RANKING);
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(param, BasicConfig.RELATIONINFO_RANKING, "返回响应为空", response.body().asString()));
}
//客户信息_更多资料
@Test(description = "客户信息_更多资料", priority = 41)
public void 客户信息_更多资料() throws IOException{
// 更新资料信息
List<Object> baseMaterial = new ArrayList<>();
List<Object> otherMaterial = new ArrayList<>();
Map<String, List<Object>> extraMaterial = new HashMap<>();
extraMaterial.put("baseMaterial", baseMaterial);
extraMaterial.put("otherMaterial", otherMaterial);
String userId = String.valueOf(visitor1UserId);
param = new HashMap<>();
param.put("age", "11");
param.put("birthRemind", true);
param.put("birthday", "07-31");
param.put("birthdayType", 2);
param.put("custArea", "");
param.put("custCity", "北区");
param.put("custGender", 1);
param.put("custPhone", "13705566425");
param.put("extraMaterial", extraMaterial);
param.put("familyStatus", "家庭情况");
param.put("haveCar", false);
param.put("haveHouse", true);
param.put("healthStatus", "健康状态");
param.put("insuranceBuyStatus", "保险购买情况");
param.put("userId", userId);
param.put("yearIncome", 10000);
response = network.postResponse(param, BasicConfig.UPDATECUSTMATERIAL);
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.UPDATECUSTMATERIAL, "修改保存失败", response.body().asString()));
// 查看修改
param = new HashMap<>();
param.put("userId", visitor1UserId);
response = network.getResponse(param, BasicConfig.CUSTOMERDETAIL);
boolean haveCar = response.jsonPath().getBoolean("data.haveCar");
boolean haveHouse = response.jsonPath().getBoolean("data.haveHouse");
boolean birthRemind = response.jsonPath().getBoolean("data.birthRemind");
Assert.assertFalse(haveCar, network.message(param, BasicConfig.CUSTOMERDETAIL, "客户资料内容有误", response.body().asString()));
Assert.assertTrue(haveHouse, network.message(param, BasicConfig.CUSTOMERDETAIL, "客户资料内容有误", response.body().asString()));
Assert.assertTrue(birthRemind, network.message(param, BasicConfig.CUSTOMERDETAIL, "客户资料内容有误", response.body().asString()));
}
// 客户详情页_留言
@Test(description = "客户详情页_留言", priority = 42)
public void 客户详情页_留言() throws IOException{
// 判断销售员是否首次访问新功能(留言)
param = new HashMap<>();
param.put("type", 20);
response = network.getResponse(param, BasicConfig.NEWFUNC_FIRSTVISIT);
boolean data =response.jsonPath().getBoolean("data");
Assert.assertFalse(data, network.message(param, BasicConfig.NEWFUNC_FIRSTVISIT, "判断错误,用户非首次访问", response.body().asString()));
}
// 客户详情页_留言_发送消息
@Test(description = "客户详情页_留言_发送消息", priority = 43)
public void 客户详情页_留言_发送消息() throws IOException{
param = new HashMap<>();
param.put("content", "Hello");
param.put("role", "1");
param.put("sessionId", sessionId);
response= network.postResponse(param, BasicConfig.CHAT_SEND);
Assert.assertEquals(response.jsonPath().getString("desc"), "OK", network.message(param, BasicConfig.CHAT_SEND, "消息发送失败", response.body().asString()));
}
// 客户详情页_留言_聊天内容
@Test(description = "客户详情页_留言_聊天内容", priority = 44)
public void 客户详情页_留言_聊天内容() throws IOException{
param = new HashMap<>();
param.put("pageSize", 30);
param.put("isPushMessage", true);
param.put("role", 1);
param.put("sessionId", sessionId);
response = network.getResponse(param, BasicConfig.CHAT_LIST);
List<ChatList> chatLists = JsonUtil.parseResponseToPageBean(response, ChatList.class);
if(chatLists.size() != 0){
Long senderId = chatLists.get(chatLists.size()-1).getSenderId();
long receiverId = chatLists.get(chatLists.size()-1).getReceiverId();
String content = chatLists.get(chatLists.size()-1).getContent();
Assert.assertEquals(senderId, far.decodeTku(BasicConfig.VISITOR2_TKU).get("sellerId"), network.message(param, BasicConfig.CHAT_LIST, "发送者sellerId错误", response.body().asString()));
Assert.assertEquals(receiverId, visitor1UserId, network.message(param, BasicConfig.CHAT_LIST, "接收者userId错误", response.body().asString()));
Assert.assertEquals(content, "Hello", network.message(param, BasicConfig.CHAT_LIST, "消息内容错误", response.body().asString()));
}else {
Assert.assertTrue(true, network.message(param, BasicConfig.CHAT_LIST, "聊天记录为空", response.body().asString()));
}
}
// 客户详情页_留言_留言对象是否关注公众号
@Test(description = "客户详情页_留言_留言对象是否关注公众号", priority = 45)
public void 客户详情页_留言_留言对象是否关注公众号() throws IOException{
param = new HashMap<>();
param.put("targetSid", far.decodeTku(BasicConfig.VISITOR2_TKU).get("sellerId"));
response = network.getResponse(param, BasicConfig.CHAT_GETSUBSCRIBESTATUS);
int subscribe = response.jsonPath().getInt("data.subscribe");
Assert.assertEquals(subscribe, 1, network.message(param, BasicConfig.CHAT_GETSUBSCRIBESTATUS, "判断用户是否关注公众号失败", response.body().asString()));
}
// 还原用户信息
@AfterClass
public void tearDown() throws IOException{
// 关闭生日提醒
param = new HashMap<>();
param.put("birthRemind", false);
param.put("birthday", "07-31");
param.put("userId", String.valueOf(visitor1UserId));
response = network.postResponse(param, BasicConfig.UPDATEBIRTHREMIND);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.UPDATEBIRTHREMIND, "关闭生日提醒失败", response.body().asString()));
// 清空备注和备忘录内容
param.clear();
List<String> tagIds = new ArrayList<>();
param.put("custUserId", String.valueOf(visitor1UserId));
param.put("memo", "");
param.put("remarkName", "");
param.put("tagIds", tagIds);
response = network.postResponse(param, BasicConfig.UPDATETAGANDMEMO);
data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.UPDATETAGANDMEMO, "清空备忘录内容失败", response.body().asString()));
// 清空更多资料
param.clear();
param.put("age", "");
param.put("birthday", "07-31");
param.put("birthdayType", 2);
param.put("custArea", "");
param.put("custCity", "北区");
param.put("custPhone", "");
List<Object> baseMaterial = new ArrayList<>();
List<Object> otherMaterial = new ArrayList<>();
Map<String, List<Object>> extraMaterial = new HashMap<>();
extraMaterial.put("baseMaterial", baseMaterial);
extraMaterial.put("otherMaterial", otherMaterial);
param.put("extraMaterial", extraMaterial);
param.put("familyStatus", "");
param.put("healthStatus", "");
param.put("insuranceBuyStatus", "");
param.put("remarkName", "");
param.put("userId", String.valueOf(visitor1UserId));
param.put("yearIncome", "");
response = network.postResponse(param, BasicConfig.UPDATECUSTMATERIAL);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.UPDATECUSTMATERIAL, "清空更多资料失败", response.body().asString()));
}
public Long roundUpToGetCurrentTimestamp(){
// 向上取整获取当前时间戳(半小时为单位)
Date current = new Date();
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.setTime(current);
int minute = calendar.get(Calendar.MINUTE);
if(minute <= 30){
calendar.set(Calendar.MILLISECOND, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MINUTE, 30);
}else {
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
calendar.set(Calendar.MINUTE, 30);
calendar.add(Calendar.HOUR, 1);
}
Date AfterChange = calendar.getTime();
return AfterChange.getTime();
}
}
......@@ -4,7 +4,6 @@ import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.utils.BaseUtils;
import io.restassured.response.Response;
import org.apache.groovy.json.internal.IO;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
......@@ -27,8 +26,7 @@ public class MyForward implements Authorization {
public void setUp() throws IOException {
// 登陆管理后台
BaseUtils.ssoLogin();
// 代理人授权
agentTku();
visitor2Tku();
far = new ForwardAndRead();
// 关闭数据看板演示数据
......@@ -237,10 +235,9 @@ public class MyForward implements Authorization {
param.put("pageSize", 20);
param.put("type", 4);
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()));
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()));
Assert.assertEquals(encodeUserId, visitorEncodeUserId, network.message(param, FORWARD_VISITRECORD, "筛选结果首条记录userId与预期不符", response.body().asString()));
}
// 获取素材转发关系链
......
package com.kjj.cases.assistant.whoSawMe;
import com.beust.jcommander.internal.Lists;
import com.kjj.bean.whoSawMe.ArticlePage;
import com.kjj.bean.whoSawMe.RankingList;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.utils.BaseUtils;
import com.kjj.utils.JsonUtil;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
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 static com.kjj.config.BasicConfig.AGENT_TKU;
import static com.kjj.config.BasicConfig.BOSS_EDITCONFIG;
public class WhoSawMe implements Authorization {
private Response response;
private Map<String, Object> param;
private ForwardAndRead far;
private Long xxxSellerId;
private Long childSellerId;
private Long clueId;
private Long xxrUserId;
private Long jjSellerId;
private String tagId0;
private String contentId;
private Integer taskId;
@BeforeClass
public void setUp() throws IOException {
// 代理人授权
agentTku();
visitor2Tku();
BaseUtils.ssoLogin();
far = new ForwardAndRead();
......@@ -44,7 +52,7 @@ public class WhoSawMe implements Authorization {
param.put("vipGuideType", 2);
response = network.getResponse(param, BasicConfig.HOST + "/kjy/mp/rookieGuide/isNewVipByType");
Boolean success = response.jsonPath().getBoolean("success");
Assert.assertEquals(success, Boolean.TRUE, network.message(BasicConfig.HOST + "/kjy/mp/rookieGuide/isNewVipByType", "判断代理人是否新会员失败", response.body().asString()));
Assert.assertEquals(success, Boolean.TRUE, network.message(BasicConfig.HOST + "/kjy/mp/rookieGuide/isNewVipByType", "接口请求失败", response.body().asString()));
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(BasicConfig.HOST + "/kjy/mp/rookieGuide/isNewVipByType", "新老会员判断错误,预期为新会员判断为老会员", response.body().asString()));
}
......@@ -54,9 +62,9 @@ public class WhoSawMe implements Authorization {
// 获取代理人用户信息
response = network.getResponse(BasicConfig.USER_INFO);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(BasicConfig.USER_INFO, "获取代理人用户信息失败", response.body().asString()));
String wxName = response.jsonPath().getString("data.wxName");
Assert.assertEquals(wxName, BasicConfig.WECHAT_NAME, network.message(BasicConfig.USER_INFO, "代理人微信昵称获取有误,预期为" + BasicConfig.WECHAT_NAME, response.body().asString()));
Assert.assertTrue(success, network.message(BasicConfig.USER_INFO, "接口请求失败", response.body().asString()));
Long userId = response.jsonPath().getLong("data.userId");
Assert.assertEquals(userId, far.decodeTku(BasicConfig.VISITOR2_TKU).get("userId"), network.message(BasicConfig.USER_INFO, "代理人userId与预期不符", response.body().asString()));
}
// 获取当前页面Tips
......@@ -67,95 +75,105 @@ public class WhoSawMe implements Authorization {
String page = "who_saw_me";
param.put("page", page);
response = network.getResponse(param, BasicConfig.GETTIPSBYPAGE);
Object data = response.jsonPath().getJsonObject("data");
Boolean isShowTips = response.jsonPath().getBoolean("data.isShowTips");
Integer jumpType = response.jsonPath().getInt("data.jumpType");
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(BasicConfig.GETTIPSBYPAGE, "获取当前页面tips失败", response.body().asString()));
Assert.assertNotNull(data, network.message(BasicConfig.GETTIPSBYPAGE, "获取当前页面tips失败", response.body().asString()));
Assert.assertNotNull(isShowTips, network.message(BasicConfig.GETTIPSBYPAGE, "获取isShowTips值失败", response.body().asString()));
Assert.assertNotNull(jumpType, network.message(BasicConfig.GETTIPSBYPAGE, "获取跳转类型失败", response.body().asString()));
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(BasicConfig.GETTIPSBYPAGE, "接口请求失败", response.body().asString()));
Object id = response.jsonPath().getJsonObject("data.id");
Assert.assertNotNull(id, network.message(param, BasicConfig.GETTIPSBYPAGE, "获取页面Tips失败", response.body().asString()));
}
// 查询代理人当前使用版本
@Test(description = "首页_查询使用版本", priority = 4)
public void 查询代理人当前使用版本() throws IOException {
param = new HashMap<>();
String sellerIdEncode = far.encodeId((Long)far.getUserInfo(AGENT_TKU).get("sellerId"));
xxxSellerId = far.decodeTku(BasicConfig.VISITOR2_TKU).get("sellerId");
String sellerIdEncode = far.encodeId(xxxSellerId);
param.put("sellerId", sellerIdEncode);
response = network.getResponse(param, BasicConfig.USING_VERSION);
String userVersion = response.jsonPath().getString("data.userVersion");
Assert.assertEquals(userVersion, "2", network.message(BasicConfig.USING_VERSION, "代理人当前使用版本错误,实际为2.保险专业版", response.body().asString()));
}
// 判断是否展示续费弹窗
@Test(description = "判断是否展示续费弹窗", priority = 6)
@Test(description = "判断是否展示续费弹窗", priority = 5)
public void 判断是否展示续费弹窗() throws IOException{
// 判断是否展示续费弹窗
response = network.getResponse(BasicConfig.LAYER_RENEW);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(BasicConfig.LAYER_RENEW, "接口请求失败", response.body().asString()));
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(BasicConfig.LAYER_RENEW, "判断是否展示续费弹窗失败,data为空", response.body().asString()));
}
// 判断是否展示邀请弹窗
@Test(description = "展示邀请活动弹窗", priority = 7)
@Test(description = "展示邀请活动弹窗", priority = 6)
public void 展示邀请活动弹窗() throws IOException {
// 邀请活动弹窗
response = network.getResponse(BasicConfig.DISTRIBUTION_LAYER);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(BasicConfig.DISTRIBUTION_LAYER, "接口请求失败", response.body().asString()));
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success, network.message(BasicConfig.DISTRIBUTION_LAYER, "判断是否展示邀请活动弹窗失败", response.body().asString()));
Assert.assertNotNull(data, network.message(BasicConfig.DISTRIBUTION_LAYER, "判断是否展示邀请活动弹窗失败,data为空", response.body().asString()));
}
// 判断是否展示线索页新手引导
@Test(description = "获取线索页新手引导", priority = 8)
@Test(description = "获取线索页新手引导", priority = 7)
public void 获取线索页新手引导() throws IOException {
// 获取线索页新手引导
response = network.getResponse(BasicConfig.ROOKIECLUEGUIDE);
Boolean showClueGuide = response.jsonPath().getBoolean("data.showClueGuide");
Object showClueGuide = response.jsonPath().getJsonObject("data.showClueGuide");
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(BasicConfig.ROOKIECLUEGUIDE, "接口请求失败", response.body().asString()));
Assert.assertNotNull(response.jsonPath().getJsonObject("data"), network.message(BasicConfig.ROOKIECLUEGUIDE, "获取线索页新手引导失败", response.body().asString()));
Assert.assertNotNull(showClueGuide, network.message(BasicConfig.ROOKIECLUEGUIDE, "获取showClueGuide值失败", response.body().asString()));
}
// 获取周报首页数据
@Test(description = "获取周报首页数据", priority = 9)
@Test(description = "获取周报首页数据", priority = 8)
public void 获取周报首页数据() throws IOException{
// 获取周报首页数据
response = network.getResponse(BasicConfig.SELLERWEEKLY);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success, network.message(BasicConfig.SELLERWEEKLY, "接口请求失败", response.body().asString()));
Assert.assertNotNull(data, network.message(BasicConfig.SELLERWEEKLY, "获取周报首页数据失败", response.body().asString()));
}
// 获取代理人标签列表
@Test(description = "获取代理人标签列表", priority = 10)
public void 获取代理人标签列表() throws IOException {
// 获取代理人标签列表
response = network.getResponse(BasicConfig.HOST + "/kjy/mp/sellerTag/getTagList");
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(BasicConfig.HOST + "/kjy/mp/sellerTag/getTagList", "接口请求失败", response.body().asString()));
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(BasicConfig.HOST + "/kjy/mp/sellerTag/getTagList", "获取代理人标签列表失败", response.body().asString()));
Assert.assertNotNull(data, network.message(BasicConfig.SELLERWEEKLY, "获取周报首页数据失败", response.body().asString()));
}
// 获取首页来访统计
@Test(description = "获取谁看过我首页来访统计", priority = 11)
@Test(description = "获取谁看过我首页来访统计", priority = 10)
public void 来访统计() throws IOException{
response = network.getResponse(BasicConfig.VISITHEADER);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(BasicConfig.VISITHEADER, "接口请求失败", response.body().asString()));
int todayClueNum = response.jsonPath().getInt("data.todayClueNum");
int todayVisitNum = response.jsonPath().getInt("data.todayVisitNum");
Assert.assertTrue(todayClueNum >= 1, network.message(BasicConfig.VISITHEADER, "获取今日线索数小于1", response.body().asString()));
Assert.assertTrue(todayVisitNum >= 1, network.message(BasicConfig.VISITHEADER, "获取今日访问数小于1", response.body().asString()));
Assert.assertTrue(todayClueNum >= 2, network.message(BasicConfig.VISITHEADER, "获取今日线索数有误", response.body().asString()));
Assert.assertTrue(todayVisitNum >= 2, network.message(BasicConfig.VISITHEADER, "获取今日访问数有误", response.body().asString()));
}
// 查看谁看过我首页我的访客列表
@Test(description = "查看我的访客列表", priority = 11)
public void 查看我的访客列表() throws IOException{
List<Object> customerTagIds = Lists.newArrayList();
param = new HashMap<>();
param.put("customerTagIds", customerTagIds);
param.put("lastClueId", 0);
param.put("listType", 1);
param.put("pageSize", 20);
response = network.postResponse(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "接口请求失败", response.body().asString()));
String visitorWxName = response.jsonPath().getString("data.list[0].nickName");
Assert.assertEquals(visitorWxName, far.getUserInfo(BasicConfig.VISITOR1_TKU).get("wxName"), network.message(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "访客微信昵称不匹配", response.body().asString()));
clueId = response.jsonPath().getLong("data.list[0].clueId");
}
// 获取代理人标签列表
@Test(description = "获取代理人标签列表", priority = 12)
public void 获取代理人标签列表() throws IOException{
response = network.getResponse(BasicConfig.TAG_GETLIST);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TAG_GETLIST, "接口请求失败", response.body().asString()));
tagId0 = response.jsonPath().getString("data[0].id");
Assert.assertNotNull(tagId0, network.message(BasicConfig.TAG_GETLIST, "标签id为null", response.body().asString()));
}
// 进入运营周报首页
@Test(description = "进入运营周报首页", priority = 12)
@Test(description = "进入运营周报首页", priority = 13)
public void 进入运营周报首页() throws IOException{
response = network.getResponse(BasicConfig.WEEKLY_LIST);
boolean success = response.jsonPath().getBoolean("success");
......@@ -163,27 +181,35 @@ public class WhoSawMe implements Authorization {
}
// 进入团队看板首页
@Test(description = "进入团队看板首页", priority = 13)
@Test(description = "进入团队看板首页", priority = 14)
public void 进入团队看板首页() throws IOException{
// 获取当前页面Tips
param.clear();
param.put("page", "data_board");
response = network.getResponse(param, BasicConfig.GETTIPSBYPAGE);
boolean success = response.jsonPath().getBoolean("success");
String tipsContent = response.jsonPath().getString("data.tipsContent");
Assert.assertTrue(success, network.message(BasicConfig.GETTIPSBYPAGE, "接口请求失败", response.body().asString()));
String tipsContent = response.jsonPath().getString("data.tipsContent");
Assert.assertEquals(tipsContent, "数据看板-tips", network.message(param, BasicConfig.GETTIPSBYPAGE, "当前页面Tips错误,实际为 数据看板", response.body().asString()));
// 获取我的上级名称
param.clear();
param.put("sellerId", far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("sellerId", xxxSellerId);
response = network.getResponse(param, BasicConfig.BOSS_BOSS);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(BasicConfig.BOSS_BOSS, "获取上级名称失败", response.body().asString()));
Assert.assertTrue(success, network.message(BasicConfig.BOSS_BOSS, "接口请求失败", response.body().asString()));
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNull(data, network.message(param, BasicConfig.BOSS_BOSS, "代理人上级名称不为空", response.body().asString()));
// 获取当前使用版本
response = network.getResponse(BasicConfig.version_info);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(BasicConfig.version_info, "接口请求失败", response.body().asString()));
int userVersion = response.jsonPath().getInt("data[0].userVersion");
Assert.assertEquals(userVersion, 2, network.message(BasicConfig.version_info, "获取版本错误", response.body().asString()));
}
// 邀请成员加入团队
@Test(description = "生成团队邀请码", priority = 14)
@Test(description = "生成团队邀请码", priority = 15)
public void 生成团队邀请码() throws IOException{
Integer inviteType = 2;
param = new HashMap<>();
......@@ -193,11 +219,10 @@ public class WhoSawMe implements Authorization {
Assert.assertNotNull(data, network.message(param, BasicConfig.BOSS_CODE, "获取团队邀请码失败", response.body().asString()));
}
@Test(description = "其他代理人加入该代理人团队", priority = 15)
@Test(description = "其他代理人加入该代理人团队", priority = 16)
public void 邀请加入团队() throws IOException{
// 切换代理人加入团队
Long sellerId = (Long)far.getUserInfo(AGENT_TKU).get("sellerId");
network.agentCookies.put("tku", BasicConfig.VISITOR1_TKU);
network.agentCookies.put("tku", BasicConfig.AGENT_TKU);
// 确定被邀请代理人没有上级
response = network.getResponse(BasicConfig.BOSS_ROLE);
......@@ -206,51 +231,203 @@ public class WhoSawMe implements Authorization {
// 代理人加入团队
param = new HashMap<>();
param.put("inviterSid", sellerId);
param.put("inviterSid", far.decodeTku(BasicConfig.VISITOR2_TKU).get("sellerId"));
param.put("inviteType", 2);
response = network.getResponse(param, BasicConfig.BOSS_BOUND);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(param, BasicConfig.BOSS_BOUND, "接口请求失败", response.body().asString()));
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.BOSS_BOUND, "添加代理人进入团队失败", response.body().asString()));
network.agentCookies.put("tku", BasicConfig.AGENT_TKU);
network.agentCookies.put("tku", BasicConfig.VISITOR2_TKU);
}
@Test(description = "查看被邀请代理人上级名称", priority = 16)
@Test(description = "查看被邀请代理人上级名称", priority = 17)
public void 查看上级名称() throws IOException{
// 获取被邀请代理人sellerId
childSellerId = far.decodeTku(BasicConfig.VISITOR1_TKU).get("sellerId");
childSellerId = far.decodeTku(BasicConfig.AGENT_TKU).get("sellerId");
param = new HashMap<>();
param.put("sellerId", childSellerId);
response = network.getResponse(param, BasicConfig.BOSS_BOSS);
String bossName = response.jsonPath().getString("data");
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_BOSS, "接口请求失败", response.body().asString()));
Assert.assertEquals(bossName, BasicConfig.WECHAT_NAME, network.message(param, BasicConfig.BOSS_BOSS, "被邀请人上级名称与邀请人不一致", response.body().asString()));
Assert.assertEquals(bossName, far.getUserInfo(BasicConfig.VISITOR2_TKU).get("wxName"), network.message(param, BasicConfig.BOSS_BOSS, "被邀请人上级名称与邀请人不一致", response.body().asString()));
}
// 获取代理人团队信息
@Test(description = "代理人团队信息", priority = 19)
public void 代理人团队信息() throws IOException{
param = new HashMap<>();
param.put("sellerId", xxxSellerId);
response = network.getResponse(param, BasicConfig.BOSS_ROLE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_ROLE, "接口请求失败", response.body().asString()));
boolean hasSubordinate = response.jsonPath().getBoolean("data.hasSubordinate");
int teamNumber = response.jsonPath().getInt("data.teamNumber");
Assert.assertTrue(hasSubordinate, network.message(param, BasicConfig.BOSS_ROLE, "代理人查询无下级", response.body().asString()));
Assert.assertEquals(teamNumber, 2, network.message(param, BasicConfig.BOSS_ROLE, "代理人团队人数有误", response.body().asString()));
}
// 代理人团队成员数
@Test(description = "代理人团队成员数", priority = 20)
public void 代理人团队成员数() throws IOException{
param = new HashMap<>();
param.put("superiorId", xxxSellerId);
response = network.getResponse(param, BasicConfig.TEAMMEMBERNUM);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMMEMBERNUM, "接口请求失败", response.body().asString()));
int personalNum = response.jsonPath().getInt("data.personalNum");
Assert.assertEquals(personalNum, 2, network.message(param, BasicConfig.TEAMMEMBERNUM, "代理人团队人数有误", response.body().asString()));
}
// 获取个人排行列表
@Test(description = "获取个人排行列表", priority = 22)
public void 获取个人排行列表() throws IOException{
param= new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sortType", 4);
param.put("superiorId", xxxSellerId);
param.put("listType", 4);
param.put("team", false);
response = network.getResponse(param, BasicConfig.TEAMRANKINGLIST);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMRANKINGLIST, "接口请求失败", response.body().asString()));
List<RankingList> rankingLists = JsonUtil.parseResponseToPageBean(response, RankingList.class);
List<String> memberSids = Lists.newArrayList();
memberSids.add(far.encodeId(xxxSellerId));
memberSids.add(far.encodeId(far.decodeTku(BasicConfig.AGENT_TKU).get("sellerId")));
Assert.assertTrue(rankingLists.size() >= 2, network.message(param, BasicConfig.TEAMRANKINGLIST, "排行榜人员数有误", response.body().asString()));
for (int i = 0; i < rankingLists.size(); i++){
boolean isExist = memberSids.contains(rankingLists.get(i).getSellerId());
Assert.assertTrue(isExist, network.message(param, BasicConfig.TEAMRANKINGLIST, "排行榜内成员sid有误", response.body().asString()));
}
}
// 团队架构
// 团队架构_当前代理人身份
@Test(description = "团队架构_当前代理人身份", priority = 21)
public void 团队架构_当前代理人身份() throws IOException{
param = new HashMap<>();
param.put("sellerId", xxxSellerId);
response = network.getResponse(param, BasicConfig.TEAMSTRUCTURE_IDENTITY);
int identity = response.jsonPath().getInt("data.identity");
Assert.assertEquals(identity, 1, network.message(param, BasicConfig.TEAMSTRUCTURE_IDENTITY, "当前代理人身份判断错误", response.body().asString()));
}
@Test(description = "删除团队成员", priority = 17)
public void 删除团队成员() throws IOException{
// 登陆管理后台调用管理后台接口删除成员
// 团队架构_搜索成员
@Test(description = "团队架构_搜索成员", priority = 22)
public void 团队架构_搜索成员() throws IOException{
jjSellerId = far.decodeTku(BasicConfig.AGENT_TKU).get("sellerId");
param = new HashMap<>();
param.put("superiorSid", far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("childSid", childSellerId);
response = network.postResponse(param, BasicConfig.MANAGER_removeMember);
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.MANAGER_removeMember, "删除成员失败", response.body().asString()));
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, far.encodeId(jjSellerId), network.message(param, BasicConfig.MEMBERSEARCH, "搜索结果错误", response.body().asString()));
}
// 团队架构_删除团队成员
@Test(description = "团队架构_删除团队成员", priority = 100)
public void 团队架构_删除团队成员() throws IOException{
List<String> sids = new ArrayList<>();
sids.add(far.encodeId(childSellerId));
param = new HashMap<>();
param.put("sids", sids);
response = network.postResponse(param, BasicConfig.MEMBERREMOVE);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.MEMBERREMOVE, "删除成员失败", response.body().asString()));
// 切换到被删除代理人确认已没有上级
network.agentCookies.put("tku", BasicConfig.VISITOR1_TKU);
// 检查被删除成员是否有上级
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()));
Assert.assertFalse(hasSuperior, network.message(param, BasicConfig.BOSS_ROLE, "成员仍有上级", response.body().asString()));
}
// 团队任务
// 新建任务_选择素材
@Test(description = "新建任务_选择素材", priority = 23)
public void 新建任务_选择素材() throws IOException{
param = new HashMap<>();
param.put("contentType", "article");
param.put("pageIndex", 1);
param.put("pageSize", 20);
response = network.getResponse(param, BasicConfig.FINDPAGEBYCONTENTTYPE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.FINDPAGEBYCONTENTTYPE, "接口请求失败", response.body().asString()));
List<ArticlePage> articlePages = JsonUtil.parseResponseToPageBean(response, ArticlePage.class);
for(int i = 0; i < articlePages.size(); i++){
String contentType = articlePages.get(i).getContentType();
Assert.assertEquals(contentType, "article", network.message(param, BasicConfig.FINDPAGEBYCONTENTTYPE, "素材类型错误", response.body().asString()));
}
contentId = articlePages.get(0).getContentId();
}
// 新建任务_创建任务
@Test(description = "新建任务_创建任务", priority = 24)
public void 新建任务_创建任务() throws IOException{
String scid = far.getContentScId(contentId);
param = new HashMap<>();
param.put("scid", scid);
response = network.postResponse(param, BasicConfig.BOSS_CREATE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_CREATE, "接口请求失败", response.body().asString()));
taskId = response.jsonPath().getInt("data");
Assert.assertNotNull(taskId, network.message(param, BasicConfig.BOSS_CREATE, "返回taskId为空", response.body().asString()));
}
network.agentCookies.put("tku", AGENT_TKU);
// 新建任务_任务详情
@Test(description = "新建任务_任务详情", priority = 25)
public void 新建任务_任务详情() throws IOException{
param = new HashMap<>();
param.put("taskId", taskId);
response = network.getResponse(param, BasicConfig.BOSS_DETAIL);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_DETAIL, "接口请求失败", response.body().asString()));
}
// 新建任务_可推送成员
@Test(description = "新建任务_可推送成员", priority = 26)
public void 新建任务_可推送成员() throws IOException{
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 20);
param.put("sellerId", xxxSellerId);
response = network.getResponse(param, BasicConfig.TEAMMEMBER);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMMEMBER, "接口请求失败", response.body().asString()));
int totalCount = response.jsonPath().getInt("data.totalCount");
String sellerId = response.jsonPath().getString("data.list["+(totalCount-1)+"].sellerId");
Assert.assertEquals(totalCount, 1, network.message(param, BasicConfig.TEAMMEMBER, "可推送成员数有误", response.body().asString()));
Assert.assertEquals(sellerId, far.encodeId(jjSellerId), network.message(param, BasicConfig.TEAMMEMBER, "可推送成员sellerId有误", response.body().asString()));
}
// 新建任务_推送任务
@Test(description = "新建任务_推送任务", priority = 27)
public void 新建任务_推送任务() throws IOException{
List<String> sellerIds = Lists.newArrayList();
List<String> superiorIds = Lists.newArrayList();
sellerIds.add(far.encodeId(jjSellerId));
param = new HashMap<>();
param.put("effectiveDuration", 7);
param.put("isAllMen", true);
param.put("sellerIds", sellerIds);
param.put("superiorIds", superiorIds);
param.put("taskId", taskId);
response = network.postResponse(param, BasicConfig.BOSS_PUBLISH);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_PUBLISH, "接口请求失败", response.body().asString()));
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.BOSS_PUBLISH, "推送任务失败", response.body().asString()));
}
// 新建任务_查看任务
@Test(description = "新建任务_查看任务", priority = 28)
public void 新建任务_查看任务() throws IOException{
param = new HashMap<>();
param.put("pageSize", 20);
response = network.getResponse(param, BasicConfig.BOSS_TEAMTASKLIST);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_TEAMTASKLIST, "接口请求失败", response.body().asString()));
}
// 查看今日转发素材列表
@Test(description = "查看今日转发素材列表", priority = 19)
@Test(description = "查看今日转发素材列表", priority = 29)
public void 查看转发素材列表() throws IOException{
param = new HashMap<>();
param.put("sellerId", far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("sellerId", xxxSellerId);
param.put("pageSize", 20);
param.put("pageIndex", 1);
param.put("sortType", 4);
......@@ -261,10 +438,10 @@ public class WhoSawMe implements Authorization {
}
// 查看转发名片记录列表
@Test(description = "查看转发名片记录列表", priority = 21)
@Test(description = "查看转发名片记录列表", priority = 30)
public void 查看转发名片记录列表() throws IOException{
param = new HashMap<>();
param.put("sellerId", far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("sellerId", xxxSellerId);
param.put("pageSize", 20);
param.put("pageIndex", 1);
param.put("sortType", 4);
......@@ -274,7 +451,7 @@ public class WhoSawMe implements Authorization {
}
// 使用工具
@Test(description = "使用工具", priority = 22)
@Test(description = "使用工具", priority = 31)
public void 使用工具() throws IOException{
// 生成抽奖转盘素材scId
String lottery_scId = far.getContentScId(BasicConfig.LOTTERY_CONTENTID);
......@@ -289,10 +466,10 @@ public class WhoSawMe implements Authorization {
}
// 查看使用工具记录列表
@Test(description = "查看使用工具记录列表", priority = 23)
@Test(description = "查看使用工具记录列表", priority = 32)
public void 查看使用工具记录列表() throws IOException{
param = new HashMap<>();
param.put("sellerId", far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("sellerId", xxxSellerId);
param.put("pageSize", 20);
param.put("pageIndex", 1);
param.put("sortType", 4);
......@@ -303,10 +480,10 @@ public class WhoSawMe implements Authorization {
}
// 查看获得线索记录列表
@Test(description = "查看获得线索记录列表", priority = 24)
@Test(description = "查看获得线索记录列表", priority = 33)
public void 查看获得线索记录列表() throws IOException{
param = new HashMap<>();
param.put("sellerId", far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("sellerId", xxxSellerId);
param.put("pageSize", 20);
param.put("pageIndex", 1);
param.put("sortType", 4);
......@@ -317,11 +494,11 @@ public class WhoSawMe implements Authorization {
}
// 查看转发动态访问列表
@Test(description = "查看转发动态访问列表", priority = 25)
public void 查看转发动态访问列表() throws IOException{
@Test(description = "查看转发素材访问列表", priority = 34)
public void 查看转发素材访问列表() throws IOException{
// 获取首条素材列表中首条动态id
param = new HashMap<>();
param.put("sellerId", far.getUserInfo(AGENT_TKU).get("sellerId"));
param.put("sellerId", xxxSellerId);
param.put("pageSize", 20);
param.put("pageIndex", 1);
param.put("sortType", 4);
......@@ -336,18 +513,71 @@ public class WhoSawMe implements Authorization {
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.GETVISITLIST, "接口请求失败", response.body().asString()));
}
// 查看谁看过我首页我的访客列表
@Test(description = "查看我的访客列表", priority = 26)
public void 查看我的访客列表() throws IOException{
List<Object> customerTagIds = Lists.newArrayList();
// 销售线索_新线索引导
@Test(description = "销售线索详情_新线索引导", priority = 35)
public void 销售线索详情_新线索引导() throws IOException{
param = new HashMap<>();
param.put("customerTagIds", customerTagIds);
param.put("lastClueId", 0);
param.put("listType", 1);
param.put("pageSize", 20);
response = network.postResponse(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "接口请求失败", response.body().asString()));
String visitorWxName = response.jsonPath().getString("data.list[0].nickName");
Assert.assertEquals(visitorWxName, far.getUserInfo(BasicConfig.VISITOR1_TKU).get("wxName"), network.message(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "访客微信昵称不匹配", response.body().asString()));
param.put("guideType", 34);
response = network.postResponse(param, BasicConfig.COMPLETEGUIDE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.COMPLETEGUIDE, "接口请求失败", response.body().asString()));
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.COMPLETEGUIDE, "完成该引导失败", response.body().asString()));
}
// 销售线索_线索详情
@Test(description = "销售线索_线索详情", priority = 36)
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 visitClueType = response.jsonPath().getInt("data.visitClueType");
Long custUserId = response.jsonPath().getLong("data.custUserId");
String contentScid = response.jsonPath().getString("data.fromContent.scid");
Assert.assertEquals(visitClueType, 31, network.message(param, BasicConfig.CLUEINFO, "线索类型错误", response.body().asString()));
Assert.assertEquals(custUserId, far.decodeTku(BasicConfig.VISITOR1_TKU).get("userId"), network.message(param, BasicConfig.CLUEINFO, "线索来源访客userId错误", response.body().asString()));
Assert.assertEquals(contentScid, far.getContentScId(BasicConfig.ARTICLE_CONTENTID), network.message(param, BasicConfig.CLUEINFO, "线索来源素材id错误", response.body().asString()));
}
// 销售线索_跟进建议
@Test(description = "销售线索_跟进建议", priority = 37)
public void 销售线索_跟进建议() throws IOException{
param = new HashMap<>();
param.put("clueId", clueId);
response = network.getResponse(param, BasicConfig.CLUEADVISE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CLUEADVISE, "接口请求失败", response.body().asString()));
List<Object> adviseList = response.jsonPath().getJsonObject("data.adviceList");
Assert.assertNotNull(adviseList, network.message(param, BasicConfig.CLUEADVISE, "跟进建议内容为空", response.body().asString()));
}
// 管理客户信息
@Test(description = "管理客户信息", priority = 38)
public void 管理客户信息() throws IOException{
xxrUserId = far.decodeTku(BasicConfig.VISITOR1_TKU).get("userId");
List<String> tagIds = Lists.newArrayList();
tagIds.add(tagId0);
param = new HashMap<>();
param.put("custUserId", xxrUserId);
param.put("memo", "备忘录");
param.put("remarkName", "备注");
param.put("tagIds", tagIds);
response = network.postResponse(param, BasicConfig.UPDATETAGANDMEMO);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.UPDATETAGANDMEMO, "接口请求失败", response.body().asString()));
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.UPDATETAGANDMEMO, "更新客户信息失败", response.body().asString()));
}
// 销售线索_获取访客管理信息
@Test(description = "销售线索_获取访客管理信息", priority = 39)
public void 销售线索_获取访客管理信息() throws IOException{
String encodeUserId = far.encodeId(xxrUserId);
param = new HashMap<>();
param.put("userId", encodeUserId);
response = network.getResponse(param, BasicConfig.GETCUSTAGANDMEMO);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.GETCUSTAGANDMEMO, "接口请求失败", response.body().asString()));
String memo = response.jsonPath().getString("data.memo");
String remarkName = response.jsonPath().getString("data.remarkName");
boolean tagIsMark = response.jsonPath().getBoolean("data.tagList[0].isMark");
Assert.assertEquals(memo, "备忘录", network.message(param, BasicConfig.GETCUSTAGANDMEMO, "用户备忘录内容错误", response.body().asString()));
Assert.assertEquals(remarkName, "备注", network.message(param, BasicConfig.GETCUSTAGANDMEMO, "用户备注错误", response.body().asString()));
Assert.assertTrue(tagIsMark, network.message(param, BasicConfig.GETCUSTAGANDMEMO, "用户标签错误", response.body().asString()));
}
}
......@@ -247,8 +247,5 @@ public class Novice {
return scId;
}
@AfterClass
public static void tearDown(){
apiCount += 6;
}
}
......@@ -1420,6 +1420,8 @@ public class SaveLive implements Authorization {
Params.put("num",2);
Params.put("showAmount",1000);
Params.put("showMaxAmount",1000);
Params.put("poolType",1);
Params.put("freeNum",1);
Response response = network.postResponse(Params, BasicConfig.MANAGER_flipWord);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
......@@ -2078,7 +2080,6 @@ public class SaveLive implements Authorization {
boolean preLayerConfStatus = response.jsonPath().getBoolean("data.preLayerConfStatus");
System.out.println(preLayerConfStatus);
Assert.assertTrue(preLayerConfStatus, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未配置预告页弹窗", response.body().asString()));
boolean preLayerOpenStatus = response.jsonPath().getBoolean("data.preLayerOpenStatus");
System.out.println(preLayerOpenStatus);
Assert.assertTrue(preLayerOpenStatus, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未开启预告页弹窗", response.body().asString()));
......@@ -2086,9 +2087,209 @@ public class SaveLive implements Authorization {
}
/**
* 授权弹窗
*/
@Test(description = "查看授权弹窗配置状态", priority = 113)
public void 查看授权弹窗配置状态() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(Params, BasicConfig.MANAGER_getConfDetail);
boolean hasConfAuthPopup = response.jsonPath().getBoolean("data.hasConfAuthPopup");
System.out.println(hasConfAuthPopup);
Assert.assertTrue(hasConfAuthPopup, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未配置预告页弹窗", response.body().asString()));
}
@Test(description = "授权弹窗配置_直播抽奖", priority = 114)
public void 授权弹窗配置_直播抽奖() {
//新增弹窗
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene",1);
Params.put("phoneImg","https://yun.dui88.com/kjy/image/20210729/1627545956366.png");
Response response = network.postResponse(Params, BasicConfig.MANAGER_popupSave);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_popupSave, "直播抽奖授权弹窗新增失败", response.body().asString()));
}
//查询配置详情
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene",1);
response = network.getResponse(Params, BasicConfig.MANAGER_popupDetail);
int popupScene = response.jsonPath().getInt("data.popupScene");
System.out.println(response.body().asString());
Assert.assertTrue(popupScene==1, network.message(Params, BasicConfig.MANAGER_popupDetail, "直播抽奖授权弹窗ID查询为null", response.body().asString()));
}
@Test(description = "授权弹窗配置_裂变宝箱", priority = 115)
public void 授权弹窗配置_裂变宝箱() {
//新增弹窗
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene", 2);
Params.put("phoneImg", "https://yun.dui88.com/kjy/image/20210729/1627547133623.png");
Response response = network.postResponse(Params, BasicConfig.MANAGER_popupSave);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_popupSave, "裂变宝箱授权弹窗新增失败", response.body().asString()));
//查询配置详情
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene", 2);
response = network.getResponse(Params, BasicConfig.MANAGER_popupDetail);
int popupScene = response.jsonPath().getInt("data.popupScene");
System.out.println(response.body().asString());
Assert.assertTrue(popupScene==2, network.message(Params, BasicConfig.MANAGER_popupDetail, "裂变宝箱授权弹窗ID查询为null", response.body().asString()));
}
@Test(description = "授权弹窗配置_翻牌集字", priority = 116)
public void 授权弹窗配置_翻牌集字() {
//新增弹窗
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene", 3);
Params.put("phoneImg", "https://yun.dui88.com/kjy/image/20210729/1627547271114.png");
Response response = network.postResponse(Params, BasicConfig.MANAGER_popupSave);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_popupSave, "翻牌集字授权弹窗新增失败", response.body().asString()));
//查询配置详情
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene", 3);
response = network.getResponse(Params, BasicConfig.MANAGER_popupDetail);
int popupScene = response.jsonPath().getInt("data.popupScene");
System.out.println(response.body().asString());
Assert.assertTrue(popupScene==3, network.message(Params, BasicConfig.MANAGER_popupDetail, "翻牌集字授权弹窗ID查询为null", response.body().asString()));
}
@Test(description = "授权弹窗配置_手气王红包", priority = 117)
public void 授权弹窗配置_手气王红包() {
//新增弹窗
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene", 4);
Params.put("phoneImg", "https://yun.dui88.com/kjy/image/20210729/1627547406299.png");
Response response = network.postResponse(Params, BasicConfig.MANAGER_popupSave);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_popupSave, "手气王授权弹窗新增失败", response.body().asString()));
//查询配置详情
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene", 4);
response = network.getResponse(Params, BasicConfig.MANAGER_popupDetail);
int popupScene = response.jsonPath().getInt("data.popupScene");
System.out.println(response.body().asString());
Assert.assertTrue(popupScene==4, network.message(Params, BasicConfig.MANAGER_popupDetail, "手气王授权弹窗ID查询为null", response.body().asString()));
}
@Test(description = "授权弹窗配置_猜数字红包", priority = 118)
public void 授权弹窗配置_猜数字红包() {
//新增弹窗
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene",5);
Params.put("phoneImg", "https://yun.dui88.com/kjy/image/20210729/1627547406299.png");
Response response = network.postResponse(Params, BasicConfig.MANAGER_popupSave);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_popupSave, "猜数红包授权弹窗新增失败", response.body().asString()));
//查询配置详情
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene",5);
response = network.getResponse(Params, BasicConfig.MANAGER_popupDetail);
int popupScene = response.jsonPath().getInt("data.popupScene");
System.out.println(response.body().asString());
Assert.assertTrue(popupScene==5, network.message(Params, BasicConfig.MANAGER_popupDetail, "猜数红包授权弹窗ID查询为null", response.body().asString()));
}
@Test(description = "授权弹窗配置_好运红包", priority = 119)
public void 授权弹窗配置_好运红包() {
//新增弹窗
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene",6);
Params.put("helpImg", "https://yun.dui88.com/kjy/image/20210729/1627547595585.png");
Params.put("phoneImg", "https://yun.dui88.com/kjy/image/20210729/1627547600293.png");
Response response = network.postResponse(Params, BasicConfig.MANAGER_popupSave);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_popupSave, "好运红包授权弹窗新增失败", response.body().asString()));
//查询配置详情
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene",6);
response = network.getResponse(Params, BasicConfig.MANAGER_popupDetail);
int popupScene = response.jsonPath().getInt("data.popupScene");
System.out.println(response.body().asString());
Assert.assertTrue(popupScene==6, network.message(Params, BasicConfig.MANAGER_popupDetail, "好运红包授权弹窗ID查询为null", response.body().asString()));
}
@Test(description = "授权弹窗配置_闯关答题", priority = 120)
public void 授权弹窗配置_闯关答题() {
//新增弹窗
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene",7);
Params.put("helpImg","https://yun.dui88.com/kjy/image/20210729/1627547737805.png");
Params.put("phoneImg","https://yun.dui88.com/kjy/image/20210729/1627547742368.png");
Response response = network.postResponse(Params, BasicConfig.MANAGER_popupSave);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_popupSave, "闯关答题授权弹窗新增失败", response.body().asString()));
//查询配置详情
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("popupScene",7);
response = network.getResponse(Params, BasicConfig.MANAGER_popupDetail);
int popupScene = response.jsonPath().getInt("data.popupScene");
System.out.println(response.body().asString());
Assert.assertTrue(popupScene==7, network.message(Params, BasicConfig.MANAGER_popupDetail, "闯关答题授权弹窗ID查询为null", response.body().asString()));
}
/**
* 准客户
*/
@Test(description = "问题配置", priority = 121)
public void 问题配置() {
//新增问题配置
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("quesList",Arrays.asList("咨询问题一", "咨询问题二","咨询问题三"));
Response response = network.postResponse(Params, BasicConfig.MANAGER_potentialSaveQues);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data,network.message(Params, BasicConfig.MANAGER_potentialSaveQues, "未配置咨询问题", response.body().asString()));
//查询问题列表
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
response=network.getResponse(Params, BasicConfig.MANAGER_potentialQuesList);
System.out.println(response.body().asString());
String quesDesc=response.jsonPath().getString("data[0].quesDesc");
Assert.assertEquals(quesDesc,"咨询问题一",network.message(Params, BasicConfig.MANAGER_potentialSaveQues, "咨询问题详情为null", response.body().asString()));
}
}
package com.kjj.config;
public class BasicConfig {
public static int apiCount; //接口数量统计
// 是否开启钉钉机器人推送
public static final boolean isPushReport =true; //true
// 代理人微信昵称
public static final String WECHAT_NAME = "吉吉";
// 代理人的openid(固定)
public static final String OPEN_ID = "osi5w5ggFiEXk0tPJH9b0KO_XU08";
/**
* 直播账号授权key
*/
//直播管理员(吉吉)
public static String ADMIN_KEY="zFNkBc7JtvLPL6ifAfXbcgXf7k8AofD7jRHCDreREzhP8iW4bahfqRFePosTb9G6ESGPwScVFCQyuZBcc4brtRfaNz";
// 直播代理人 (艳玲)ID:826
......@@ -40,8 +40,8 @@ public class BasicConfig {
public static String visitorAuth12 ="5MgSyboxqzAQZZJEsTf43nVX38FgyAUo2fAxaP2wGJUTHcnhCNQ6xm4rZ8nMSjRk2BTsYwRhe1kABXuFmTA7JsepCEpa";
//直播访客 (大妹子)ID:299
public static String visitorAuth13 ="LEH7epeHVDJWzhZ6DiexTHnsaN9w9oWNN5DjmEBUV6rxQBX1gPqEDy6fBAMhJF4ZNUHR681CqgJaAwkQttsd8aB5WdCDf";
//直播访客 (光头强)ID:540
public static String visitorAuth14 ="LEH7epeHVDJWzhZ6DiexTHnsaN9w9oWNUSEzLEnhXW7GvsDSbF1XDBJeeBRLp1u37nEXDs6aRhV7i8uxwJSKdaMFDutDp";
//直播访客 (光头强)ID:1495
public static String visitorAuth14 ="2Tsc8MwHZmXJKPfze38rXm37UEpohGG4fZ8hUsUgQKTh6dmCmCVsKPv5xnwP7HZcjhZ1LvGYRW9UJQfY6HVxCiytxd8nkk7";
//直播访客 (少侠)ID:788
public static String visitorAuth15 ="LEH7epeHVDJWzhZ6DiexTHnsaN9w9oWNQGsjS7kCzWj4MRh8UEgj65qMf774qQKtXQCskA56o29SkFTd6Zvc82mKjQ2P1";
//直播访客 (抬头有飞碟)ID:99
......@@ -65,25 +65,25 @@ public class BasicConfig {
//直播访客 (亦心)ID:96 实名用户
public static String visitorAuth25 ="5MgSyboxqzAQZZJEsTf43nVX38cJBxsCHATPDDoWL7qHS5PaPehMLbSmTNWgySTMFYevyw9tSxYKVU2VfhR9fW1FrWTk";
//***********************************************************************
/**
* 集客助手授权key
*/
// 基础线代理人 TKU,sid:2991
public static String AGENT_TKU = "T3gM31f18jCFEcfTyJdjfJAfSjDmKNMHfH7CvpLDC6UCLbai6Pc41VyJK3bXHe1wg7Hb5FGFZheeLvHjbE";
// 基础线访客 TKU---"请勿打扰"
public static String VISITOR_TKU = "T3gM31f18jCGvqvoyJRzyMTdpcPDJWUJJP4VQje7p9sfC4HKmj5NJfCUkxusAyFb5SpkWS31srDTYr6KtV";
// 基础线访客(小雪人) TKU
public static String VISITOR1_TKU = "T3gM31f18jCFXzk692pKjJCqJZdDv8Nb3htkzNk983cPMspUQD6pVEn2FNMefM2nieKPicXG9c1tDg8qtN";
// 基础线访客
public static String VISITOR2_TKU = "T3gM31f18jCeKCBVHf5MANgyXeBZGCm8vTJQTuWYXHFqx97PATsWyUYamGaNdNip8bEs9shoE9tTsAmp8x"; // 二度访客用
// 访客的sids
public static final String sids = "Kj21MjMwNTU";
// 访客的userId(固定)--"Su Yi"
public static final int VISITOR_USERID = 4425;
// 访客(SuYi) userID:4425
public static String VISITOR_UserTku = "T3gM31f18jAW2hicRDxbwHFSuwA4MMVLLeHZ5G4yvb3sz6YRdcqKfzRJ8dMnfqDmgS8EprRjhFpXPFLBvp";
// 客集云公众号的oaSourceId(固定)
public static final String OASOURCE_ID = "gh_3b9884c7b0ee";
// 钉钉机器人 线上-告警群
public static final String DINGTALKPATH = "https://oapi.dingtalk.com/robot/send?access_token=f63c9cb36e89dd68e9af82d926933b3afc6544e57b23a3a55ed5b3b772d5e8d2";
public static final String dingTalkPath = "https://oapi.dingtalk.com/robot/send?access_token=f63c9cb36e89dd68e9af82d926933b3afc6544e57b23a3a55ed5b3b772d5e8d2";
// *************** 客集集域名 ***************
public static final String HOST = "https://kjj.m.duibatest.com.cn";
public static final String ACTIVITY_HOST = "https://kjj-activity.duibatest.com.cn";
......@@ -232,6 +232,9 @@ public class BasicConfig {
public static final String MOBILE_result = MOBILE_HOST + "/clue/guess/number/red/result";
public static final String MANAGER_encode = MANAGER_HOST + "/kjy/manager/testUser/encode";
// *************** 宝箱裂变 ***************
public static final String MANAGER_getList4Admin = MANAGER_HOST + "/kjy/manager/welfare/pre/conf/getList4Admin";
public static final String MANAGER_saveTreasureConf = MANAGER_HOST + "/kjy/manager/live/treasure/saveTreasureConf";
......@@ -345,8 +348,16 @@ public class BasicConfig {
//小程序分享
public static final String MANAGER_saveOrUpdateMpShare = MANAGER_HOST + "/kjy/manager/live/share/saveOrUpdateMpShare";
public static final String MANAGER_ = MANAGER_HOST + "";
// public static final String MANAGER_ = MANAGER_HOST + "";
//授权弹窗配置
public static final String MANAGER_popupSave = MANAGER_HOST + "/kjy/manager/live/auth/popup/save";
public static final String MANAGER_popupDetail = MANAGER_HOST + "/kjy/manager/live/auth/popup/detail";
public static final String MANAGER_popupUpdate = MANAGER_HOST + "/kjy/manager/live/auth/popup/update";
//准客户
public static final String MANAGER_potentialSaveQues = MANAGER_HOST + "/kjy/manager/live/potential/saveQues";
public static final String MANAGER_potentialQuesList = MANAGER_HOST + "/kjy/manager/live/potential/quesList";
//客户管理
public static final String MOBILE_customerList = MOBILE_HOST + "/kjy/live/agent/customer/list";
......@@ -590,9 +601,6 @@ public class BasicConfig {
public static final String LOTTERY_CONTENTID = "Kj21MzQ3ODM"; // 抽奖
// *************** 公共 ***************
public static final String CREATE_USER = HOST + "/kjy/mp/autotest/create/user";
public static final String AUTOTEST_UNSUBSCRIBE = HOST + "/kjy/mp/autotest/unsubscribe";
public static final String AUTOTEST_TKU = HOST + "/kjy/mp/autotest/tku";
public static final String version_info = HOST + "/kjy/mp/version/info";
public static final String isVipSubscribe = HOST + "/kjy/mp/seller/isVipSubscribe";
public static final String USER_INFO = HOST + "/kjy/mp/user/info";
......@@ -604,13 +612,14 @@ public class BasicConfig {
public static final String INTERACTION_LIKE = HOST + "/kjy/mp/interaction/like";
public static final String GETTIPSBYPAGE = HOST + "/kjy/mp/tips/getTipsByPage";
public static final String USING_VERSION = HOST + "/kjy/mp/version/getInUseVersion";
public static final String DAILY_FIRST = HOST + "/kjy/mp/billing/clock/dailyFirst";
public static final String LAYER_RENEW = HOST + "/kjy/mp/layer/renew";
public static final String DISTRIBUTION_LAYER = HOST + "/kjy/sp/seller/distributionLayer";
public static final String ROOKIECLUEGUIDE = HOST + "/kjy/mp/rookieGuide/clueGuide";
public static final String VISITHEADER = HOST + "/kjy/mp/visit/header/v2";
public static final String SELLERWEEKLY = HOST + "/kjy/mp/whoSawMe/sellerWeekly";
public static final String WEEKLY_LIST = HOST + "/kjy/mp/seller/weekly/list";
public static final String NEWFUNC_FIRSTVISIT = HOST + "/kjy/mp/newFunction/sellerFirstVisit";
public static final String QRCODE_create= HOST + "/kjy/mp/qrcode/create";
public static final String UPLOAD_image= HOST + "/kjy/mp/upload/image";
public static final String DYNAMIC_addVisit= HOST + "/kjy/mp/seller/dynamic/addVisit";
......@@ -627,8 +636,12 @@ public class BasicConfig {
public static final String PAY_isRenewCondition= HOST + "/kjy/mp/combo/isRenewCondition";
public static final String MANAGER_typeList = MANAGER_HOST + "/kjy/manager/promotionCode/typeList";
public static final String MANAGER_batchCreateV2 = MANAGER_HOST + "/kjy/manager/promotionCode/batchCreateV2";
public static final String PAY_distribute = HOST + "/kjy/sp/visitorPayment/distribute";
public static final String PAY_clockPayInfo = HOST + "/kjy/mp/combo/clockPayInfo";
public static final String PAY_accInfo = HOST + "/kjy/sp/seller/acc/info";
public static final String PAY_distributionList = HOST + "/kjy/sp/seller/distributionList";
public static final String PAY_accDetail = HOST + "/kjy/sp/seller/acc/detail";
public static final String PAY_withdraw = HOST + "/kjy/sp/seller/acc/withdraw";
// *************** 名片 ***************
public static final String SELLERCARD_topOfDetail = HOST + "/kjy/mp/sellerCardV5/topOfDetail";
......@@ -684,13 +697,16 @@ public class BasicConfig {
public static final String UPLOAD_HOT = HOST + "/kjy/mp/seller/import/hot";
public static final String UPLOAD_VIDEOHOT = HOST + "/kjy/mp/seller/import/video/hot";
public static final String UPLOAD_LIST = HOST + "/kjy/mp/seller/import/list";
public static final String UPLOAD_listV2 = HOST + "/kjy/mp/seller/import/listV2";
public static final String UPLOAD_UNBIND = HOST + "/kjy/mp/seller/import/unbind";
public static final String UPLOAD_supportDomain = HOST + "/kjy/mp/supportDomain";
public static final String UPLOAD_sellerFirstVisit = HOST + "/kjy/mp/newFunction/sellerFirstVisit";
public static final String UPLOAD_getTipsByPage = HOST + "/kjy/mp/tips/getTipsByPage";
// *************** 新手任务 ***************
public static final String NOVICE_LIST = HOST + "/kjy/mp/seller/novice/list";
public static final String NOVICE_MONGOLIANLAYERISPLAY = HOST + "/kjy/mp/seller/novice/mongolianLayerDisplay";
public static final String COMPLETEGUIDE = HOST + "/kjy/mp/rookieGuide/completeGuide";
// *************** 谁看过我 ***************
......@@ -700,10 +716,54 @@ public class BasicConfig {
public static final String FORWARD_LIST = HOST + "/kjy/mp/whoSawMe/forward/list/v2";
public static final String FORWARD_CONTENTHEADER = HOST + "/kjy/mp/whoSawMe/forward/contentHeader";
public static final String FORWARD_VISITRECORD = HOST + "/kjy/mp/whoSawMe/forward/visitRecordList/v2";
public static final String SELLERUNREADMESSAGE = HOST + "/kjy/mp/custmarketing/sellerUnreadMsg";
public static final String CUSTOMERSEARCH = HOST + "/kjy/mp/whoSawMe/customerSearch";
public static final String SEARCHCUSTOMERBYCONTENT = HOST + "/kjy/mp/custmarketing/searchCustomer";
public static final String DYNAMIC_ADDVISIT = HOST + "/kjy/mp/seller/dynamic/addVisit";
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 CUSTINFOHEADER = HOST + "/kjy/mp/whoSawMe/custInfoHeader";
public static final String CUSTINFO = HOST + "/kjy/mp/seller/v2/custInfo";
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 CUSTOMERSTATISTICS = HOST + "/kjy/mp/whoSawMe/customerStatistics";
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 CUSTVISITLIST = HOST + "/kjy/mp/whoSawMe/customerInfo/list";
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 UPDATESPECIAL = HOST + "/kjy/mp/whoSawMe/updateSpecial";
public static final String totalSpecial = HOST + "/kjy/mp/whoSawMe/customerTotalStatistics";
public static final String UPDATEREMARKNAME = HOST + "/kjy/mp/seller/customer/updateRemarkName";
public static final String GETCUSTAGANDMEMO = HOST + "/kjy/mp/seller/getCustomerTagAndMemoInfo";
public static final String UPDATETAGANDMEMO = HOST + "/kjy/mp/seller/updateTagAndMemoInfo";
public static final String CUSTMATERIALS = HOST + "/kjy/mp/whoSawMe/materials";
public static final String CUSTLOTTERIES = HOST + "/kjy/mp/whoSawMe/lotteries";
public static final String CUSTFAVORITE = HOST + "/kjy/mp/whoSawMe/custFavorite";
public static final String GETTAGANDREMIND = HOST + "/kjy/mp/seller/getTagAndRemindInfo";
public static final String UPDATECUSTREMIND = HOST + "/kjy/mp/seller/saveOrUpdateCustomRemind";
public static final String GETREMINDINFOS = HOST + "/kjy/mp/seller/getRemindInfos";
public static final String DELETEREMIND = HOST + "/kjy/mp/seller/deleteCustomRemind";
public static final String UPDATEBIRTHREMIND = HOST + "/kjy/mp/seller/updateBirthdayRemindInfo";
public static final String UPDATEHOLIDAYREMIND = HOST + "/kjy/mp/seller/updateHolidayRemindInfo";
public static final String GETCUSTREMINDINFO = HOST + "/kjy/mp/seller/getCustomerRemindInfo";
public static final String CUSTOMERDETAIL = HOST + "/kjy/mp/seller/v2/customer/detail";
public static final String RELATIONINFO_HEADER = HOST + "/kjy/mp/seller/customer/getRelationInfoHeader";
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 UPDATECUSTMATERIAL = HOST + "/kjy/mp/seller/v2/customer/material/saveOrUpdate";
// *************** 标签管理 ***************
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_DELETE = HOST + "/kjy/mp/sellerTag/deleteTag";
// *************** 留言 ***************
public static final String CHAT_SEND = HOST + "/kjy/mp/chat/send";
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_LINKMANLIST = HOST + "/kjy/mp/chat/sellerLinkmanList";
// *************** 文章 ***************
......@@ -749,7 +809,6 @@ public class BasicConfig {
public static final String Daily_getCaseList = HOST + "/kjy/mp/successCases/getCaseList";
public static final String Daily_getHomeCompanyArea = HOST + "/kjy/mp/home/getHomeCompanyArea";
public static final String Daily_getTagList = HOST + "/kjy/mp/companyArea/getTagList";
public static final String Daily_getContentList = HOST +"/kjy/mp/companyArea/getContentList";
public static final String Daily_list = HOST + "/kjy/mp/companyDocument/list";
public static final String Daily_eveningList = HOST + "/kjy/mp/gatherPage/eveningList";
......@@ -763,6 +822,7 @@ public class BasicConfig {
public static final String HOME_getTags4Poster = HOST + "/kjy/mp/posterTemplate/getTags4Poster";
public static final String HOME_getPosterTemplateList = HOST + "/kjy/mp/posterTemplate/getPosterTemplateList";
public static final String HOME_findPosterById = HOST + "/kjy/mp/posterTemplate/findPosterById";
public static final String HOME_getExclusiveArea = HOST + "/kjy/mp/classify/getExclusiveArea";
//******************个人中心**********************
public static final String USINGSTRATAGY_index = HOST + "/kjy/mp/usingStrategy/index";
......@@ -786,12 +846,27 @@ public class BasicConfig {
public static final String BOSS_CODE = HOST + "/kjy/mp/seller/team/invite/code";
public static final String BOSS_BOSS = HOST + "/kjy/mp/seller/team/boss";
public static final String BOSS_EDITCONFIG = HOST + "/kjy/mp/sellerConfig/editConfig";
public static final String BOSS_ISDEMO = HOST + "/kjy/mp/seller/team/isDemo";
public static final String BOSS_TEAMTASKLIST = HOST + "/kjy/mp/seller/team/task/teamTaskList";
public static final String BOSS_CREATE = HOST + "/kjy/mp/seller/team/task/create";
public static final String BOSS_DETAIL = HOST + "/kjy/mp/seller/team/task/detail";
public static final String BOSS_PUBLISH = HOST + "/kjy/mp/seller/team/task/publish";
public static final String BOSS_RECEIVERLIST = HOST + "/kjy/mp/seller/team/task/receiverList";
public static final String BOSS_BOUND = HOST + "/kjy/mp/seller/team/bound";
public static final String MATERIALLIST = HOST + "/kjy/mp/seller/dynamic/getMaterialList";
public static final String FORWARDCARDLIST = HOST + "/kjy/mp/seller/dynamic/getForwardCardList";
public static final String MARKETINGTOOLLIST = HOST + "/kjy/mp/seller/dynamic/getMarketingToolList";
public static final String SALECLUELIST = HOST + "/kjy/mp/seller/dynamic/getSaleClueList";
public static final String GETVISITLIST = HOST + "/kjy/mp/seller/dynamic/getVisitList";
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 TEAMRANKINGLIST = HOST + "/kjy/mp/seller/team/rankingList";
// 团队管理
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 TEAMSTRUCTURE_IDENTITY = HOST + "/kjy/mp/seller/team/member/identity";
public static final String MEMBERREMOVE = HOST + "/kjy/mp/seller/team/member/remove";
public static final String MEMBERSEARCH = HOST + "/kjy/mp/seller/team/member/search";
......@@ -803,7 +878,6 @@ public class BasicConfig {
public static final String GREETING_confList = HOST + "/kjy/mp/greeting/conf/list";
public static final String GREETING_H5SHARE = ACTIVITY_HOST + "/kjy/mp/greeting/conf/h5share";
public static final String GREETING_H5INFO = ACTIVITY_HOST + "/kjy/mp/content/h5info";
public static final String GREETING_SAVEDEFAULT = ACTIVITY_HOST + "/kjy/mp/greeting/conf/saveDefault";
public static final String GREETING_getMarketingToolArea = HOST + "/kjy/mp/home/getMarketingToolArea";
public static final String GREETING_answerPageList = HOST + "/kjy/mp/game/answerPageList";
public static final String GREETING_getSellerVipInfo = HOST + "/kjy/mp/seller/getSellerVipInfo";
......@@ -874,19 +948,22 @@ public class BasicConfig {
// *************** 管理后台 ***************
public static final String SSO_doLogin = SSO_HOST + "/doLogin";
public static final String MANAGER_disableUser= MANAGER_HOST + "/kjy/manager/testUser/disableUser";
public static final String MANAGER_changeCompany = MANAGER_HOST + "/kjy/manager/seller/changeCompany";
public static final String MANAGER_updateTypeOrDate = MANAGER_HOST + "/kjy/manager/seller/updateTypeOrDate";
public static final String MANAGER_setInternalSeller = MANAGER_HOST + "/kjy/manager/seller/setInternalSeller";
public static final String MANAGER_adminInfo= MANAGER_HOST + "/kjy/manager/admin/info";
public static final String MANAGER_codeList = MANAGER_HOST + "/kjy/manager/promotionCode/codeList";
public static final String MANAGER_dailyPostersList = MANAGER_HOST + "/kjy/manager/dailyPosters/list";
public static final String MANAGER_findId = MANAGER_HOST + "/kjy/manager/dailyPosters/findById";
public static final String MANAGER_addOrUpdate = MANAGER_HOST + "/kjy/manager/dailyPosters/addOrUpdate";
public static final String MANAGER_dailyPostersDelete = MANAGER_HOST + "/kjy/manager/dailyPosters/delete";
public static final String MANAGER_removeMember = MANAGER_HOST + "/kjy/manager/sellerTeam/removeMember";
public static final String MANAGER_SELLERTEAM_REMOVEMEMBER = MANAGER_HOST + "/kjy/manager/sellerTeam/removeMember";
public static final String MANAGER_ID_ENCODE = MANAGER_HOST + "/kjy/manager/testUser/encode";
public static final String MANAGER_TKU_DECODE = MANAGER_HOST + "/kjy/manager/testUser/decryptTku";
public static final String MANAGER_getPushContent = MANAGER_HOST + "/kjy/manager/pushManager/getPushContent";
public static final String MANAGER_addOrUpdateCases = MANAGER_HOST + "/kjy/manager/successCases/addOrUpdateCases";
public static final String MANAGER_caseList = MANAGER_HOST + "/kjy/manager/successCases/caseList";
public static final String MANAGER_successCaseDetail = MANAGER_HOST + "/kjy/manager/successCases/successCaseDetail";
public static final String MANAGER_updateStatus = MANAGER_HOST + "/kjy/manager/successCases/updateStatus";
public static final String MANAGER_mainPush = MANAGER_HOST + "/kjy/manager/successCases/mainPush";
public static final String MANAGER_addExclusiveArea = MANAGER_HOST + "/kjy/manager/exclusiveArea/add";
public static final String MANAGER_searchTemplateList = MANAGER_HOST + "/kjy/manager/game/searchTemplateList";
public static final String MANAGER_getTemplateDetail = MANAGER_HOST + "/kjy/manager/game/getTemplateDetail";
}
......@@ -41,10 +41,9 @@ public class ExtentTestNGIReporterListener implements IReporter {
if (result.size() == 0) {
continue;
}
// 统计suite下的成功、失败、跳过的总用例数
// 统计suite下的成功、失败的总用例数
int suiteFailSize = 0;
int suitePassSize = 0;
// int suiteSkipSize = 0;
ExtentTest suiteTest = null;
// 存在多个suite的情况下,在报告中将同一个suite的测试结果归为一类,创建一级节点。
if (createSuiteNode) {
......@@ -80,10 +79,8 @@ public class ExtentTestNGIReporterListener implements IReporter {
// 统计SuiteResult下的数据
int passSize = r.getTestContext().getPassedTests().size();
int failSize = r.getTestContext().getFailedTests().size();
// int skipSize = r.getTestContext().getSkippedTests().size();
suitePassSize += passSize;
suiteFailSize += failSize;
// suiteSkipSize += skipSize;
if (failSize > 0) {
resultNode.getModel().setStatus(Status.FAIL);
}
......@@ -129,7 +126,6 @@ public class ExtentTestNGIReporterListener implements IReporter {
htmlReporter.config().setChartVisibilityOnOpen(true);
//报表位置
htmlReporter.config().setTestViewChartLocation(ChartLocation.TOP);
// htmlReporter.config().setTheme(Theme.STANDARD);
htmlReporter.config().setCSS(".node.level-1 ul{ display:none;} .node.level-1.active ul{display:block;}");
extent = new ExtentReports();
extent.attachReporter(htmlReporter);
......@@ -178,8 +174,6 @@ public class ExtentTestNGIReporterListener implements IReporter {
// 作为子节点进行创建时,设置同父节点的标签一致,便于报告检索。
test = extenttest.createNode(name).assignCategory(categories);
}
// test.getModel().setDescription(description.toString());
// test = extent.createTest(result.getMethod().getMethodName());
for (String group : result.getMethod().getGroups())
test.assignCategory(group);
......
......@@ -16,22 +16,11 @@ public class NetworkUtils {
// 代理人的 cookies和headers
public Map<String, Object> agentCookies = new HashMap<String, Object>();
public Map<String, Object> getAgentCookies() { return agentCookies; }
public void setAgentCookies(Map<String, Object> agentCookies) { this.agentCookies = agentCookies; }
public Map<String, Object> agentHeaders = new HashMap<String, Object>();
public Map<String, Object> getAgentHeaders() { return agentHeaders; }
public void setAgentHeaders(Map<String, Object> agentHeaders) { this.agentHeaders = agentHeaders; }
public Map<String, Object> fileHeaders = new HashMap<String, Object>();
public Map<String, Object> getFileHeaders() { return fileHeaders; }
public void setFileHeadersHeaders(Map<String, Object> fileHeaders) { this.fileHeaders = fileHeaders; }
// 钉钉的 headers
public Map<String, Object> dingTalkHeaders = new HashMap<String, Object>();
public Map<String, Object> getDingTalkHeaders() { return dingTalkHeaders; }
public void setDingTalkHeaders(Map<String, Object> dingTalkHeaders) { this.dingTalkHeaders = dingTalkHeaders; }
private volatile static NetworkUtils network;
// 构造函数 初始化tku、content-type
......@@ -145,7 +134,7 @@ public class NetworkUtils {
Response response = given()
.headers(dingTalkHeaders)
.body(jsonStr)
.post(DINGTALKPATH);
.post(dingTalkPath);
if (!Objects.equals(response.statusCode(),200)){
System.out.println("请求状态码错误,code=【"+response.statusCode()+"】");
}
......@@ -181,9 +170,5 @@ public class NetworkUtils {
}
public static void main(String[] args) throws IOException {
}
}
......@@ -2,71 +2,76 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="集客助手" verbose="1" thread-count="3">
<!-- <test preserve-order="true" name="支付">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.Pay"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "首页">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.homePage"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="我的名片">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.card.PersonCard"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="文章中个人名片">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.card.ArticalPersonCard"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "种草素材">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.RecommendMaterial"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "今日早报">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.DailyPaper"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "获取访客">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.whoSawMe.ForwardAndRead"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "谁看过我">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.whoSawMe.WhoSawMe"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "我的转发">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.whoSawMe.MyForward"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "贺卡">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.markettools.GreetingCrad"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "抽奖转盘">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.markettools.GameLottery"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="支付">
<classes>
<class name="com.kjj.cases.assistant.pay.Pay"/>
</classes>
</test>
<test preserve-order="true" name = "首页">
<classes>
<class name="com.kjj.cases.assistant.homePage.HomePage"/>
</classes>
</test>
<test preserve-order="true" name="我的名片">
<classes>
<class name="com.kjj.cases.assistant.card.PersonCard"/>
</classes>
</test>
<test preserve-order="true" name="文章中个人名片">
<classes>
<class name="com.kjj.cases.assistant.card.ArticalPersonCard"/>
</classes>
</test>
<test preserve-order="true" name = "种草素材">
<classes>
<class name="com.kjj.cases.assistant.homePage.RecommendMaterial"/>
</classes>
</test>
<test preserve-order="true" name = "今日早报">
<classes>
<class name="com.kjj.cases.assistant.homePage.DailyPaper"/>
</classes>
</test>
<test preserve-order="true" name = "获取访客">
<classes>
<class name="com.kjj.cases.assistant.whoSawMe.ForwardAndRead"/>
</classes>
</test>
<test preserve-order="true" name = "谁看过我">
<classes>
<class name="com.kjj.cases.assistant.whoSawMe.WhoSawMe"/>
</classes>
</test>
<test preserve-order="true" name = "我的转发">
<classes>
<class name="com.kjj.cases.assistant.whoSawMe.MyForward"/>
</classes>
</test>
<test preserve-order="true" name = "我的客户">
<classes>
<class name="com.kjj.cases.assistant.whoSawMe.MyCustomer"/>
</classes>
</test>
<test preserve-order="true" name = "贺卡">
<classes>
<class name="com.kjj.cases.assistant.markettools.GreetingCrad"/>
</classes>
</test>
<test preserve-order="true" name = "抽奖转盘">
<classes>
<class name="com.kjj.cases.assistant.markettools.GameLottery"/>
</classes>
</test>
<test preserve-order="true" name = "邀请函和趣味测评">
<classes>
<class name="com.kjj.cases.assistant.markettools.InvitationLetter"/>
</classes>
</test>
<!-- <test preserve-order="true" name = "使用攻略和设置中心">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.menu.PersonalCenter"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name = "使用攻略和设置中心">
<classes>
<class name="com.kjj.cases.assistant.menu.PersonalCenter"/>
</classes>
</test>
</suite>
<!-- Suite -->
......
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