Commit 7c0122a0 authored by 龚小红's avatar 龚小红

增加半天计划优化的测试用例

parent 26bdf857
......@@ -6,13 +6,15 @@ import lombok.Data;
public class Plan {
public String planActionType;
public String actionTime;
public String timeRegion;
public int actionSeller;
public Integer interviewSceneConfId;
public Plan(String planActionType, String actionTime, int actionSeller, Integer interviewSceneConfId) {
public Plan(String planActionType, String actionTime, String timeRegion, int actionSeller, Integer interviewSceneConfId) {
this.planActionType = planActionType;
this.actionTime = actionTime;
this.actionSeller = actionSeller;
this.interviewSceneConfId = interviewSceneConfId;
this.timeRegion = timeRegion;
}
}
......@@ -689,11 +689,11 @@ public class Phone implements Authorization {
HashMap<String,Object> params = new HashMap<>();
params.put("ids", planIds);
Response response = network.getResponse(params,BasicConfig.WORK_getPlanDetail);
int phoneStatus = response.jsonPath().getInt("data.meets[0].planStatus");
int phoneStatus = response.jsonPath().getInt("data.am[0].planStatus");
Assert.assertEquals(phoneStatus,2,network.message(params,BasicConfig.WORK_getPlanDetail,"见面计划状态非已完成",response.body().asString()));
params.clear();
getSellerPlan(1,1,1,1,2,0);
getSellerPlan(2,2,0,1,1,0);
}
......
......@@ -1774,8 +1774,8 @@ public class Work implements Authorization {
params.put("custId",custId);
calendar.add(calendar.DATE,2);
ArrayList<Plan> plans = new ArrayList<>();
plans.add(new Plan("phone",simpleDateFormat.format(calendar.getTime()),6,null));
plans.add(new Plan("meet",simpleDateFormat.format(calendar.getTime()),6, (int) sceneId));
plans.add(new Plan("phone",simpleDateFormat.format(calendar.getTime()),"pm",6,null));//创建后日计划
plans.add(new Plan("meet",simpleDateFormat.format(calendar.getTime()),"am",6, (int) sceneId));
params.put("plans",plans);
Response response =network.postResponse(params,BasicConfig.WORK_saveCheckRecord);
boolean data = response.jsonPath().getBoolean("data");
......@@ -1786,8 +1786,8 @@ public class Work implements Authorization {
params.put("checkConclusion","客户盘点后的结论2");
params.put("strategyId",strategyId);
calendar.add(calendar.DATE,-1);
plans.add(new Plan("phone",simpleDateFormat.format(calendar.getTime()),6,null));
plans.add(new Plan("meet",simpleDateFormat.format(calendar.getTime()),6, (int) sceneId));
plans.add(new Plan("phone",simpleDateFormat.format(calendar.getTime()),"pm",6,null));//创建明日计划
plans.add(new Plan("meet",simpleDateFormat.format(calendar.getTime()),"am",6, (int) sceneId));
params.put("plans",plans);
response =network.postResponse(params,BasicConfig.WORK_saveCheckRecord);
......@@ -1836,28 +1836,48 @@ public class Work implements Authorization {
}
@Test(description = "销售查看个人工作计划",priority = 139)
public void 销售查看个人工作计划(){
@Test(description = "销售添加自建计划",priority = 139)
public void 销售添加自建计划(){
otoTakerAuth();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar= Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(calendar.DATE,1);
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
params.put("actionTime", simpleDateFormat.format(calendar.getTime()));//创建明日计划
params.put("planActionType", "phone");
params.put("timeRegion", "am");
Response response = network.postResponse(params,BasicConfig.WORK_saveSelfPlan);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_saveSelfPlan,"创建自建计划失败",response.body().asString()));
calendar.add(calendar.DATE,-1);
tomorrowWeek = calendar.get(Calendar.DAY_OF_WEEK) ;//计算明日处于周几
calendar.add(Calendar.DATE, -tomorrowWeek+2);
beginTime = simpleDateFormat.format(calendar.getTime());
tomorrowWeek= tomorrowWeek-1;
getSellerPlan(0,1,0,1,1,0);
}
@Test(description = "总监查看团队工作计划",priority = 140)
@Test(description = "销售查看个人工作计划",priority = 140)
public void 销售查看个人工作计划(){
sleep(1000);
getSellerPlan(0,2,0,1,1,0);
}
@Test(description = "总监查看团队工作计划",priority = 141)
public void 总监查看团队工作计划(){
otoLeaderAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("beginTime", beginTime);
Response response = network.getResponse(params,BasicConfig.WORK_getDirectorPlanCalendarList);
Response response = network.postResponse(params,BasicConfig.WORK_getDirectorPlanCalendarList);
int size = response.jsonPath().getInt("data.size()");
int flag = 0;
for(int i =0;i<size;i++){
......@@ -1865,8 +1885,8 @@ public class Work implements Authorization {
flag = 1;
int plans = response.jsonPath().getInt("data["+i+"].vos["+ tomorrowWeek +"].ids.size()");
int hasAllCheck = response.jsonPath().getInt("data["+i+"].vos["+ tomorrowWeek +"].hasAllCheck");
Assert.assertEquals(plans,2,network.message(params,BasicConfig.WORK_getDirectorPlanCalendarList,"销售当天的计划数量错误",response.body().asString()));
Assert.assertEquals(hasAllCheck,1,network.message(params,BasicConfig.WORK_getDirectorPlanCalendarList,"销售当天的盘点标记非[已盘完】",response.body().asString()));
Assert.assertEquals(plans,3,network.message(params,BasicConfig.WORK_getDirectorPlanCalendarList,"销售当天的计划数量错误",response.body().asString()));
Assert.assertEquals(hasAllCheck,0,network.message(params,BasicConfig.WORK_getDirectorPlanCalendarList,"销售当天的盘点标记非[已盘完】",response.body().asString()));
}
}
if (flag== 0){
......@@ -1874,26 +1894,26 @@ public class Work implements Authorization {
}
}
@Test(description = "查看计划详情",priority = 141)
@Test(description = "查看计划详情",priority = 142)
public void 查看计划详情(){
HashMap<String,Object> params = new HashMap<>();
params.put("ids", planIds);
Response response = network.getResponse(params,BasicConfig.WORK_getPlanDetail);
int meetSize = response.jsonPath().getInt("data.meets.size()");
int phoneSize = response.jsonPath().getInt("data.phones.size()");
int meetStatus = response.jsonPath().getInt("data.meets[0].planStatus");
int phoneStatus = response.jsonPath().getInt("data.phones[0].planStatus");
int hasCheck_1 = response.jsonPath().getInt("data.meets[0].hasCheck");
int hasCheck_2 = response.jsonPath().getInt("data.phones[0].hasCheck");
Assert.assertEquals(meetSize,1,network.message(params,BasicConfig.WORK_getPlanDetail,"见面列表总数错误",response.body().asString()));
Assert.assertEquals(phoneSize,1,network.message(params,BasicConfig.WORK_getPlanDetail,"电话列表总数错误",response.body().asString()));
Assert.assertEquals(meetStatus,1,network.message(params,BasicConfig.WORK_getPlanDetail,"见面计划状态错误",response.body().asString()));
Assert.assertEquals(phoneStatus,1,network.message(params,BasicConfig.WORK_getPlanDetail,"电话计划状态错误",response.body().asString()));
int amSize = response.jsonPath().getInt("data.am.size()");
int pmSize = response.jsonPath().getInt("data.pm.size()");
int meetStatus = response.jsonPath().getInt("data.am[0].planStatus");
int phoneStatus = response.jsonPath().getInt("data.pm[0].planStatus");
int hasCheck_1 = response.jsonPath().getInt("data.am[0].hasCheck");
int hasCheck_2 = response.jsonPath().getInt("data.pm[0].hasCheck");
Assert.assertEquals(amSize,2,network.message(params,BasicConfig.WORK_getPlanDetail,"上午列表总数错误",response.body().asString()));
Assert.assertEquals(pmSize,1,network.message(params,BasicConfig.WORK_getPlanDetail,"下午列表总数错误",response.body().asString()));
Assert.assertEquals(meetStatus,1,network.message(params,BasicConfig.WORK_getPlanDetail,"上午完成计划状态错误",response.body().asString()));
Assert.assertEquals(phoneStatus,1,network.message(params,BasicConfig.WORK_getPlanDetail,"下午完成计划状态错误",response.body().asString()));
Assert.assertEquals(hasCheck_1,1,network.message(params,BasicConfig.WORK_getPlanDetail,"见面计划盘点状态错误非【已盘】",response.body().asString()));
Assert.assertEquals(hasCheck_2,1,network.message(params,BasicConfig.WORK_getPlanDetail,"电话计划盘点状态错误非【已盘】",response.body().asString()));
}
@Test(description = "主动拨通客户电话计划完成",priority = 142)
@Test(description = "主动拨通客户电话计划完成",priority = 143)
public void 主动拨通客户电话计划完成(){
callling("17823123001","15136361301",10,"dealing");
......@@ -1902,14 +1922,14 @@ public class Work implements Authorization {
HashMap<String,Object> params = new HashMap<>();
params.put("ids", planIds);
Response response = network.getResponse(params,BasicConfig.WORK_getPlanDetail);
int phoneStatus = response.jsonPath().getInt("data.phones[0].planStatus");
int phoneStatus = response.jsonPath().getInt("data.am[1].planStatus");
Assert.assertEquals(phoneStatus,2,network.message(params,BasicConfig.WORK_getPlanDetail,"电话计划状态非已完成",response.body().asString()));
params.clear();
getSellerPlan(0,1,1,1,1,0);
getSellerPlan(1,2,0,1,1,0);
}
@Test(description = "查看历史计划",priority = 143)
@Test(description = "查看历史计划",priority = 144)
public void 查看历史计划(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
......@@ -1917,14 +1937,14 @@ public class Work implements Authorization {
params.put("pageSize", 20);
Response response = network.getResponse(params,BasicConfig.WORK_getPlanList);
int size = response.jsonPath().getInt("data.list.size()");
String planStatusDesc1 = response.jsonPath().getString("data.list[0].planStatusDesc");
String planStatusDes2 = response.jsonPath().getString("data.list[1].planStatusDesc");
String planStatusDesc1 = response.jsonPath().getString("data.list[2].planStatusDesc");
String planStatusDesc2 = response.jsonPath().getString("data.list[0].planStatusDesc");
Assert.assertEquals(planStatusDesc1,"进行中",network.message(params,BasicConfig.WORK_getPlanList,"已完成计划数量错误",response.body().asString()));
Assert.assertEquals(planStatusDes2,"已完成",network.message(params,BasicConfig.WORK_getPlanList,"已完成计划数量错误",response.body().asString()));
Assert.assertEquals(size,4,network.message(params,BasicConfig.WORK_getPlanList,"总计划数量错误",response.body().asString()));
Assert.assertEquals(planStatusDesc2,"已完成",network.message(params,BasicConfig.WORK_getPlanList,"已完成计划数量错误",response.body().asString()));
Assert.assertEquals(size,5,network.message(params,BasicConfig.WORK_getPlanList,"总计划数量错误",response.body().asString()));
}
@Test(description = "获取场景类型",priority = 144)
@Test(description = "获取场景类型",priority = 145)
public void 获取场景类型(){
HashMap<String,Object> params = new HashMap<>();
params.put("sceneType", "1,2");
......@@ -1933,7 +1953,7 @@ public class Work implements Authorization {
Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_getSceneTypes,"场景结果为空",response.body().asString()));
}
@Test(description = "公域引流_删除标签",priority = 145)
@Test(description = "公域引流_删除标签",priority = 146)
public void 公域引流_删除标签(){
otoInviterAuth();
HashMap<String,Object> params = new HashMap<>();
......@@ -1950,7 +1970,7 @@ public class Work implements Authorization {
Assert.assertTrue(id!= tagId ,network.message(params,BasicConfig.MANAGER_oto_tagList,"标签删除后依旧显示",response.body().asString()));
}
@Test(description = "上传KYC",priority = 146)
@Test(description = "上传KYC",priority = 147)
public void 上传KYC(){
otoManagerAuth();
HashMap<String,Object> params = new HashMap<>();
......@@ -1961,7 +1981,7 @@ public class Work implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_kycUpload,"上传KYC失败",response.body().asString()));
}
@Test(description = "上传客户方案",priority = 147)
@Test(description = "上传客户方案",priority = 148)
public void 上传客户方案(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
......@@ -1980,7 +2000,7 @@ public class Work implements Authorization {
Assert.assertEquals(planFiles,2,network.message(params,BasicConfig.WORK_header,"上传客户方案为空",response.body().asString()));
}
@Test(description = "移动策略",priority = 148)
@Test(description = "移动策略",priority = 149)
public void 移动策略(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", strategyId);
......@@ -2001,6 +2021,24 @@ public class Work implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_strategyMove,"上传KYC失败",response.body().asString()));
}
@Test(description = "查看销售的在库客户",priority = 160)
public void 查看销售的在库客户(){
otoTakerAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("custName", "自动化激活用户");
Response response = network.getResponse(params,BasicConfig.WORK_obtainCustBySellerId);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size , 1,network.message(params,BasicConfig.WORK_obtainCustBySellerId,"查看销售在在库客户为空",response.body().asString()));
}
@Test(description = "特定销售可见团队",priority = 161)
public void 特定销售可见团队(){
otoManagerAuth();
Response response = network.getResponse(BasicConfig.WORK_apolloSeller);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size , 3,network.message(BasicConfig.WORK_apolloSeller,"查看销售在在库客户为空",response.body().asString()));
}
//修改客户的约面情况
public void updateInvite(int interviewFlag,long time){
......@@ -2162,21 +2200,21 @@ public class Work implements Authorization {
Response response = network.getResponse(CALL_URL);
}
//获取电话回填客户约面信息
public static void getSellerPlan(int meetFinish,int meetTotal,int phoneFinish,int phoneTotal,int pStatus,int unFinishTypes){
//获取销售个人工作计划
public static void getSellerPlan(int amFinish,int amTotal,int pmFinish,int pmTotal,int pStatus,int unFinishTypes){
HashMap<String, Object> params = new HashMap<>();
params.put("beginTime", beginTime);
Response response = network.getResponse(params,BasicConfig.WORK_getSellerPlanCalendarList);
int meetFinishNum = response.jsonPath().getInt("data["+ tomorrowWeek +"].meetFinishNum");
int meetTotalNum = response.jsonPath().getInt("data["+ tomorrowWeek +"].meetTotalNum");
int phoneFinishNum = response.jsonPath().getInt("data["+ tomorrowWeek +"].phoneFinishNum");
int phoneTotalNum = response.jsonPath().getInt("data["+ tomorrowWeek +"].phoneTotalNum");
Response response = network.postResponse(params,BasicConfig.WORK_getSellerPlanCalendarList);
int amFinishNum = response.jsonPath().getInt("data["+ tomorrowWeek +"].amFinishNum");
int amTotalNum = response.jsonPath().getInt("data["+ tomorrowWeek +"].amTotalNum");
int pmFinishNum = response.jsonPath().getInt("data["+ tomorrowWeek +"].pmFinishNum");
int pmTotalNum = response.jsonPath().getInt("data["+ tomorrowWeek +"].pmTotalNum");
int planStatus = response.jsonPath().getInt("data["+ tomorrowWeek +"].planStatus");
int unFinishPlanActionTypes = response.jsonPath().getInt("data["+ tomorrowWeek +"].unFinishPlanActionTypes.size()");
Assert.assertEquals(meetFinishNum,meetFinish,network.message(params,BasicConfig.WORK_updateFollowUp,"见面完成数量错误",response.body().asString()));
Assert.assertEquals(meetTotalNum,meetTotal,network.message(params,BasicConfig.WORK_updateFollowUp,"见面总数量错误",response.body().asString()));
Assert.assertEquals(phoneFinishNum,phoneFinish,network.message(params,BasicConfig.WORK_updateFollowUp,"电话完成数量错误",response.body().asString()));
Assert.assertEquals(phoneTotalNum,phoneTotal,network.message(params,BasicConfig.WORK_updateFollowUp,"电话总数量错误",response.body().asString()));
Assert.assertEquals(amFinishNum,amFinish,network.message(params,BasicConfig.WORK_updateFollowUp,"上午完成数量错误",response.body().asString()));
Assert.assertEquals(amTotalNum,amTotal,network.message(params,BasicConfig.WORK_updateFollowUp,"上午总数量错误",response.body().asString()));
Assert.assertEquals(pmFinishNum,pmFinish,network.message(params,BasicConfig.WORK_updateFollowUp,"下午完成数量错误",response.body().asString()));
Assert.assertEquals(pmTotalNum,pmTotal,network.message(params,BasicConfig.WORK_updateFollowUp,"下午总数量错误",response.body().asString()));
Assert.assertEquals(planStatus,pStatus,network.message(params,BasicConfig.WORK_updateFollowUp,"今日总计划状态错误",response.body().asString()));
Assert.assertEquals(unFinishPlanActionTypes,unFinishTypes,network.message(params,BasicConfig.WORK_updateFollowUp,"今日计划未完成动作类型数量错误",response.body().asString()));
......
......@@ -241,6 +241,9 @@ public class BasicConfig {
public static final String WORK_planFileUpload= WORK_HOST + "/kjy/oto/manager/customer/planFile/update";
public static final String WORK_kycUpload= WORK_HOST + "/kjy/oto/manager/customer/kyc/update";
public static final String WORK_strategyMove= WORK_HOST + "/kjy/oto/check/strategy/sort/move";
public static final String WORK_obtainCustBySellerId= WORK_HOST + "/kjy/oto/manager/customer/obtainCustBySellerId";
public static final String WORK_saveSelfPlan= WORK_HOST + "/kjy/oto/manager/customer/planList/save";
public static final String WORK_apolloSeller= WORK_HOST + "/kjy/oto/manager/customer/apollo/seller";
//*************************客集集营销平台******************************
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