Commit c5655eaa authored by 龚小红's avatar 龚小红

Merge branch 'Feature/20221108/inviterTask' into 'master'

增加总监盘点的接口用例

See merge request !41
parents 46c34b9f 8c4361ea
......@@ -145,12 +145,12 @@ public class Manager implements Authorization {
PubForm("1513636130"+i,"自动化测试用户"+i);
}
// for(int i = 10;i<20;i++){
// for(int i = 20;i<80;i++){
// HashMap<String,Object> params = new HashMap<>();
// params.put("formId", "Kj22MTU5MQ");
// params.put("phoneNum", "130112100"+i);
// params.put("urlLink", "https://kjj-static.duibatest.com.cn/tk/202204111900-1?formId=Kj22MTU5MQ&channel=jrtt&agent=td");
// params.put("username", "小红用户"+i);
// params.put("username", "小红11月用户"+i);
// params.put("uuid", "622d83e4-ca21-4ccd-94cb-182c0f2a6b60");
// Response response = network.postResponse(params,BasicConfig.FORM_submit);
// String recordId = response.jsonPath().getString("data.recordId");
......
......@@ -627,8 +627,6 @@ public class Phone implements Authorization {
Response response =network.getResponse(params,BasicConfig.PHONE_paper_getCustomers);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(BasicConfig.PHONE_paper_getCustomers,"日报列表客户为空",response.body().asString()));
String label = response.jsonPath().getString("data.list[0].label");
Assert.assertEquals(label,"",network.message(BasicConfig.PHONE_paper_getCustomers,"客户非今日见面标签",response.body().asString()));
}
@Test(description = "提交日报",priority = 50)
......@@ -701,7 +699,7 @@ public class Phone implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_delCust,"删除客户失败",response.body().asString()));
}
// for(int i = 6380;i<6385;i++){
// for(int i = 6549;i<6560;i++){
// HashMap<String,Object> params = new HashMap<>();
// params.put("custId", i);
// Response response = network.postResponse(params,BasicConfig.WORK_delCust);
......@@ -738,6 +736,8 @@ public class Phone implements Authorization {
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
params.put("interviewType", 2);
params.put("interviewConfId", IdMakeUtil.encodingId(Work.sceneId));
params.put("custPhase", custPhase);
params.put("custPhase", custPhase);
params.put("appointmentTime", System.currentTimeMillis()+3600000);
Response response = network.postResponse(params, BasicConfig.PHONE_interviewSave);
......
......@@ -146,7 +146,7 @@ public class Work implements Authorization {
public void 工作台_菜单权限列表(){
Response response = network.getResponse(BasicConfig.WORK_menu_list);
int size = response.jsonPath().getInt("data.menuList.size()");
Assert.assertEquals(size,2,network.message(BasicConfig.WORK_notifyList,"菜单列表数量错误",response.body().asString()));
Assert.assertEquals(size,3,network.message(BasicConfig.WORK_notifyList,"菜单列表数量错误",response.body().asString()));
}
@Test(description = "客户状态分类_数量总览",priority = 9)
......@@ -733,10 +733,22 @@ public class Work implements Authorization {
@Test(description = "查看客户面访状态为尚未约到",priority = 48)
public void 查看客户面访状态为尚未约到(){
getHasFirstInvite(-1,true);
}
@Test(description = "修改客户面访状态为明确拒绝",priority = 49)
public void 修改客户面访状态为明确拒绝(){
updateInvite(0,now+86400000);
getHasFirstInvite(0,true);
}
@Test(description = "修改客户面访状态为已约到时间未定",priority = 50)
public void 修改客户面访状态为已约到时间未定(){
updateInvite(2,now+86400000);
getHasFirstInvite(2,true);
}
@Test(description = "获取客户适用场景",priority = 49)
@Test(description = "获取客户适用场景",priority = 51)
public void 获取客户适用场景(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId",custId);
......@@ -745,7 +757,7 @@ public class Work implements Authorization {
Assert.assertEquals(size,2 ,network.message(params,BasicConfig.WORK_getAllSceneConfs,"面访场景包含场景未根据产品组关联",response.body().asString()));
}
@Test(description = "修改客户面访承诺时间为1天后",priority = 50)
@Test(description = "修改客户面访承诺时间为1天后",priority = 52)
public void 修改客户面访承诺时间为1天后(){
updateInvite(1,now+86400000);
......@@ -753,41 +765,41 @@ public class Work implements Authorization {
getCallCustInfo(1);
}
@Test(description = "查看准客户面访任务和约面日历为未确认",priority = 51)
@Test(description = "查看准客户面访任务和约面日历为未确认",priority = 53)
public void 查看准客户面访任务和约面日历为未确认(){
taskList(0,1);
getCalendarlist(today+86400000,1,"自动化测试用户","勿动-自动化测试邀约");
}
@Test(description = "修改客户行程状态为已确认",priority = 52)
public void 修改客户行程状态为已确认(){
HashMap<String,Object> params = new HashMap<>();
params.put("id",taskId);
params.put("inviteStatus",2);
Response response =network.postResponse(params,BasicConfig.WORK_invite_confirm);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(params,BasicConfig.WORK_invite_confirm,"修改客户行程状态为【已确认】失败",response.body().asString()));
taskList(1,2);
getHasFirstInvite(1,true);
getCallCustInfo(1);
getCalendarlist(today+86400000,2,"自动化测试用户","勿动-自动化测试邀约");
}
@Test(description = "修改客户行程状态为未确认",priority = 53)
public void 修改客户行程状态为未确认(){
HashMap<String,Object> params = new HashMap<>();
params.put("id",taskId);
params.put("inviteStatus",1);
Response response =network.postResponse(params,BasicConfig.WORK_invite_confirm);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(params,BasicConfig.WORK_invite_confirm,"修改客户行程状态为【已确认】失败",response.body().asString()));
taskList(0,1);
getHasFirstInvite(1,true);
getCallCustInfo(1);
getCalendarlist(today+86400000,1,"自动化测试用户","勿动-自动化测试邀约");
}
// @Test(description = "修改客户行程状态为已确认",priority = 52)
// public void 修改客户行程状态为已确认(){
// HashMap<String,Object> params = new HashMap<>();
// params.put("id",taskId);
// params.put("inviteStatus",2);
// Response response =network.postResponse(params,BasicConfig.WORK_invite_confirm);
// boolean data = response.jsonPath().getBoolean("data");
// Assert.assertTrue(data ,network.message(params,BasicConfig.WORK_invite_confirm,"修改客户行程状态为【已确认】失败",response.body().asString()));
//
// taskList(1,2);
// getHasFirstInvite(1,true);
// getCallCustInfo(1);
// getCalendarlist(today+86400000,2,"自动化测试用户","勿动-自动化测试邀约");
// }
//
// @Test(description = "修改客户行程状态为未确认",priority = 53)
// public void 修改客户行程状态为未确认(){
// HashMap<String,Object> params = new HashMap<>();
// params.put("id",taskId);
// params.put("inviteStatus",1);
// Response response =network.postResponse(params,BasicConfig.WORK_invite_confirm);
// boolean data = response.jsonPath().getBoolean("data");
// Assert.assertTrue(data ,network.message(params,BasicConfig.WORK_invite_confirm,"修改客户行程状态为【已确认】失败",response.body().asString()));
//
// taskList(0,1);
// getHasFirstInvite(1,true);
// getCallCustInfo(1);
// getCalendarlist(today+86400000,1,"自动化测试用户","勿动-自动化测试邀约");
// }
@Test(description = "修改客户具体时间客户状态不变",priority = 54)
public void 修改客户具体时间客户状态不变(){
......@@ -1153,40 +1165,37 @@ public class Work implements Authorization {
otoManagerAuth();
Response response = network.getResponse(BasicConfig.WORK_taskConfList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size==4,network.message(BasicConfig.WORK_taskConfList,"获取任务配置数量错误",response.body().asString()));
Assert.assertTrue(size==7,network.message(BasicConfig.WORK_taskConfList,"获取任务配置数量错误",response.body().asString()));
}
@Test(description = "修改任务配置",priority = 87)
public void 修改任务配置(){
HashMap<String,Object> params = new HashMap<>();
String list[] = {"01","02","03","04"};
params.put("custSourceList",list);//客户来源
params.put("custType",2); //1:全部客户;2:新客户;3:老客户
params.put("id",4);
params.put("limitGoalFlag",0);
params.put("notCustSource",new String[]{"01"});//不支持的客户来源
params.put("sellerRole",new int[]{6,7});//支持的角色
params.put("effectDays",new int[]{1,2});//生效日期
params.put("id",1);
params.put("taskUsable",0); //0:任务状态关闭;1:任务状态开启
Response response = network.postResponse(params,BasicConfig.WORK_modifyTaskConf);
Response response = network.postResponse(params,BasicConfig.WORK_taskEdit);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_modifyTaskConf,"修改任务失败",response.body().asString()));
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_taskEdit,"修改任务失败",response.body().asString()));
//获取任务列表验证修改是否成功
Response listRes = network.getResponse(BasicConfig.WORK_taskConfList);
int custType = listRes.jsonPath().getInt("data[0].custType");
int custSourceList = listRes.jsonPath().getInt("data[0].custSourceList.size()");
int custSourceList = listRes.jsonPath().getInt("data[0].notCustSource.size()");
Assert.assertEquals(custType,2,network.message(BasicConfig.WORK_taskConfList,"修改任务配置失败",listRes.body().asString()));
Assert.assertEquals(custSourceList,4,network.message(BasicConfig.WORK_taskConfList,"修改任务配置失败",listRes.body().asString()));
//恢复默认配置
params.clear();
String acqList[] = {"01","02","03","04","05","06","07","08","09"};
params.put("custSourceList",acqList);//客户来源:
params.put("custType",1); //1:全部客户;2:新客户;3:老客户
params.put("id",4);
params.put("limitGoalFlag",0);
params.put("notCustSource",new String[]{});//不支持的客户来源
params.put("sellerRole",new int[]{5});//支持的角色
params.put("effectDays",new int[]{0});//生效日期
params.put("id",1);
params.put("taskUsable",1); //0:任务状态关闭;1:任务状态开启
Response acqRes = network.postResponse(params,BasicConfig.WORK_modifyTaskConf);
Response acqRes = network.postResponse(params,BasicConfig.WORK_taskEdit);
boolean acqData = acqRes.jsonPath().getBoolean("data");
Assert.assertTrue(acqData,network.message(params,BasicConfig.WORK_modifyTaskConf,"修改任务失败",acqRes.body().asString()));
Assert.assertTrue(acqData,network.message(params,BasicConfig.WORK_taskEdit,"修改任务失败",acqRes.body().asString()));
}
@Test(description = "客户总览_销售查看任务",priority = 88)
......@@ -1257,7 +1266,7 @@ public class Work implements Authorization {
params.put("pageSize",20);
Response response =network.getResponse(params,BasicConfig.PHONE_getReservationList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,2,network.message(BasicConfig.PHONE_getReservationList,"查看预约列表不为空",response.body().asString()));
Assert.assertTrue(size>0,network.message(BasicConfig.PHONE_getReservationList,"查看预约列表不为空",response.body().asString()));
int bookingStatus = response.jsonPath().getInt("data[0].bookingStatus");
Assert.assertEquals(bookingStatus,0,network.message(BasicConfig.PHONE_getReservationList,"预约状态错误:非待参观",response.body().asString()));
......@@ -1299,6 +1308,7 @@ public class Work implements Authorization {
@Test(description = "查看盘点客户列表",priority = 96)
public void 查看盘点客户列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("custName","自动化");
params.put("todayCheck",1);
params.put("pageIndex",1);
params.put("pageSize",50);
......@@ -1422,7 +1432,7 @@ public class Work implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_calendar_assignRollback,"退回邀约组失败",response.body().asString()));
//验证约面日历状态/专家/带看人清空
getCalendarlist(today,1,"自动化激活用户","勿动-自动化测试邀约");
getCalendarlist(today,3,"自动化激活用户","勿动-自动化测试邀约");
Assert.assertNull(recordItem.expertName,network.message(params,BasicConfig.WORK_calendar_list,"专家名称不为空",response.body().asString()));
Assert.assertNull(recordItem.takeLookName,network.message(params,BasicConfig.WORK_calendar_list,"带看人名称不为空",response.body().asString()));
Assert.assertFalse(recordItem.hasAssignFlag,network.message(params,BasicConfig.WORK_calendar_list,"是否分配状态非【待分配未确认】",response.body().asString()));
......@@ -1435,7 +1445,12 @@ public class Work implements Authorization {
@Test(description = "立即分配邀约客户",priority = 104)
public void 立即分配邀约客户(){
updateInvite(0,now + 3600000);
updateInvite(1,now + 3600000);
getCalendarlist(today,2,"自动化激活用户","勿动-自动化测试邀约");
otoManagerAuth();
//立即分配
HashMap<String,Object> params = new HashMap<>();
params.put("recordId",recordItem.recordId);
......@@ -1478,29 +1493,45 @@ public class Work implements Authorization {
params.put("custNum",10);
params.put("pickTakeAddress","杭州数字娱乐大厦");
params.put("receiveAndSendOffTime",time-3600000);
}else{ //0表示未约到
} else if(interviewFlag == 2) { //1为已约到需要填写时间地点
params.put("nextContactTime",time);
} else{ //0表示未约到
params.put("custManner",1);
params.put("rejectReason",2);
}
Response response =network.postResponse(params,BasicConfig.WORK_invite_submit);
boolean data = response.jsonPath().getBoolean("data");
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);
// }
}
//确认准客户面访任务列表
public void taskList(int finish,int status){
sleep(2000);
HashMap<String,Object> params = new HashMap<>();
params.put("taskConfId",7);
Response response =network.getResponse(params,BasicConfig.WORK_invitation_list);
int goalCount = response.jsonPath().getInt("data.goalCount");
int finishCustNum = response.jsonPath().getInt("data.finishCustNum");
int size = response.jsonPath().getInt("data.list.size()");
int inviteStatus = response.jsonPath().getInt("data.list[0].inviteStatus");
Assert.assertEquals(goalCount,1 ,network.message(params,BasicConfig.WORK_invitation_list,"面访列表的目标数量不为1",response.body().asString()));
Assert.assertEquals(finishCustNum,finish ,network.message(params,BasicConfig.WORK_invitation_list,"面访列表的完成数量不为"+finish,response.body().asString()));
Assert.assertEquals(size,1 ,network.message(params,BasicConfig.WORK_invitation_list,"面访列表的客户数量不为1",response.body().asString()));
Assert.assertEquals(inviteStatus,status ,network.message(params,BasicConfig.WORK_invitation_list,"面访列表的客户状态不为"+status,response.body().asString()));
taskId = response.jsonPath().getInt("data.list[0].id");
// sleep(2000);
// HashMap<String,Object> params = new HashMap<>();
// params.put("taskConfId",7);
// Response response =network.getResponse(params,BasicConfig.WORK_invitation_list);
// int goalCount = response.jsonPath().getInt("data.goalCount");
// int finishCustNum = response.jsonPath().getInt("data.finishCustNum");
// int size = response.jsonPath().getInt("data.list.size()");
// int inviteStatus = response.jsonPath().getInt("data.list[0].inviteStatus");
// Assert.assertEquals(goalCount,1 ,network.message(params,BasicConfig.WORK_invitation_list,"面访列表的目标数量不为1",response.body().asString()));
// Assert.assertEquals(finishCustNum,finish ,network.message(params,BasicConfig.WORK_invitation_list,"面访列表的完成数量不为"+finish,response.body().asString()));
// Assert.assertEquals(size,1 ,network.message(params,BasicConfig.WORK_invitation_list,"面访列表的客户数量不为1",response.body().asString()));
// Assert.assertEquals(inviteStatus,status ,network.message(params,BasicConfig.WORK_invitation_list,"面访列表的客户状态不为"+status,response.body().asString()));
// taskId = response.jsonPath().getInt("data.list[0].id");
}
//获取电话回填客户约面信息
......@@ -1527,34 +1558,36 @@ public class Work implements Authorization {
HashMap<String,Object> params = new HashMap<>();
params.put("custId",custId);
Response response =network.getResponse(params,BasicConfig.WORK_getHasFirstInvite);
if(interviewFlag == 1){
int firstInterviewFlag = response.jsonPath().getInt("data.firstInterviewFlag");
String interviewTime = response.jsonPath().getString("data.interviewTime");
inviteUrl = response.jsonPath().getString("data.invLetterUrl");
Assert.assertEquals(firstInterviewFlag ,interviewFlag ,network.message(params,BasicConfig.WORK_getHasFirstInvite,"约面状态回显非"+interviewFlag,response.body().asString()));
Assert.assertNotNull(interviewTime ,network.message(params,BasicConfig.WORK_getHasFirstInvite,"面访承诺时间为空",response.body().asString()));
if (isinviter)
Assert.assertNotNull(inviteUrl ,network.message(params,BasicConfig.WORK_getHasFirstInvite,"邀请函链接为空",response.body().asString()));
}else if(interviewFlag == 0){
int firstInterviewFlag = response.jsonPath().getInt("data.firstInterviewFlag");
String interviewTime = response.jsonPath().getString("data.interviewTime");
String nextContactTime = response.jsonPath().getString("data.nextContactTime");
String invLetterUrl = response.jsonPath().getString("data.invLetterUrl");
Assert.assertEquals(firstInterviewFlag ,interviewFlag ,network.message(params,BasicConfig.WORK_getHasFirstInvite,"约面状态回显非"+interviewFlag,response.body().asString()));
Assert.assertNull(interviewTime ,network.message(params,BasicConfig.WORK_getHasFirstInvite,"面访承诺时间不为空",response.body().asString()));
Assert.assertNotNull(nextContactTime ,network.message(params,BasicConfig.WORK_getHasFirstInvite,"下次联系时间为空",response.body().asString()));
Assert.assertNull(invLetterUrl ,network.message(params,BasicConfig.WORK_getHasFirstInvite,"邀请函链接不为空",response.body().asString()));
} else
{
String firstInterviewFlag = response.jsonPath().getString("data.firstInterviewFlag");
String interviewTime = response.jsonPath().getString("data.interviewTime");
String nextContactTime = response.jsonPath().getString("data.nextContactTime");
String invLetterUrl = response.jsonPath().getString("data.invLetterUrl");
if(interviewFlag == -1){
Assert.assertNull(firstInterviewFlag ,network.message(params,BasicConfig.WORK_getHasFirstInvite,"约面状态回显不为空",response.body().asString()));
Assert.assertNull(interviewTime ,network.message(params,BasicConfig.WORK_getHasFirstInvite,"面访承诺时间不为空",response.body().asString()));
Assert.assertNull(nextContactTime ,network.message(params,BasicConfig.WORK_getHasFirstInvite,"下次联系时间不为空",response.body().asString()));
Assert.assertNull(invLetterUrl ,network.message(params,BasicConfig.WORK_getHasFirstInvite,"邀请函链接不为空",response.body().asString()));
}else {
Assert.assertEquals(firstInterviewFlag, String.valueOf(interviewFlag), network.message(params, BasicConfig.WORK_getHasFirstInvite, "约面状态回显非" + interviewFlag, response.body().asString()));
if (interviewFlag == 1) {
Assert.assertNotNull(interviewTime, network.message(params, BasicConfig.WORK_getHasFirstInvite, "面访承诺时间为空", response.body().asString()));
inviteUrl = response.jsonPath().getString("data.invLetterUrl");
if (isinviter)
Assert.assertNotNull(inviteUrl, network.message(params, BasicConfig.WORK_getHasFirstInvite, "邀请函链接为空", response.body().asString()));
else
Assert.assertNull(inviteUrl, network.message(params, BasicConfig.WORK_getHasFirstInvite, "邀请函链接为空", response.body().asString()));
} else{
Assert.assertNull(interviewTime, network.message(params, BasicConfig.WORK_getHasFirstInvite, "面访承诺时间不为空", response.body().asString()));
Assert.assertNull(invLetterUrl, network.message(params, BasicConfig.WORK_getHasFirstInvite, "邀请函链接不为空", response.body().asString()));
if (interviewFlag == 2) {
Assert.assertNotNull(nextContactTime ,network.message(params,BasicConfig.WORK_getHasFirstInvite,"下次联系时间不为空",response.body().asString()));
}else{
int custManner = response.jsonPath().getInt("data.custManner");
int rejectReason = response.jsonPath().getInt("data.rejectReason");
Assert.assertEquals(custManner, 1, network.message(params, BasicConfig.WORK_getHasFirstInvite, "客户态度非明确拒绝", response.body().asString()));
Assert.assertEquals(rejectReason, 2, network.message(params, BasicConfig.WORK_getHasFirstInvite, "拒绝原因非2" + interviewFlag, response.body().asString()));
}
}
}
}
......
......@@ -172,8 +172,8 @@ public class BasicConfig {
public static final String WORK_interviewAuditList= WORK_HOST + "/kjy/oto/manager/audit/getInterviewAuditList";
public static final String WORK_interviewAuditReject= WORK_HOST + "/kjy/oto/manager/audit/interviewAuditReject";
public static final String WORK_interviewAuditPass= WORK_HOST + "/kjy/oto/manager/audit/interviewAuditPass";
public static final String WORK_taskConfList= WORK_HOST + "/kjy/oto/manager/sellerTask/taskConfList";
public static final String WORK_modifyTaskConf= WORK_HOST + "/kjy/oto/manager/sellerTask/modifyTaskConf";
public static final String WORK_taskConfList= WORK_HOST + "/kjy/oto/manager/task/config/list";
public static final String WORK_taskEdit = WORK_HOST + "/kjy/oto/manager/task/config/edit";
public static final String WORK_statisticHeader= WORK_HOST + "/kjy/oto/manager/sellerTask/statistic/header";
public static final String WORK_taskDetailsList= WORK_HOST + "/kjy/oto/manager/sellerTask/taskDetailsList";
public static final String WORK_coefficient_detail= WORK_HOST + "/kjy/oto/manager/customer/coefficient/detail";
......
......@@ -27,7 +27,7 @@ public class NetworkUtils {
//cookies中的tku
agentCookies.put("tku",AGENT_TKU);
//多场景测试标志
agentCookies.put("_duibaServiceGroupKey","miria-3321");
agentCookies.put("_duibaServiceGroupKey","miria-3433");
//json类型的headers
agentHeaders.put("Content-Type","application/json");
//二进制文件的headers
......
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