Commit 4531c3dd authored by 龚小红's avatar 龚小红

Merge remote-tracking branch 'origin/master' into feature/20220524-gxh

parents 28ec5cdd bfdc15e0
...@@ -48,6 +48,11 @@ public interface Authorization { ...@@ -48,6 +48,11 @@ public interface Authorization {
network.agentCookies.put("tku", OTO_TKU); network.agentCookies.put("tku", OTO_TKU);
} }
//oto销售工作台-管理员
default void otoManagerAuth() {
network.agentCookies.put(otoManagerCookieKey, otoManagerCookieValue);
}
/** /**
* 集客助手相关授权 * 集客助手相关授权
......
...@@ -489,7 +489,7 @@ public class LiveMaterial implements Authorization { ...@@ -489,7 +489,7 @@ public class LiveMaterial implements Authorization {
Assert.assertTrue(success, network.message(addEvaluationPar, BasicConfig.MANAGER_evaluation_saveEnable, "接口调用失败", addEvaluationRes.body().asString())); Assert.assertTrue(success, network.message(addEvaluationPar, BasicConfig.MANAGER_evaluation_saveEnable, "接口调用失败", addEvaluationRes.body().asString()));
try { try {
Assert.assertEquals(getEvaDetails(evaluationId).getDefaultResultPic(), resultPhoto, "启用后修改兜底结果图成功"); Assert.assertEquals(getEvaDetails(evaluationId).getDefaultResultPic(), evaluationBGPhoto, "启用后修改兜底结果图失败");
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
Assert.fail("获取数据失败"); Assert.fail("获取数据失败");
......
...@@ -607,7 +607,17 @@ public class Phone implements Authorization { ...@@ -607,7 +607,17 @@ public class Phone implements Authorization {
Assert.assertEquals(dealNumber,"ZDHCSBD000001",network.message(params,BasicConfig.WORK_detail,"新客户投保要素确认状态错误非0",response.body().asString())); Assert.assertEquals(dealNumber,"ZDHCSBD000001",network.message(params,BasicConfig.WORK_detail,"新客户投保要素确认状态错误非0",response.body().asString()));
} }
@Test(description = "销售任务_销售完成任务",priority = 45)
public void 销售任务_销售完成任务(){
//销售完成面访,跟进时间更新,联系新客户任务完成
HashMap<String,Object> params = new HashMap<>();
params.put("taskConfId",4); //任务配置id,4:联系未跟进的客户,5:复拨未接通的客户,6:超过N天未跟进的客户
params.put("pageIndex",1);
params.put("pageSize",20);
Response response = network.getResponse(params,BasicConfig.WORK_taskDetailsList);
int finishCustNum = response.jsonPath().getInt("data.finishCustNum");
Assert.assertTrue(finishCustNum>0,network.message(params,BasicConfig.WORK_taskDetailsList,"已完成数量记录错误",response.body().asString()));
}
@Test(description = "删除客户",priority = 79) @Test(description = "删除客户",priority = 79)
public void 删除客户(){ public void 删除客户(){
......
...@@ -8,10 +8,7 @@ import org.testng.Assert; ...@@ -8,10 +8,7 @@ import org.testng.Assert;
import org.testng.annotations.BeforeTest; import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import static com.kjj.config.BasicConfig.LEADER_ID; import static com.kjj.config.BasicConfig.LEADER_ID;
import static com.kjj.config.BasicConfig.SELLER_ID; import static com.kjj.config.BasicConfig.SELLER_ID;
...@@ -33,6 +30,7 @@ public class Work implements Authorization { ...@@ -33,6 +30,7 @@ public class Work implements Authorization {
chart = new HashMap<>(); chart = new HashMap<>();
otoSellerLogin(); otoSellerLogin();
otoLeaderLogin(); otoLeaderLogin();
otoManagerLogin();
ssoLogin(); ssoLogin();
} }
...@@ -721,4 +719,71 @@ public class Work implements Authorization { ...@@ -721,4 +719,71 @@ public class Work implements Authorization {
Assert.assertEquals(size,0,network.message(BasicConfig.WORK_interviewAuditList,"查看审批列表不为空",response.body().asString())); Assert.assertEquals(size,0,network.message(BasicConfig.WORK_interviewAuditList,"查看审批列表不为空",response.body().asString()));
} }
@Test(description ="获取任务管理列表",priority = 66)
public void 获取任务管理列表(){
otoManagerAuth();
Response response = network.getResponse(BasicConfig.WORK_taskConfList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size==3,network.message(BasicConfig.WORK_taskConfList,"获取任务配置数量错误",response.body().asString()));
}
@Test(description = "修改任务配置",priority = 67)
public void 修改任务配置(){
HashMap<String,Object> params = new HashMap<>();
List list = new ArrayList();
list.add(3);
list.add(4);
list.add(2);
params.put("custSourceList",list);//客户来源:1:缘故客户 2:转介绍客户 3:投放客户 4.直播客户 5.助手客户
params.put("custType",1); //1:全部客户;2:新客户;3:老客户
params.put("id",4);
params.put("limitGoalFlag",0);
params.put("taskUsable",0); //0:任务状态关闭;1:任务状态开启
Response response = network.postResponse(params,BasicConfig.WORK_modifyTaskConf);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_modifyTaskConf,"修改任务失败",response.body().asString()));
//获取任务列表验证修改是否成功
Response listRes = network.getResponse(BasicConfig.WORK_taskConfList);
int custType = listRes.jsonPath().getInt("data[0].custType");
Assert.assertEquals(custType,1,network.message(BasicConfig.WORK_taskConfList,"修改任务配置失败",listRes.body().asString()));
//恢复默认配置
params.clear();
List acqList = new ArrayList();
acqList.add(3);
acqList.add(4);
params.put("custSourceList",list);//客户来源:1:缘故客户 2:转介绍客户 3:投放客户 4.直播客户 5.助手客户
params.put("custType",2); //1:全部客户;2:新客户;3:老客户
params.put("id",4);
params.put("limitGoalFlag",0);
params.put("taskUsable",1); //0:任务状态关闭;1:任务状态开启
Response acqRes = network.postResponse(params,BasicConfig.WORK_modifyTaskConf);
boolean acqData = acqRes.jsonPath().getBoolean("data");
Assert.assertTrue(acqData,network.message(params,BasicConfig.WORK_modifyTaskConf,"修改任务失败",acqRes.body().asString()));
}
@Test(description = "客户总览_销售查看任务",priority = 68)
public void 销售查看任务(){
otosellerAuth();
sleep(2000);
Response response = network.getResponse(BasicConfig.WORK_statisticHeader);
int finishCustNum = response.jsonPath().getInt("data[0].finishCustNum");
System.out.println(finishCustNum);
Assert.assertEquals(finishCustNum,0,network.message(BasicConfig.WORK_statisticHeader,"销售任务统计错误",response.body().asString()));
}
@Test(description = "查看联系新客户任务明细",priority = 69)
public void 查看联系新客户任务明细(){
HashMap<String,Object> params = new HashMap<>();
params.put("taskConfId",4); //任务配置id,4:联系未跟进的客户,5:复拨未接通的客户,6:超过N天未跟进的客户
params.put("pageIndex",1);
params.put("pageSize",20);
Response response = network.getResponse(params,BasicConfig.WORK_taskDetailsList);
int finishCustNum = response.jsonPath().getInt("data.finishCustNum");
int listSize = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(finishCustNum,0,network.message(params,BasicConfig.WORK_taskDetailsList,"已完成数量记录错误",response.body().asString()));
Assert.assertTrue(listSize>0,network.message(params,BasicConfig.WORK_taskDetailsList,"待完成客户数统计错误",response.body().asString()));
}
} }
...@@ -1375,6 +1375,11 @@ public class BasicConfig { ...@@ -1375,6 +1375,11 @@ public class BasicConfig {
public static final String WORK_interviewAuditList= WORK_HOST + "/kjy/oto/manager/audit/getInterviewAuditList"; 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_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_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_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 PHONE_customerList = PHONE_HOST + "/kjy/oto/manager/customer/list"; public static final String PHONE_customerList = PHONE_HOST + "/kjy/oto/manager/customer/list";
public static final String PHONE_customerSave = PHONE_HOST + "/kjy/oto/manager/customer/introduce/save"; public static final String PHONE_customerSave = PHONE_HOST + "/kjy/oto/manager/customer/introduce/save";
......
...@@ -29,7 +29,8 @@ public class BaseUtils { ...@@ -29,7 +29,8 @@ public class BaseUtils {
public static String otoSellerCookieValue; public static String otoSellerCookieValue;
public static String otoLeaderCookieKey; public static String otoLeaderCookieKey;
public static String otoLeaderCookieValue; public static String otoLeaderCookieValue;
public static String otoManagerCookieKey;
public static String otoManagerCookieValue;
/** /**
* 登录管理后台 * 登录管理后台
...@@ -476,4 +477,47 @@ public class BaseUtils { ...@@ -476,4 +477,47 @@ public class BaseUtils {
network.agentCookies.put(otoLeaderCookieKey, otoLeaderCookieValue); //存入cookies network.agentCookies.put(otoLeaderCookieKey, otoLeaderCookieValue); //存入cookies
System.out.println("总监Cookie中key:"+ otoLeaderCookieKey +" ,values:"+ otoLeaderCookieValue); System.out.println("总监Cookie中key:"+ otoLeaderCookieKey +" ,values:"+ otoLeaderCookieValue);
} }
/**
* 管理员登录销售工作台
*/
public static void otoManagerLogin(){
ThreadSleepUtils.sleep(2000);
// 调用登录接口
Map<String, Object> params = new HashMap<String, Object>();
params.put("phoneNumber","15673990207");
Response response = network.getResponse(params,BasicConfig.WORK_getCaptcha);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_getCaptcha,"获取验证码失败",response.body().asString()));
//专用于自动化获取验证码
params.clear();
params.put("phoneNumber","15673990207");
Response autoTestRes = network.getResponse(params,BasicConfig.WORK_verifyCode);
String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha);
//登录接口
ThreadSleepUtils.sleep(2000);
params.clear();
params.put("phoneNumber","15673990207");
params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.WORK_login);
boolean success = loginRes.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params,BasicConfig.WORK_login,"登录失败",loginRes.body().asString()));
//获取cookie
String header = loginRes.getHeader("Set-Cookie");
String cookieStr = header.split(";")[0];
String[] cookieKeyValue = cookieStr.split("=");
otoManagerCookieKey = cookieKeyValue[0];
otoManagerCookieValue = cookieKeyValue[1];
// otoManagerCookieKey = "otoToken";
// otoManagerCookieValue = "2hdZyc3Wrhbokz5QFVTnXxxteUrg4U3szFLLQhKruh4Q6eZAVEBcYAKcwDfN5vGk9MNkshTkxpyidEtujMzGw5X5EsNfV1h7kn2bzap2P8baGi";
network.agentCookies.put(otoManagerCookieKey, otoManagerCookieValue); //存入cookies
System.out.println("销售Cookie中key:"+ otoManagerCookieKey +" ,values:"+ otoManagerCookieValue);
}
} }
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