Commit 44fd5c44 authored by 龚小红's avatar 龚小红

增加绑定企微、导入外部客户、全部客户列表的接口用例

parent 6d6c3c52
...@@ -883,15 +883,62 @@ public class Manager implements Authorization { ...@@ -883,15 +883,62 @@ public class Manager implements Authorization {
response = network.getResponse(params,BasicConfig.MANAGER_oto_customerList); response = network.getResponse(params,BasicConfig.MANAGER_oto_customerList);
int companySize = response.jsonPath().getInt("data.list[0].companyIds.size()"); int companySize = response.jsonPath().getInt("data.list[0].companyIds.size()");
Assert.assertEquals(companySize,2,network.message(params,BasicConfig.MANAGER_oto_customerList,"客户的产品组错误",response.body().asString())); Assert.assertEquals(companySize,2,network.message(params,BasicConfig.MANAGER_oto_customerList,"客户的产品组错误",response.body().asString()));
} }
@Test(description = "查询所有产品列表",priority = 57) @Test(description = "查询所有产品列表",priority = 57)
public void 查询所有产品列表(){ public void 查询所有产品列表(){
Response response =network.getResponse(BasicConfig.MANAGER_product_listAll); Response response =network.getResponse(BasicConfig.MANAGER_product_listAll);
int size = response.jsonPath().getInt("data.list.size()"); int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0 ,network.message(BasicConfig.MANAGER_product_listAll,"查看产品列表不为空",response.body().asString())); Assert.assertTrue(size>0 ,network.message(BasicConfig.MANAGER_product_listAll,"查看产品列表为空",response.body().asString()));
}
@Test(description = "查询可导入的客户来源列表",priority = 58)
public void 查询可导入的客户来源列表(){
Response response =network.getResponse(BasicConfig.MANAGER_getCustSourceEnum);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,3 ,network.message(BasicConfig.MANAGER_getCustSourceEnum,"查看可导入的客户来源列表",response.body().asString()));
}
@Test(description = "导入客户文件并成功",priority = 59)
public void 导入客户文件(){
HashMap<String,Object> params = new HashMap<>();
params.put("companyIds", new int[]{5});
params.put("source", 1);
params.put("fileName", "自动化导入客户.xlsx");
params.put("excelUrl", "https://yun.dui88.com/kjy/media/file/20221114/1499deb6eb5222f02ab88facaa0db316.xlsx");
Response response =network.postResponse(params,BasicConfig.MANAGER_importOtoCustomer);
int result = response.jsonPath().getInt("data");
Assert.assertNotNull(result,network.message(params,BasicConfig.MANAGER_importOtoCustomer,"启动导入客户程序失败",response.body().asString()));
params.clear();
boolean succecss = false;
params.put("taskId",result);
for (int i = 0;i<10;i++){
sleep(1000);
response =network.getResponse(params,BasicConfig.MANAGER_result);
boolean hasFinish = response.jsonPath().getBoolean("data.hasFinish");
if(hasFinish) {
String failureExcelUrl = response.jsonPath().getString("data.failureExcelUrl");
int successCount = response.jsonPath().getInt("data.successCount");
Assert.assertNotNull(failureExcelUrl, network.message(params, BasicConfig.MANAGER_result, "失败原因链接不为空", response.body().asString()));
Assert.assertEquals(successCount, 1,network.message(params, BasicConfig.MANAGER_result, "导入成功数量不为1", response.body().asString()));
succecss = true;
break;
}
}
Assert.assertTrue(succecss,network.message(params,BasicConfig.MANAGER_result,"导入客户结果失败",response.body().asString()));
}
@Test(description = "查询导入的文件上传记录",priority = 60)
public void 查询导入的文件上传记录(){
HashMap<String,Object> params = new HashMap<>();
params.put("taskType", 34);
params.put("pageIndex", 1);
params.put("pageSize", 5);
Response response =network.getResponse(params,BasicConfig.MANAGER_listForType);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0 ,network.message(BasicConfig.MANAGER_listForType,"查看导入文件上传记录不为空",response.body().asString()));
} }
public int searchCustName(String custName){ public int searchCustName(String custName){
......
...@@ -652,13 +652,13 @@ public class Phone implements Authorization { ...@@ -652,13 +652,13 @@ public class Phone implements Authorization {
Assert.assertEquals(size,0,network.message(params,BasicConfig.PHONE_interviewList,"邀约面访列表不为空",response.body().asString())); Assert.assertEquals(size,0,network.message(params,BasicConfig.PHONE_interviewList,"邀约面访列表不为空",response.body().asString()));
} }
@Test(description = "邀约查看历史备注包含面访备注",priority = 56) @Test(description = "邀约查看历史备注包含各种备注",priority = 56)
public void 邀约查看历史备注包含面访备注(){ public void 邀约查看历史备注包含各种备注(){
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
params.put("custId", IdMakeUtil.decodingId(cust_id)); params.put("custId", IdMakeUtil.decodingId(cust_id));
Response response = network.getResponse(params, BasicConfig.WORK_historyRecord); Response response = network.getResponse(params, BasicConfig.WORK_historyRecord);
int size = response.jsonPath().getInt("data.size()"); int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,5,network.message(params,BasicConfig.WORK_historyRecord,"邀约面访列表不为空",response.body().asString())); Assert.assertEquals(size,7,network.message(params,BasicConfig.WORK_historyRecord,"邀约面访列表不为空",response.body().asString()));
} }
@Test(description = "专家能查看关联自己的面访",priority = 57) @Test(description = "专家能查看关联自己的面访",priority = 57)
...@@ -675,7 +675,7 @@ public class Phone implements Authorization { ...@@ -675,7 +675,7 @@ public class Phone implements Authorization {
@Test(description = "删除客户",priority = 79) @Test(description = "删除客户",priority = 79)
public void 删除客户(){ public void 删除客户(){
long id= IdMakeUtil.decodingId(cust_id); long id= IdMakeUtil.decodingId(cust_id);
for(int i = (int)id;i<id+6;i++){ for(int i = (int)id;i<id+7;i++){
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
params.put("custId", i); params.put("custId", i);
Response response = network.postResponse(params,BasicConfig.WORK_delCust); Response response = network.postResponse(params,BasicConfig.WORK_delCust);
......
...@@ -38,6 +38,7 @@ public class Work implements Authorization { ...@@ -38,6 +38,7 @@ public class Work implements Authorization {
public double takerCoefficient; public double takerCoefficient;
public static invitationRecord recordItem; public static invitationRecord recordItem;
public static Customer customer; //当前日期0点时间戳 public static Customer customer; //当前日期0点时间戳
public String wxUserKey; //外部联系人ID
@BeforeTest @BeforeTest
public void setUp(){ public void setUp(){
...@@ -138,7 +139,7 @@ public class Work implements Authorization { ...@@ -138,7 +139,7 @@ public class Work implements Authorization {
Assert.assertEquals(size,1,network.message(BasicConfig.WORK_notifyList,"通知栏不为空",response.body().asString())); Assert.assertEquals(size,1,network.message(BasicConfig.WORK_notifyList,"通知栏不为空",response.body().asString()));
int notifyType = response.jsonPath().getInt("data[0].notifyType"); int notifyType = response.jsonPath().getInt("data[0].notifyType");
int custCount = response.jsonPath().getInt("data[0].custCount"); int custCount = response.jsonPath().getInt("data[0].custCount");
Assert.assertEquals(custCount,1,network.message(BasicConfig.WORK_notifyList,"客户数量错误",response.body().asString())); Assert.assertEquals(custCount,3,network.message(BasicConfig.WORK_notifyList,"客户数量错误",response.body().asString()));
Assert.assertEquals(notifyType,2,network.message(BasicConfig.WORK_notifyList,"通知栏类型错误",response.body().asString())); Assert.assertEquals(notifyType,2,network.message(BasicConfig.WORK_notifyList,"通知栏类型错误",response.body().asString()));
} }
...@@ -170,14 +171,14 @@ public class Work implements Authorization { ...@@ -170,14 +171,14 @@ public class Work implements Authorization {
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex", 1); params.put("pageIndex", 1);
params.put("pageSize", 50); params.put("pageSize", 50);
Response response = network.getResponse(params,BasicConfig.WORK_customerList); Response response = network.getResponse(params,BasicConfig.WORK_inviterCustList);
int customerId = response.jsonPath().getInt("data.list[0].custId"); int customerId = response.jsonPath().getInt("data.list[0].custId");
Assert.assertEquals(customerId,custId,network.message(params,BasicConfig.WORK_customerList,"需要联系列表中首位客户非新增客户",response.body().asString())); Assert.assertEquals(customerId,custId,network.message(params,BasicConfig.WORK_inviterCustList,"需要联系列表中首位客户非新增客户",response.body().asString()));
followTimes = response.jsonPath().getInt("data.list[0].followTimes"); followTimes = response.jsonPath().getInt("data.list[0].followTimes");
Object lastFollowTime = response.jsonPath().getJsonObject("data.list[0].lastFollowTime"); Object lastFollowTime = response.jsonPath().getJsonObject("data.list[0].lastFollowTime");
Assert.assertEquals(followTimes,0,network.message(params,BasicConfig.WORK_customerList,"新客户的默认跟进次数不为0",response.body().asString())); Assert.assertEquals(followTimes,0,network.message(params,BasicConfig.WORK_inviterCustList,"新客户的默认跟进次数不为0",response.body().asString()));
Assert.assertNull(lastFollowTime,network.message(params,BasicConfig.WORK_customerList,"新客户的默认跟进时间不为null",response.body().asString())); Assert.assertNull(lastFollowTime,network.message(params,BasicConfig.WORK_inviterCustList,"新客户的默认跟进时间不为null",response.body().asString()));
} }
@Test(description = "查看微信",priority = 12) @Test(description = "查看微信",priority = 12)
...@@ -213,6 +214,7 @@ public class Work implements Authorization { ...@@ -213,6 +214,7 @@ public class Work implements Authorization {
int callTimes= response.jsonPath().getInt("data.callTimes"); int callTimes= response.jsonPath().getInt("data.callTimes");
int custStar= response.jsonPath().getInt("data.custStar"); int custStar= response.jsonPath().getInt("data.custStar");
int addWxStatus= response.jsonPath().getInt("data.addWxStatus"); int addWxStatus= response.jsonPath().getInt("data.addWxStatus");
int bindWxWorkFlag= response.jsonPath().getInt("data.wxCustInfo.bindWxWorkFlag");
String custHead= response.jsonPath().getString("data.custHead"); String custHead= response.jsonPath().getString("data.custHead");
String custDescription= response.jsonPath().getString("data.custDescription"); String custDescription= response.jsonPath().getString("data.custDescription");
String expertRemark= response.jsonPath().getString("data.expertRemark"); String expertRemark= response.jsonPath().getString("data.expertRemark");
...@@ -221,6 +223,7 @@ public class Work implements Authorization { ...@@ -221,6 +223,7 @@ public class Work implements Authorization {
Assert.assertEquals(callTimes,0,network.message(params,BasicConfig.WORK_header,"新客户总通话次数非0",response.body().asString())); Assert.assertEquals(callTimes,0,network.message(params,BasicConfig.WORK_header,"新客户总通话次数非0",response.body().asString()));
Assert.assertEquals(custStar,0,network.message(params,BasicConfig.WORK_header,"新客户星标不为否",response.body().asString())); Assert.assertEquals(custStar,0,network.message(params,BasicConfig.WORK_header,"新客户星标不为否",response.body().asString()));
Assert.assertEquals(addWxStatus,0,network.message(params,BasicConfig.WORK_header,"新客户的加微状态不是未添加",response.body().asString())); Assert.assertEquals(addWxStatus,0,network.message(params,BasicConfig.WORK_header,"新客户的加微状态不是未添加",response.body().asString()));
Assert.assertEquals(bindWxWorkFlag,0,network.message(params,BasicConfig.WORK_header,"新客户的企微状态不是未绑定",response.body().asString()));
Assert.assertEquals(custHead,"https://yun.kjjcrm.com/kjy/media/file/20221018/c9c37c521ddfd949614f1b78b92a1001.png?x-oss-process=image/quality,q_80",network.message(params,BasicConfig.WORK_header,"新客户头像非默认头像",response.body().asString())); Assert.assertEquals(custHead,"https://yun.kjjcrm.com/kjy/media/file/20221018/c9c37c521ddfd949614f1b78b92a1001.png?x-oss-process=image/quality,q_80",network.message(params,BasicConfig.WORK_header,"新客户头像非默认头像",response.body().asString()));
Assert.assertEquals(custDescription,"",network.message(params,BasicConfig.WORK_header,"新客户的备注不为null",response.body().asString())); Assert.assertEquals(custDescription,"",network.message(params,BasicConfig.WORK_header,"新客户的备注不为null",response.body().asString()));
Assert.assertNull(expertRemark,network.message(params,BasicConfig.WORK_header,"新客户的专家评价不为null",response.body().asString())); Assert.assertNull(expertRemark,network.message(params,BasicConfig.WORK_header,"新客户的专家评价不为null",response.body().asString()));
...@@ -1544,6 +1547,89 @@ public class Work implements Authorization { ...@@ -1544,6 +1547,89 @@ public class Work implements Authorization {
Assert.assertNotNull(lastCallTime,network.message(params,BasicConfig.WORK_header,"新客户总通话次数非0",response.body().asString())); Assert.assertNotNull(lastCallTime,network.message(params,BasicConfig.WORK_header,"新客户总通话次数非0",response.body().asString()));
} }
@Test(description = "查找企微外部联系人",priority = 108)
public void 查找企微外部联系人(){
otoManagerAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("name", "吉吉");
Response response = network.getResponse(params,BasicConfig.WORK_getWxCustByName);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_getWxCustByName,"名字查找外部联系人列表为空",response.body().asString()));
wxUserKey = response.jsonPath().getString("data[0].externalUserKey");
}
@Test(description = "绑定客户企微",priority = 109)
public void 绑定客户企微(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
params.put("externalUserKey", wxUserKey);
Response response = network.postResponse(params,BasicConfig.WORK_bindWxCust);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_bindWxCust,"客户绑定企微失败",response.body().asString()));
//查看客户已绑定吉吉
params.put("type", 2);
response = network.getResponse(params,BasicConfig.WORK_header);
int bindWxWorkFlag= response.jsonPath().getInt("data.wxCustInfo.bindWxWorkFlag");
String custWxName= response.jsonPath().getString("data.wxCustInfo.custWxName");
Assert.assertEquals(bindWxWorkFlag,1,network.message(params,BasicConfig.WORK_header,"客户绑定标志非已绑定",response.body().asString()));
Assert.assertEquals(custWxName,"吉吉",network.message(params,BasicConfig.WORK_header,"客户绑定的企微名称非吉吉",response.body().asString()));
//查询外部联系人吉吉已绑定OTO客户
params.put("name", "吉吉");
response = network.getResponse(params,BasicConfig.WORK_getWxCustByName);
int bindCustId = response.jsonPath().getInt("data[0].custId");
Assert.assertEquals(bindCustId,custId,network.message(params,BasicConfig.WORK_getWxCustByName,"名字查找外部联系人列表为空",response.body().asString()));
}
@Test(description = "换绑客户企微",priority = 110)
public void 换绑客户企微(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId+1);
params.put("externalUserKey", wxUserKey);
Response response = network.postResponse(params,BasicConfig.WORK_bindWxCust);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_bindWxCust,"客户绑定企微失败",response.body().asString()));
params.put("type", 2);
response = network.getResponse(params,BasicConfig.WORK_header);
int bindWxWorkFlag= response.jsonPath().getInt("data.wxCustInfo.bindWxWorkFlag");
String custWxName= response.jsonPath().getString("data.wxCustInfo.custWxName");
Assert.assertEquals(bindWxWorkFlag,1,network.message(params,BasicConfig.WORK_header,"客户绑定标志非已绑定",response.body().asString()));
Assert.assertEquals(custWxName,"吉吉",network.message(params,BasicConfig.WORK_header,"客户绑定的企微名称非吉吉",response.body().asString()));
//绑定的老客户关系取消
params.put("custId", custId);
response = network.getResponse(params,BasicConfig.WORK_header);
bindWxWorkFlag= response.jsonPath().getInt("data.wxCustInfo.bindWxWorkFlag");
Assert.assertEquals(bindWxWorkFlag,0,network.message(params,BasicConfig.WORK_header,"客户绑定标志非未绑定",response.body().asString()));
}
@Test(description = "销售专家查看全部客户列表",priority = 111)
public void 销售专家查看全部客户列表(){
otoTakerAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex", 1);
params.put("pageSize", 50);
Response response = network.postResponse(params,BasicConfig.WORK_SellerCustList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_SellerCustList,"全部客户列表客户数量错误",response.body().asString()));
otoExpertAuth();
response = network.postResponse(params,BasicConfig.WORK_SellerCustList);
size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_SellerCustList,"全部客户列表客户数量错误",response.body().asString()));
}
@Test(description = "查询成员列表",priority = 112)
public void 查询成员列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("name", "自动化");
Response response = network.postResponse(params,BasicConfig.WORK_sellerList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,5,network.message(params,BasicConfig.WORK_sellerList,"当前跟进人模糊搜索数量错误",response.body().asString()));
}
//修改客户的约面情况 //修改客户的约面情况
public void updateInvite(int interviewFlag,long time){ public void updateInvite(int interviewFlag,long time){
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
...@@ -1568,18 +1654,6 @@ public class Work implements Authorization { ...@@ -1568,18 +1654,6 @@ public class Work implements Authorization {
boolean data = response.jsonPath().getBoolean("data"); boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(params,BasicConfig.WORK_invite_submit,"修改客户面访失败",response.body().asString())); Assert.assertTrue(data ,network.message(params,BasicConfig.WORK_invite_submit,"修改客户面访失败",response.body().asString()));
// for(int i = 6850;i<6860;i++){
// HashMap<String,Object> params = new HashMap<>();
// params.put("custId",i);
// params.put("eventType",2);
// params.put("firstInterviewFlag",interviewFlag);
// params.put("interviewConfId",230);
// params.put("interviewTime",time);
// params.put("haveMealFlag",0);
// params.put("pickTakeFlag",0);
// params.put("custNum",10);
// Response response =network.postResponse(params,BasicConfig.WORK_invite_submit);
// }
} }
//确认准客户面访任务列表 //确认准客户面访任务列表
......
...@@ -130,6 +130,10 @@ public class BasicConfig { ...@@ -130,6 +130,10 @@ public class BasicConfig {
public static final String MANAGER_tagUpdate = MANAGER_HOST + "/kjy/manager/pub/form/customer/tag/update"; public static final String MANAGER_tagUpdate = MANAGER_HOST + "/kjy/manager/pub/form/customer/tag/update";
public static final String MANAGER_custName = MANAGER_HOST + "/kjy/manager/pub/form/customer/fuzzy/custName"; public static final String MANAGER_custName = MANAGER_HOST + "/kjy/manager/pub/form/customer/fuzzy/custName";
public static final String MANAGER_updateDealFlag = MANAGER_HOST + "/kjy/manager/pub/form/customer/updateDealFlag"; public static final String MANAGER_updateDealFlag = MANAGER_HOST + "/kjy/manager/pub/form/customer/updateDealFlag";
public static final String MANAGER_getCustSourceEnum = MANAGER_HOST + "/kjy/manager/pub/form/customer/import/getCustSourceEnum";
public static final String MANAGER_listForType = MANAGER_HOST + "/kjy/manager/live/import/listForType";
public static final String MANAGER_importOtoCustomer = MANAGER_HOST + "/kjy/manager/pub/form/importOtoCustomer";
public static final String MANAGER_result = MANAGER_HOST + "/kjy/manager/live/import/result";
//*************** OTO销售工作台 *************** //*************** OTO销售工作台 ***************
public static final String WORK_getCaptcha = WORK_HOST + "/kjy/oto/manager/auth/captcha"; public static final String WORK_getCaptcha = WORK_HOST + "/kjy/oto/manager/auth/captcha";
...@@ -210,6 +214,11 @@ public class BasicConfig { ...@@ -210,6 +214,11 @@ public class BasicConfig {
public static final String WORK_checkCustList = WORK_HOST + "/kjy/oto/manager/customer/check/custList"; public static final String WORK_checkCustList = WORK_HOST + "/kjy/oto/manager/customer/check/custList";
public static final String WORK_checkList = WORK_HOST + "/kjy/oto/manager/customer/check/list"; public static final String WORK_checkList = WORK_HOST + "/kjy/oto/manager/customer/check/list";
public static final String WORK_historyRecord = WORK_HOST + "/kjy/oto/manager/customer/log/historyRecord"; public static final String WORK_historyRecord = WORK_HOST + "/kjy/oto/manager/customer/log/historyRecord";
public static final String WORK_inviterCustList = WORK_HOST + "/kjy/oto/manager/customer/invite/custList";
public static final String WORK_SellerCustList = WORK_HOST + "/kjy/oto/manager/customer/sellerOrExpert/custList";
public static final String WORK_sellerList = WORK_HOST + "/kjy/oto/manager/customer/role/sellerList";
public static final String WORK_getWxCustByName = WORK_HOST + "/kjy/oto/manager/customer/getWxCustByName";
public static final String WORK_bindWxCust = WORK_HOST + "/kjy/oto/manager/customer/bindWxCust";
//*************************客集集营销平台****************************** //*************************客集集营销平台******************************
public static final String PHONE_bindWxUser = HOST + "/kjy/oto/interview/bindWxUser"; public static final String PHONE_bindWxUser = HOST + "/kjy/oto/interview/bindWxUser";
......
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