Commit 3538b18f authored by 龚小红's avatar 龚小红

1.增加CRM的客户管理、成员管理和组织架构

2.拆分CRM的模块测试
parent 5f388511
......@@ -15,22 +15,22 @@ public interface Authorization {
//oto销售工作台-邀约
default void otoInviterAuth() {
network.agentCookies.put("otoToken", otoSellerCookieValue);
network.agentCookies.put("otoToken", "2vXGWopQHdBw2ifGx4KaGu3oDuCNeQkrq11MV7YDzQetPhb7yMBLLCD5FKnzJQEZzX7jf");
}
//oto销售工作台-总监
default void otoLeaderAuth() {
network.agentCookies.put("otoToken", otoLeaderCookieValue);
network.agentCookies.put("otoToken", "2vXGWopQHdBw2ifGx4KaGu3oDuCNeQeNWCTY6pbw6dgTowRdyB9yx2vH9Ms1s2ZytDfvx");
}
//oto销售工作台-管理员
default void otoManagerAuth() {
network.agentCookies.put("otoToken", otoManagerCookieValue);
network.agentCookies.put("otoToken", "2vXGWopQHdBw2ifGx4KaGu3oDuCNeQoDwhdxY78o9v7UciHLhaX3DFVMwLQ4Uf2qhY43R");
}
//oto销售工作台-备用邀约
default void otoInviterAuth2() {
network.agentCookies.put("otoToken", "eTd1Af5HRGuUtkXq6ZtdzRwuM9fHX6s2BC1BV4xQwpt2QLQZHNXtNxqrwCgqqLNHG2prT54");
network.agentCookies.put("otoToken", "eTd1Af5HRGuUtkXq6ZtdzRwvNVjwh6sB2NhFTCLqa73T6ydgm2vDRuM3giYDdvUr21HgWYq");
}
//oto销售工作台-带看销售
......@@ -43,8 +43,24 @@ public interface Authorization {
network.agentCookies.put("otoToken", "eTd1Af5HRGuUtkXq6ZtdzRwvEnnavAmn1XJJP5h7NK6dZxn7af14AMnwtdM7XYhZYmJQjoB");
}
//oto销售工作台-内勤
default void otoAssistAuth() {
network.agentCookies.put("otoToken", "eTd1Af5HRGuUtkXq6ZtdzRwvNVjQg7ddk4UAPJduNEEUBStfPsn3BPxEccQaD8WUiVzNx3y");
}
//oto销售工作台-区域总
default void otoAreaAuth() {
network.agentCookies.put("otoToken", "eTd1Af5HRGuUtkXq6ZtdzRwvNVjQg7ddmpT5XefzaPg6vb8wgK44s4orSoDKaA23DggJTVf");
}
//oto销售工作台-PM
default void otoPMAuth() {
network.agentCookies.put("otoToken", "eTd1Af5HRGuUtkXq6ZtdzRwvNVjQg7ddoq9MJVFKvYaVp1z9n134RNirRVwZYqTQL6PLSVv");
}
//久久保管理员-正常权限模式
default void jjbManagerAuth() {network.agentCookies.put(JJBManagerCookieKey,JJBManagerCookieValue);}
default void jjbManagerAuth() {
network.agentCookies.put(JJBManagerCookieKey,JJBManagerCookieValue);
}
//oto销售工作台手机端-邀约
default void otoInviterTku() { network.agentCookies.put("tku", OTO_INVITER_TKU); }
......
package com.oto.cases.otoseller;
import com.oto.bean.Plan;
import com.oto.cases.admin.Authorization;
import com.oto.config.BasicConfig;
import com.oto.utils.NetworkUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.text.SimpleDateFormat;
import java.util.*;
import static com.oto.cases.otoseller.Invite.sceneId;
import static com.oto.cases.otoseller.Manager.cust_id;
import static com.oto.cases.otoseller.Manager.searchRole;
import static com.oto.cases.otoseller.Work.callling;
import static com.oto.config.BasicConfig.*;
import static com.oto.utils.ThreadSleepUtils.sleep;
public class CheckTask implements Authorization {
private static final NetworkUtils network = NetworkUtils.getInstance();
public String wxUserKey; //外部联系人ID策略
public static String planIds; //计划ids
public static String beginTime; //周一日期
public static int tomorrowWeek; //明日周几
public int strategyId; //盘点策略ID
@BeforeTest
public void setUp(){
otoLeaderAuth();
}
@Test(description = "获取场景类型",priority = 1)
public void 获取场景类型(){
HashMap<String,Object> params = new HashMap<>();
params.put("sceneType", "1,2");
Response response = network.getResponse(params,BasicConfig.WORK_getSceneTypes);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_getSceneTypes,"场景结果为空",response.body().asString()));
}
@Test(description = "查询直播场次",priority = 2)
public void 查询直播场次(){
HashMap<String,Object> params = new HashMap<>();
params.put("liveTitle", "测试直播03");
Response response = network.postResponse(params,BasicConfig.WORK_liveSearch);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_liveSearch,"直播场次结果为空",response.body().asString()));
}
@Test(description = "查询销售或专家列表",priority = 3)
public void 查询销售或专家列表(){
sellerOeExpertList("带看",false,2);//查询销售-【仅查询当前部门及子部门】
sellerOeExpertList("专家",true,2);//查询专家-【仅查询当前部门及子部门】
sellerOeExpertList("自动化",false,2);//查询销售-【仅查询对应角色】
sellerOeExpertList("自动化",true,3);//查询专家-【仅查询对应角色】
}
@Test(description = "查看可筛选标签列表",priority = 4)
public void 查看可筛选标签列表(){
Response response = network.getResponse(BasicConfig.WORK_customerTagList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,3,network.message(BasicConfig.WORK_customerTagList,"查看可筛选标签数量正确",response.body().asString()));
}
@Test(description = "标记和取消促单",priority = 5)
public void 标记和取消促单(){
otoLeaderAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("custId", cust_id);
params.put("promotionType", 1);
Response response = network.postResponse(params, BasicConfig.WORK_promotionUpdate);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_promotionUpdate,"标记促单成功",response.body().asString()));
//查看客户的促单状态
params.put("type", 2);
response = network.getResponse(params,BasicConfig.WORK_header);
int promotionType= response.jsonPath().getInt("data.promotionType");
Assert.assertEquals(promotionType,1,network.message(params,BasicConfig.WORK_header,"客户的促单状态错误",response.body().asString()));
params.put("promotionType", 0);
response = network.postResponse(params,BasicConfig.WORK_promotionUpdate);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_promotionUpdate,"取消促单成功",response.body().asString()));
//查看客户的促单状态
params.put("type", 2);
response = network.getResponse(params,BasicConfig.WORK_header);
promotionType= response.jsonPath().getInt("data.promotionType");
Assert.assertEquals(promotionType,0,network.message(params,BasicConfig.WORK_header,"客户的促单状态错误",response.body().asString()));
}
@Test(description = "总监标记客户星标成功",priority = 6)
public void 总监标记客户星标成功(){
otoLeaderAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("custId", cust_id);
Response response = network.postResponse(params,BasicConfig.WORK_star);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_updateExpertRemark,"标记客户星标失败",response.body().asString()));
params.clear();
params.put("custId", cust_id);
params.put("type", 2);
response = network.getResponse(params,BasicConfig.WORK_header);
int custStar= response.jsonPath().getInt("data.custStar");
Assert.assertEquals(custStar,1,network.message(params,BasicConfig.WORK_header,"标记客户星标失败",response.body().asString()));
}
@Test(description = "上传KYC",priority = 7)
public void 上传KYC(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", cust_id);
params.put("kycImages", new String[]{"//yun.dui88.com/kjy/image/20230113/523669708b5043f5bb4641252e125cb5.jpg","//yun.dui88.com/kjy/image/20230113/edd2e950a8aa4fb2a15ae7400b768fed.jpg"});
Response response = network.postResponse(params,BasicConfig.WORK_kycUpload);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_kycUpload,"上传KYC失败",response.body().asString()));
}
@Test(description = "上传客户方案",priority = 8)
public void 上传客户方案(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", cust_id);
params.put("planFiles",new String[]{"//yun.dui88.com/kjy/media/file/20230113/20230113145555/1.doc","//yun.dui88.com/kjy/media/file/20230131/20230131111229/4.ppt"} );
Response response = network.postResponse(params,BasicConfig.WORK_planFileUpload);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_planFileUpload,"上传客户方案失败",response.body().asString()));
params.clear();
params.put("custId", cust_id);
params.put("type", 2);
response = network.getResponse(params,BasicConfig.WORK_header);
int kycImages= response.jsonPath().getInt("data.kycImages.size()");
int planFiles= response.jsonPath().getInt("data.planFiles.size()");
Assert.assertEquals(kycImages,2,network.message(params,BasicConfig.WORK_header,"上传KYC为空",response.body().asString()));
Assert.assertEquals(planFiles,2,network.message(params,BasicConfig.WORK_header,"上传客户方案为空",response.body().asString()));
}
@Test(description = "特定销售可见团队",priority = 9)
public void 特定销售可见团队(){
otoManagerAuth();
Response response = network.getResponse(BasicConfig.WORK_apolloSeller);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size >1,network.message(BasicConfig.WORK_apolloSeller,"查看销售在在库客户为空",response.body().asString()));
}
@Test(description = "查找企微外部联系人",priority = 10)
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 = 11)
public void 绑定客户企微(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", cust_id);
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,cust_id,network.message(params,BasicConfig.WORK_getWxCustByName,"名字查找外部联系人列表为空",response.body().asString()));
}
@Test(description = "换绑客户企微",priority = 12)
public void 换绑客户企微(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", cust_id+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", cust_id);
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 = 13)
public void 修改重点跟进人(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", cust_id);
params.put("followUp", 4);
Response response = network.postResponse(params,BasicConfig.WORK_updateFollowUp);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_updateFollowUp,"修改重点跟进人失败",response.body().asString()));
params.put("type", 2);
response = network.getResponse(params,BasicConfig.WORK_header);
int followUp= response.jsonPath().getInt("data.followUp");
Assert.assertEquals(followUp,4,network.message(params,BasicConfig.WORK_header,"客户重点跟进人错误",response.body().asString()));
}
@Test(description = "重新分配搜索按照组织架构",priority = 15)
public void 重新分配搜索按照组织架构(){
//销售角色不可搜索到邀约成员
searchRole("勿动-自动化测试邀约",6,0,"check");
//销售角色成功搜索到销售成员
searchRole("勿动-自动化测试带看",6,1,"check");
//销售角色不可搜索到专家成员
searchRole("勿动-自动化测试专家",6,0,"check");
//专家角色不可搜索到邀约成员
searchRole("勿动-自动化测试邀约",4,0,"check");
//专家角色不可搜索到销售成员
searchRole("勿动-自动化测试带看",4,0,"check");
//专家角色成功搜索到专家成员
searchRole("勿动-自动化测试专家",4,1,"check");
//搜索区分组织架构
searchRole("专家",4,2,"check");
}
@Test(description = "自建计划查找销售名下客户",priority = 16)
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 = 17)
public void 总监可看子部门策略(){
otoLeaderAuth();
Response response = network.getResponse(BasicConfig.WORK_strategy_onAbleList);
int size = response.jsonPath().getInt("data.size()");
String strategyName = response.jsonPath().getString("data[0].strategyName");
Assert.assertEquals(size,2,network.message(BasicConfig.WORK_strategy_onAbleList,"总监可看策略数量错误",response.body().asString()));
Assert.assertEquals(strategyName,"自动化盘点策略",network.message(BasicConfig.WORK_strategy_onAbleList,"总监可看策略名称错误",response.body().asString()));
}
@Test(description = "不可新增同名策略",priority = 18)
public void 不可新增同名策略(){
otoManagerAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("strategyName", "自动化盘点策略");
params.put("strategyStatus", 0);
params.put("deptIds", new int[]{29});
Response response = network.postResponse(params,BasicConfig.WORK_strategy_saveOrUpdate);
boolean data = response.jsonPath().getBoolean("success");
Assert.assertFalse(data,network.message(params,BasicConfig.WORK_strategy_saveOrUpdate,"团队新增同名盘点策略成功",response.body().asString()));
}
@Test(description = "查看盘点策略列表",priority = 19)
public void 查看盘点策略列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("strategyName", "自动化盘点策略");
params.put("pageIndex", "1");
params.put("pageSize", 50);
Response response = network.getResponse(params,BasicConfig.WORK_strategy_list);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size,1,network.message(params,BasicConfig.WORK_strategy_list,"新增盘点策略失败",response.body().asString()));
strategyId= response.jsonPath().getInt("data.list[0].id");
}
@Test(description = "移动策略",priority = 20)
public void 移动策略(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", strategyId);
params.put("strategyMove", "down");
Response response = network.postResponse(params,BasicConfig.WORK_strategyMove);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_strategyMove,"上传KYC失败",response.body().asString()));
otoLeaderAuth();
response = network.getResponse(BasicConfig.WORK_strategy_onAbleList);
String strategyName = response.jsonPath().getString("data[1].strategyName");
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(strategyName,"自动化盘点策略",network.message(BasicConfig.WORK_strategy_searchParentSeller,"总监可看策略名称错误",response.body().asString()));
Assert.assertEquals(size,2,network.message(BasicConfig.WORK_strategy_searchParentSeller,"总监可看策略数量错误",response.body().asString()));
otoManagerAuth();
params.put("strategyMove", "up");
response = network.postResponse(params,BasicConfig.WORK_strategyMove);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_strategyMove,"上传KYC失败",response.body().asString()));
}
@Test(description = "修改盘点策略",priority = 22)
public void 修改盘点策略(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", strategyId);
params.put("sellerIds", new int[]{LEADER_ID});
params.put("strategyName", "自动化盘点可用策略");
params.put("strategyStatus", 1);
params.put("deptIds", new int[]{29});
Response response = network.postResponse(params,BasicConfig.WORK_strategy_saveOrUpdate);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_strategy_saveOrUpdate,"修改盘点策略失败",response.body().asString()));
otoLeaderAuth();
response = network.getResponse(BasicConfig.WORK_strategy_onAbleList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,2,network.message(BasicConfig.WORK_strategy_onAbleList,"总监可看策略数量错误",response.body().asString()));
otoManagerAuth();
HashMap<String,Object> params1 = new HashMap<>();
params1.put("strategyName", "自动化盘点可用策略");
params1.put("pageIndex", "1");
params1.put("pageSize", 50);
response = network.getResponse(params1,BasicConfig.WORK_strategy_list);
size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size,1,network.message(params,BasicConfig.WORK_strategy_list,"修改盘点策略失败",response.body().asString()));
params.put("strategyName", "自动化盘点策略");
params.put("strategyStatus", 1);
params.put("deptIds", new int[]{30});
response = network.postResponse(params,BasicConfig.WORK_strategy_saveOrUpdate);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_strategy_saveOrUpdate,"修改盘点策略失败",response.body().asString()));
}
@Test(description = "修改盘点策略状态",priority = 23)
public void 修改盘点策略状态(){
//关闭状态
HashMap<String,Object> params = new HashMap<>();
params.put("id", strategyId);
params.put("strategyStatus", 0);
Response response = network.postResponse(params,BasicConfig.WORK_strategy_updateStatus);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_strategy_updateStatus,"团队新增同名盘点策略成功",response.body().asString()));
otoLeaderAuth();
response = network.getResponse(BasicConfig.WORK_strategy_onAbleList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,1,network.message(BasicConfig.WORK_strategy_onAbleList,"总监可看策略数量错误",response.body().asString()));
//开启状态
params.put("strategyStatus", 1);
response = network.postResponse(params,BasicConfig.WORK_strategy_updateStatus);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_strategy_updateStatus,"团队新增同名盘点策略成功",response.body().asString()));
}
@Test(description = "创建转介绍客户",priority = 24)
public void 创建转介绍客户(){
HashMap<String,Object> params = new HashMap<>();
params.put("addType", 2);
params.put("introducerId", cust_id);
params.put("introducerName", "自动化测试用户7");
params.put("custPhoneNum", "15136361307");
params.put("custName", "自动化测试客户7");
Response response = network.postResponse(params,BasicConfig.WORK_introduce_save);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_introduce_save,"创建转介绍客户失败",response.body().asString()));
params.clear();
sleep(3000);
otoExpertAuth();
params.put("pageIndex", 1);
params.put("pageSize", 50);
params.put("custName", "自动化测试客户7");
response = network.postResponse(params,BasicConfig.WORK_SellerCustList);
int customerId = response.jsonPath().getInt("data.list[0].custId");
params.clear();
params.put("custId", customerId);
params.put("type", 1);
response = network.getResponse(params,BasicConfig.WORK_header);
String introducer = response.jsonPath().getString("data.introducer");
String inviteName = response.jsonPath().getString("data.inviteName");
String expertName = response.jsonPath().getString("data.expertName");
String sellerName = response.jsonPath().getString("data.sellerName");
Assert.assertEquals(introducer,"自动化激活用户",network.message(params,BasicConfig.WORK_updateAddWxStatus,"转介绍客户的介绍人错误",response.body().asString()));
Assert.assertNull(inviteName,network.message(params,BasicConfig.WORK_updateAddWxStatus,"转介绍客户的当前邀约与介绍人不一致",response.body().asString()));
Assert.assertEquals(expertName,"勿动-自动化测试专家",network.message(params,BasicConfig.WORK_updateAddWxStatus,"转介绍客户的当前销售与介绍人不一致",response.body().asString()));
Assert.assertEquals(sellerName,"勿动-自动化测试销售",network.message(params,BasicConfig.WORK_updateAddWxStatus,"转介绍客户的当前专家与介绍人不一致",response.body().asString()));
}
@Test(description = "提交客户盘点",priority = 30)
public void 提交客户盘点(){
otoManagerAuth();
Calendar calendar = new GregorianCalendar();
calendar.setTime(new Date());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
HashMap<String,Object> params = new HashMap<>();
params.put("checkConclusion","客户盘点后的结论1");
params.put("strategyId",strategyId);
params.put("custId",cust_id);
calendar.add(calendar.DATE,2);
ArrayList<Plan> plans = new ArrayList<>();
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");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_saveCheckRecord,"提交客户盘点失败",response.body().asString()));
plans.clear();
sleep(2000);
params.put("checkConclusion","客户盘点后的结论2");
params.put("strategyId",strategyId);
calendar.add(calendar.DATE,-1);
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);
plans.clear();
sleep(2000);
params.put("checkConclusion","客户盘点后的结论");
params.put("strategyId",strategyId);
params.put("plans",plans);
response =network.postResponse(params,BasicConfig.WORK_saveCheckRecord);
}
@Test(description = "查看历史盘点列表",priority = 31)
public void 查看历史盘点列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId",cust_id);
Response response =network.getResponse(params,BasicConfig.WORK_checkList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,3,network.message(params,BasicConfig.WORK_checkList,"提交客户盘点失败",response.body().asString()));
String checkConclusion = response.jsonPath().getString("data[0].checkConclusion");
Assert.assertEquals(checkConclusion,"客户盘点后的结论",network.message(params,BasicConfig.WORK_checkList,"提交客户盘点失败",response.body().asString()));
}
@Test(description = "查看盘点客户列表",priority = 32)
public void 查看盘点客户列表(){
sleep(10000);
HashMap<String,Object> params = new HashMap<>();
params.put("custName","自动化");
params.put("todayCheck",1);
params.put("pageIndex",1);
params.put("pageSize",50);
Response response =network.postResponse(params,BasicConfig.WORK_checkCustList);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_checkCustList,"今日盘点客户不包含刚刚已经盘点的客户",response.body().asString()));
params.put("custName","刘某");
params.put("todayCheck",0);
response =network.postResponse(params,BasicConfig.WORK_checkCustList);
size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size,0,network.message(params,BasicConfig.WORK_checkCustList,"盘点客户可搜索到非本团队的客户",response.body().asString()));
}
@Test(description = "查看盘点计划跟进数据",priority = 33)
public void 查看盘点计划跟进数据(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", cust_id);
Response response = network.getResponse(params,BasicConfig.WORK_getFollowInfo);
boolean hasFollowFlag = response.jsonPath().getBoolean("data.hasFollowFlag");
int size = response.jsonPath().getInt("data.roleTypes.size()");
Assert.assertTrue(hasFollowFlag,network.message(params,BasicConfig.WORK_getFollowInfo,"客户没有销售或专家跟进",response.body().asString()));
Assert.assertEquals(size,2,network.message(params,BasicConfig.WORK_getFollowInfo,"客户的跟进角色错误",response.body().asString()));
}
@Test(description = "销售添加自建计划",priority = 34)
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", cust_id);
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;
}
@Test(description = "销售查看个人工作计划",priority = 35)
public void 销售查看个人工作计划(){
sleep(1000);
getSellerPlan(0,2,0,1,1,0);
}
@Test(description = "可看末级团队",priority = 36)
public void 可看末级团队(){
otoLeaderAuth();
Response response = network.getResponse(BasicConfig.WORK_minimumDept);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,2,network.message(BasicConfig.WORK_minimumDept,"末级团队列表为空",response.body().asString()));
}
@Test(description = "总监查看团队工作计划",priority = 37)
public void 总监查看团队工作计划(){
otoLeaderAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("beginTime", beginTime);
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++){
if(response.jsonPath().getString("data["+i+"].sellerName").equals("勿动-自动化测试带看")){
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,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){
Assert.fail(network.message(params,BasicConfig.WORK_getDirectorPlanCalendarList,"团队计划中不包含总监名下销售",response.body().asString()));
}
}
@Test(description = "查看计划详情",priority = 38)
public void 查看计划详情(){
HashMap<String,Object> params = new HashMap<>();
params.put("ids", planIds);
Response response = network.getResponse(params,BasicConfig.WORK_getPlanDetail);
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 = 39)
public void 主动拨通客户电话计划完成(){
callling("17823123001","15136361301",10,"dealing");
otoTakerAuth();
sleep(1000);
HashMap<String,Object> params = new HashMap<>();
params.put("ids", planIds);
Response response = network.getResponse(params,BasicConfig.WORK_getPlanDetail);
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(1,2,0,1,1,0);
}
@Test(description = "查看历史计划",priority = 40)
public void 查看历史计划(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", cust_id);
params.put("pageIndex", 1);
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[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(planStatusDesc2,"已完成",network.message(params,BasicConfig.WORK_getPlanList,"已完成计划数量错误",response.body().asString()));
Assert.assertEquals(size,5,network.message(params,BasicConfig.WORK_getPlanList,"总计划数量错误",response.body().asString()));
}
//获取销售个人工作计划
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.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(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()));
planIds = response.jsonPath().getString("data["+ tomorrowWeek +"].ids");
planIds =planIds.replaceAll(" ","");
planIds = planIds.substring(1,planIds.length()-1);
}
public void sellerOeExpertList(String name ,boolean expertFlag,int count){
HashMap<String,Object> params = new HashMap<>();
params.put("name", name);
params.put("expertFlag",expertFlag); //false表示查询销售,true表示查询专家
Response response = network.postResponse(params,BasicConfig.WORK_check_sellerList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,count,network.message(params,BasicConfig.WORK_check_sellerList,"结果列表错误",response.body().asString()));
}
}
package com.oto.cases.otoseller;
import com.oto.cases.admin.Authorization;
import com.oto.config.BasicConfig;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.HashMap;
import static com.oto.cases.otoseller.Manager.*;
import static com.oto.cases.otoseller.Work.assignSeller;
import static com.oto.config.BasicConfig.*;
import static com.oto.utils.ThreadSleepUtils.sleep;
public class Depts implements Authorization {
private ArrayList<Integer> custids;
private int autoDeptId;//自动化销售部的部门id
private int autoTeamId;//自动化团队的部门id
@BeforeTest
public void setUp(){
otoManagerAuth();
custids = new ArrayList<Integer>();
custids.add(cust_id+3);
custids.add(cust_id+4);
}
@Test(description = "新建部门",priority = 1)
public void 新建部门(){
HashMap<String,Object> params = new HashMap<>();
params.put("deptName", "勿动-自动化团队");
params.put("parentId", 30);
Response response = network.postResponse(params, BasicConfig.WORK_deptSave);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_deptSave,"新增部门失败",response.body().asString()));
}
@Test(description = "查询部门树",priority = 2)
public void 查询部门树(){
Response response = network.getResponse(BasicConfig.WORK_deptList);
autoTeamId = response.jsonPath().getInt("data[0].children.find{it.id == 29}.children[0].children[0].id");
autoDeptId = response.jsonPath().getInt("data[0].children.find{it.id == 29}.children[0].id");
Assert.assertNotNull(autoDeptId,network.message(BasicConfig.WORK_deptList,"自动化销售部的部门id为空",response.body().asString()));
Assert.assertNotNull(autoTeamId,network.message(BasicConfig.WORK_deptList,"自动化团队的部门id为空",response.body().asString()));
}
@Test(description = "部门存在子部门不可被删除",priority = 3)
public void 部门存在子部门不可被删除(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", autoDeptId);
Response response = network.postResponse(params, BasicConfig.WORK_deptDel);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.WORK_deptDel,"部门存在子部门删除成功",response.body().asString()));
}
@Test(description = "批量设置成员部门",priority = 4)
public void 批量设置成员部门(){
HashMap<String,Object> params = new HashMap<>();
params.put("deptIds", new int[]{autoTeamId});
params.put("sellerIds", new int[]{290,457});
Response response = network.postResponse(params, BasicConfig.WORK_batchAddSeller);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_batchAddSeller,"批量设置成员部门失败",response.body().asString()));
}
@Test(description = "部门存在成员不可被删除",priority = 5)
public void 部门存在成员不可被删除(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", autoTeamId);
Response response = network.postResponse(params, BasicConfig.WORK_deptDel);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.WORK_deptDel,"部门存在成员删除成功",response.body().asString()));
}
@Test(description = "修改部门名称",priority = 6)
public void 修改部门名称(){
HashMap<String,Object> params = new HashMap<>();
params.put("deptName", "勿动-自动化测试团队");
params.put("id", autoTeamId);
Response response = network.postResponse(params, BasicConfig.WORK_deptUpdate);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_deptUpdate,"修改部门名称失败",response.body().asString()));
}
@Test(description = "查看部门成员",priority = 7)
public void 查看部门成员(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", autoTeamId);
params.put("pageIndex", 1);
params.put("pageSize", 20);
Response response = network.postResponse(params, BasicConfig.WORK_listSellerByDeptId);
String deptName = response.jsonPath().getString("data.deptName");
int size = response.jsonPath().getInt("data.page.list.size()");
Assert.assertEquals(deptName,"勿动-自动化测试团队",network.message(params,BasicConfig.WORK_listSellerByDeptId,"修改部门名称失败",response.body().asString()));
Assert.assertEquals(size,2,network.message(params,BasicConfig.WORK_listSellerByDeptId,"批量设置成员部门失败",response.body().asString()));
//还原
params.clear();
params.put("deptIds", new int[]{30});
params.put("sellerIds", new int[]{290,457});
response = network.postResponse(params, BasicConfig.WORK_batchAddSeller);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_batchAddSeller,"批量设置成员部门失败",response.body().asString()));
}
@Test(description = "部门无子部门和成员删除成功",priority = 8)
public void 部门无子部门和成员删除成功(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", autoTeamId);
Response response = network.postResponse(params, BasicConfig.WORK_deptDel);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_deptDel,"部门无子部门和成员删除失败",response.body().asString()));
}
@Test(description = "搜索角色列表",priority = 9)
public void 搜索角色列表(){
//邀约角色成功搜索到邀约成员
searchRole("勿动-自动化测试邀约",1,1,"crm");
//邀约角色不可搜索到销售成员
searchRole("勿动-自动化测试带看",1,0,"crm");
//邀约角色不可搜索到专家成员
searchRole("勿动-自动化测试专家",1,0,"crm");
//销售角色不可搜索到邀约成员
searchRole("勿动-自动化测试邀约",2,0,"crm");
//销售角色成功搜索到销售成员
searchRole("勿动-自动化测试带看",2,1,"crm");
//销售角色不可搜索到专家成员
searchRole("勿动-自动化测试专家",2,0,"crm");
//专家角色不可搜索到邀约成员
searchRole("勿动-自动化测试邀约",3,0,"crm");
//专家角色不可搜索到销售成员
searchRole("勿动-自动化测试带看",3,0,"crm");
//专家角色成功搜索到专家成员
searchRole("勿动-自动化测试专家",3,1,"crm");
//搜索不区分组织架构
searchRole("专家",3,5,"crm");
}
@Test(description = "查看所有产品组列表",priority = 10)
public void 查看所有公司列表(){
Response response = network.getResponse(BasicConfig.WORK_MNG_companyAll);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(BasicConfig.WORK_MNG_companyAll,"查看所有公司列表为空",response.body().asString()));
}
@Test(description = "修改客户的产品组",priority = 11)
public void 修改客户产品组(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId",custids.get(0));
params.put("companyIds",new int[]{119,5,6});
Response response =network.postResponse(params,BasicConfig.WORK_MNG_updateCompany);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_MNG_updateCompany,"修改客户的产品组失败",response.body().asString()));
params.clear();
params.put("pageIndex", 1);
params.put("pageSize", 10);
params.put("phoneNum", "15136361304");
response = network.getResponse(params,BasicConfig.WORK_MNG_customerList);
int companySize = response.jsonPath().getInt("data.list[0].companyIds.size()");
Assert.assertEquals(companySize,3,network.message(params,BasicConfig.WORK_MNG_customerList,"客户的产品组错误",response.body().asString()));
}
@Test(description = "通过销售名称查找销售",priority = 12)
public void 通过销售名称查找销售(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerName", "勿动-自动化测试邀约");
Response response = network.getResponse(params, BasicConfig.WORK_MNG_searchSeller);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.WORK_MNG_searchSeller,"查找结果为空",response.body().asString()));
}
@Test(description = "获取客户来源对应关系列表",priority =13)
public void 获取客户来源对应关系列表(){
Response response = network.getResponse(BasicConfig.WORK_MNG_custSourceList);
String custFromSource = response.jsonPath().getString("data[0].custFromSource");
String desc = response.jsonPath().getString("data[0].desc");
Assert.assertEquals(custFromSource,"01_01-01",network.message(BasicConfig.WORK_MNG_custSourceList,"客户来源枚举值错误",response.body().asString()));
Assert.assertEquals(desc,"投放客户-自建落地页-表单",network.message(BasicConfig.WORK_MNG_custSourceList,"对应的来源描述错误",response.body().asString()));
}
@Test(description = "标签列表",priority = 14)
public void 标签列表(){
Response response = network.getResponse(BasicConfig.WORK_MNG_tagList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size > 10,network.message(BasicConfig.WORK_MNG_tagList, "标签列表为空", response.body().asString()));
}
@Test(description = "批量分配客户",priority = 15)
public void 批量分配客户(){
batchAssignSeller(2,SELLER_ID,custids,"crm"); //批量分配给带看
batchAssignSeller(1,INVITE_ID,custids,"crm"); //批量分配给邀约
batchAssignSeller(3,EXPERT_ID,custids,"crm"); //批量分配给专家
}
@Test(description = "单个分配客户",priority = 16)
public void 单个分配客户(){
assignSeller(cust_id,23,false,1,"crm");
sleep(1000);
assignSeller(cust_id,INVITE_ID,true,1,"crm");
}
@Test(description = "修改客户标签",priority = 17)
public void 修改客户标签(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custids.get(0));
params.put("tagIds", new int[]{22});
Response response = network.postResponse(params, BasicConfig.WORK_MNG_updateTag);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.WORK_MNG_updateTag, "修改客户标签失败", response.body().asString()));
}
@Test(description = "标记成单",priority = 18)
public void 标记成单(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custids.get(0));
params.put("dealFlag", 1);
Response response = network.postResponse(params, BasicConfig.WORK_MNG_updateDealFlag);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.WORK_MNG_updateDealFlag, "标记成单失败", response.body().asString()));
HashMap<String,Object> selectParams = new HashMap<String,Object>();
selectParams.put("pageIndex", 1);
selectParams.put("pageSize", 10);
selectParams.put("phoneNum", "15136361304");
response = network.getResponse(selectParams,BasicConfig.WORK_MNG_customerList);
int tagSize = response.jsonPath().getInt("data.list[0].tagNames.size()");
int dealFlag = response.jsonPath().getInt("data.list[0].dealFlag");
String inviteName = response.jsonPath().getString("data.list[0].inviteVo.sellerName");
String sellerName = response.jsonPath().getString("data.list[0].sellerVo.sellerName");
String expertName = response.jsonPath().getString("data.list[0].expertVo.sellerName");
Assert.assertEquals(tagSize,1 ,network.message(selectParams, BasicConfig.WORK_MNG_customerList, "修改客户标签失败", response.body().asString()));
Assert.assertEquals(dealFlag,1 ,network.message(selectParams, BasicConfig.WORK_MNG_customerList, "标记客户成单失败", response.body().asString()));
Assert.assertEquals(inviteName,"勿动-自动化测试邀约" ,network.message(selectParams, BasicConfig.WORK_MNG_customerList, "当前跟进邀约错误", response.body().asString()));
Assert.assertEquals(sellerName,"勿动-自动化测试带看" ,network.message(selectParams, BasicConfig.WORK_MNG_customerList, "当前跟进销售错误", response.body().asString()));
Assert.assertEquals(expertName,"勿动-自动化测试专家" ,network.message(selectParams, BasicConfig.WORK_MNG_customerList, "当前跟进专家错误", response.body().asString()));
}
@Test(description = "批量给客户打标签",priority = 19)
public void 批量给客户打标签(){
HashMap<String,Object> params = new HashMap<>();
params.put("custIds", custids);
params.put("tagIds", new int[]{20,24});
Response response = network.postResponse(params, BasicConfig.WORK_MNG_batchUpdateTag);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.WORK_MNG_batchUpdateTag, "批量修改客户标签失败", response.body().asString()));
}
@Test(description = "取消成单",priority = 20)
public void 取消成单(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custids.get(0));
params.put("dealFlag", 0);
Response response = network.postResponse(params, BasicConfig.WORK_MNG_updateDealFlag);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.WORK_MNG_updateDealFlag, "取消成单失败", response.body().asString()));
HashMap<String,Object> selectParams = new HashMap<String,Object>();
selectParams.put("pageIndex", 1);
selectParams.put("pageSize", 10);
selectParams.put("phoneNum", "15136361304");
response = network.getResponse(selectParams,BasicConfig.WORK_MNG_customerList);
int tagSize = response.jsonPath().getInt("data.list[0].tagNames.size()");
int dealFlag = response.jsonPath().getInt("data.list[0].dealFlag");
Assert.assertEquals(tagSize,3 ,network.message(selectParams, BasicConfig.WORK_MNG_customerList, "批量打客户标签失败", response.body().asString()));
Assert.assertEquals(dealFlag,0 ,network.message(selectParams, BasicConfig.WORK_MNG_customerList, "取消客户成单失败", response.body().asString()));
}
@Test(description = "跟进人筛选客户",priority = 21)
public void 跟进人筛选客户(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex", 1);
params.put("pageSize", 20);
params.put("otoSidList", 42);
Response response = network.getResponse(params, BasicConfig.WORK_MNG_customerList);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size, 6,network.message(params, BasicConfig.WORK_MNG_customerList, "邀约人筛选结果错误", response.body().asString()));
params.put("otoSidList", 284);
response = network.getResponse(params, BasicConfig.WORK_MNG_customerList);
size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size, 4,network.message(params, BasicConfig.WORK_MNG_customerList, "专家筛选结果错误", response.body().asString()));
params.put("otoSidList", 290);
response = network.getResponse(params, BasicConfig.WORK_MNG_customerList);
size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size, 5,network.message(params, BasicConfig.WORK_MNG_customerList, "带看人筛选结果错误", response.body().asString()));
}
@Test(description = "查询可导入的客户来源列表",priority = 21)
public void 查询可导入的客户来源列表(){
Response response =network.getResponse(BasicConfig.WORK_MNG_getCustSourceEnum);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,3 ,network.message(BasicConfig.WORK_MNG_getCustSourceEnum,"查看可导入的客户来源列表",response.body().asString()));
}
@Test(description = "导入客户文件并成功",priority = 22)
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.WORK_MNG_importOtoCustomer);
int result = response.jsonPath().getInt("data");
Assert.assertNotNull(result,network.message(params,BasicConfig.WORK_MNG_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.WORK_MNG_importResult);
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.WORK_MNG_importResult, "失败原因链接不为空", response.body().asString()));
Assert.assertEquals(successCount, 1,network.message(params, BasicConfig.WORK_MNG_importResult, "导入成功数量不为1", response.body().asString()));
succecss = true;
break;
}
}
Assert.assertTrue(succecss,network.message(params,BasicConfig.WORK_MNG_importResult,"导入客户结果失败",response.body().asString()));
}
@Test(description = "查询导入的文件上传记录",priority = 23)
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.WORK_MNG_listForType);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0 ,network.message(BasicConfig.WORK_MNG_listForType,"查看导入文件上传记录为空",response.body().asString()));
}
@Test(description = "分页查看销售列表",priority = 24)
public void 分页查看销售列表(){
otoLeaderAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex",1);
params.put("pageSize", "20");
Response response = network.getResponse(params,BasicConfig.WORK_MNG_sellerList);
int size = response.jsonPath().getInt("data.list.size()");
int workStatus = response.jsonPath().getInt("data.list.find{it.id == "+ INVITE_ID +"}.workStatus");
int assignNewCustPermission = response.jsonPath().getInt("data.list.find{it.id == "+ INVITE_ID +"}.assignNewCustPermission");
int assignRecycleCustPermission = response.jsonPath().getInt("data.list.find{it.id == "+ INVITE_ID +"}.assignRecycleCustPermission");
int callPermission = response.jsonPath().getInt("data.list.find{it.id == "+ INVITE_ID +"}.callPermission");
Assert.assertEquals(size,11,network.message(params,BasicConfig.WORK_MNG_sellerList,"工作状态错误",response.body().asString()));
Assert.assertEquals(workStatus,1,network.message(params,BasicConfig.WORK_MNG_sellerList,"工作状态错误",response.body().asString()));
Assert.assertEquals(assignNewCustPermission,1,network.message(params,BasicConfig.WORK_MNG_sellerList,"认领新客户及强制分配权限错误",response.body().asString()));
Assert.assertEquals(assignRecycleCustPermission,1,network.message(params,BasicConfig.WORK_MNG_sellerList,"认领回收客户权限错误",response.body().asString()));
Assert.assertEquals(callPermission,1,network.message(params,BasicConfig.WORK_MNG_sellerList,"呼叫权限错误",response.body().asString()));
}
@Test(description = "查看当前登录人仅可选当前及子部门",priority =25)
public void 查看当前登录人仅可选当前及子部门(){
Response response = network.getResponse( BasicConfig.WORK_getDeptList);
boolean root = response.jsonPath().getBoolean("data[0].disabled");
boolean brother = response.jsonPath().getBoolean("data[0].children[0].disabled");
boolean current = response.jsonPath().getBoolean("data[0].children.find{it.id == 29}.disabled");
boolean children = response.jsonPath().getBoolean("data[0].children.find{it.id == 29}.children[0].disabled");
Object grandson= response.jsonPath().getJsonObject("data[0].children.find{it.id == 29}.children[0].children");
Assert.assertTrue(root,network.message(BasicConfig.WORK_getDeptList,"父部门可选择",response.body().asString()));
Assert.assertTrue(brother,network.message(BasicConfig.WORK_getDeptList,"兄弟部门可选择",response.body().asString()));
Assert.assertFalse(current,network.message(BasicConfig.WORK_getDeptList,"当前部门不可选择",response.body().asString()));
Assert.assertFalse(children,network.message(BasicConfig.WORK_getDeptList,"子部门不可选择",response.body().asString()));
Assert.assertNull(grandson,network.message(BasicConfig.WORK_getDeptList,"删除的部门未过滤",response.body().asString()));
}
@Test(description = "修改销售信息",priority = 26)
public void 修改销售信息(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", INVITE_ID);
params.put("sellerName", "勿动-自动化更新邀约");
params.put("phoneNumber", "18248405155");
params.put("roles",new int[]{2,5});
params.put("callPermission", 0);
params.put("roleType", 1);
params.put("sellerStatus", 0);
params.put("companyIds", new int[]{5});
params.put("companyNames", new String[]{"勿动-自动化测试公司"});
params.put("sellerLevel", 2);
params.put("workStatus", 1);
params.put("deptIds", new int[]{30});
params.put("thirdParty",new int[]{1,2});
Response response = network.postResponse(params, BasicConfig.WORK_MNG_sellerUpdate);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_MNG_sellerUpdate,"修改客户失败",response.body().asString()));
sleep(1000);
HashMap<String,Object> selectParam = new HashMap<>();
selectParam.put("sellerName", "勿动-自动化更新邀约");
selectParam.put("phoneNumber", "18248405155");
selectParam.put("pageIndex", "1");
selectParam.put("pageSize", "10");
response = network.getResponse(selectParam, BasicConfig.WORK_MNG_sellerList);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(selectParam,BasicConfig.WORK_MNG_sellerList,"查找结果为空",response.body().asString()));
//还原
params.put("callPermission", 1);
params.put("sellerStatus", 1);
params.put("companyIds", new int[]{5});
params.put("companyNames", new String[]{"勿动-自动化测试公司"});
params.put("sellerLevel", 1);
params.put("roles", new int[]{5});
params.put("deptIds", new int[]{29});
params.put("thirdParty",new int[]{1});
params.put("sellerName", "勿动-自动化测试邀约");
response = network.postResponse(params, BasicConfig.WORK_MNG_sellerUpdate);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_MNG_sellerUpdate,"修改销售失败",response.body().asString()));
}
@Test(description = "不可新增同一手机号销售",priority = 27)
public void 不可新增同一手机号销售(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerName", "勿动-自动化邀约");
params.put("phoneNumber", "18248405155");
params.put("callPermission", 1);
params.put("sellerStatus", 1);
params.put("companyIds", new int[]{5});
params.put("roles", new int[]{5});
params.put("sellerLevel", 1);
params.put("workStatus", 1);
params.put("deptIds", new int[]{18});
params.put("assignNewCustPermission", 1);
params.put("assignRecycleCustPermission", 1);
params.put("thirdParty",new int[]{1,2});
Response response = network.postResponse(params, BasicConfig.WORK_MNG_sellerSave);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.WORK_MNG_sellerSave,"新增同一手机号销售成功",response.body().asString()));
}
@Test(description = "修改工作状态为请假中",priority = 28)
public void 修改工作状态为请假中(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", LEADER_ID);
params.put("workStatus", 0);
Response response = network.postResponse(params, BasicConfig.WORK_MNG_workStatus);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_MNG_workStatus,"修改工作状态为请假中失败",response.body().asString()));
}
@Test(description = "成员名下存在某角色中不可移除成员角色",priority = 29)
public void 成员名下存在某角色中不可移除成员角色(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", INVITE_ID);
params.put("sellerName", "勿动-自动化更新邀约");
params.put("phoneNumber", "18248405155");
params.put("roles",new int[]{2});
params.put("callPermission", 0);
params.put("sellerStatus", 0);
params.put("companyIds", new int[]{5});
params.put("companyNames", new String[]{"勿动-自动化测试公司"});
params.put("sellerLevel", 2);
params.put("workStatus", 1);
params.put("parentId", 28);
Response response = network.postResponse(params, BasicConfig.WORK_MNG_sellerUpdate);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.WORK_MNG_sellerUpdate,"移除存在跟进的邀约角色成功",response.body().asString()));
params.put("id", SELLER_ID);
response = network.postResponse(params, BasicConfig.WORK_MNG_sellerUpdate);
success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.WORK_MNG_sellerUpdate,"移除存在跟进的销售角色成功",response.body().asString()));
params.put("id", EXPERT_ID);
response = network.postResponse(params, BasicConfig.WORK_MNG_sellerUpdate);
success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.WORK_MNG_sellerUpdate,"移除存在跟进的专家角色成功",response.body().asString()));
}
@Test(description = "查看第三方账号列表",priority = 30)
public void 查看第三方账号列表(){
Response response = network.getResponse(BasicConfig.WORK_MNG_accountList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(BasicConfig.WORK_MNG_accountList,"查询第三方账号列表为空",response.body().asString()));
}
@Test(description = "绑定第三方坐席",priority = 31)
public void 绑定第三方坐席(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", INVITE_ID);
params.put("accountName", "8060@fhpcs");
Response response = network.postResponse(params,BasicConfig.WORK_MNG_accountBind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_MNG_accountBind,"绑定第三方账号失败",response.body().asString()));
}
@Test(description = "解绑第三方坐席",priority = 32)
public void 解绑第三方坐席(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", INVITE_ID);
Response response = network.postResponse(params,BasicConfig.WORK_MNG_accountUnbind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_MNG_accountUnbind,"解绑坐席账号失败",response.body().asString()));
}
@Test(description = "查询设备列表",priority = 33)
public void 查询设备列表(){
Response response =network.getResponse(BasicConfig.WORK_MNG_ykList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0 ,network.message(BasicConfig.WORK_MNG_ykList,"查看设备列表为空",response.body().asString()));
}
@Test(description = "绑定设备",priority = 34)
public void 绑定设备(){
HashMap<String,Object> params = new HashMap<>();
params.put("accountName", "imei4");
params.put("sellerId", SELLER_ID);
Response response =network.postResponse(params,BasicConfig.WORK_MNG_ykBind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(BasicConfig.WORK_MNG_ykBind,"绑定设备失败",response.body().asString()));
}
@Test(description = "解绑设备",priority = 35)
public void 解绑设备(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", SELLER_ID);
Response response =network.postResponse(params,BasicConfig.WORK_MNG_ykUnbind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(params,BasicConfig.WORK_MNG_ykUnbind,"解绑设备失败",response.body().asString()));
}
@Test(description = "刷新设备绑定情况",priority = 36)
public void 刷新设备绑定情况(){
Response response =network.postResponse(BasicConfig.WORK_MNG_syncBind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(BasicConfig.WORK_MNG_syncBind,"刷新设备失败",response.body().asString()));
}
@Test(description = "换绑手机并还原",priority = 37)
public void 换绑手机并还原(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", INVITE_ID);
params.put("newPhoneNum", "14783743847");
Response response = network.postResponse(params,BasicConfig.WORK_MNG_changeSellerPhone);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_MNG_changeSellerPhone,"换绑手机号失败",response.body().asString()));
params.clear();
params.put("phoneNumber", "14783743847");
params.put("pageIndex", "1");
params.put("pageSize", "20");
response = network.getResponse(params, BasicConfig.WORK_MNG_sellerList);
int id = response.jsonPath().getInt("data.list[0].id");
Assert.assertEquals(id,INVITE_ID,network.message(params,BasicConfig.WORK_MNG_sellerList,"销售列表为空",response.body().asString()));
params.clear();
params.put("id", INVITE_ID);
params.put("newPhoneNum", "18248405155");
response = network.postResponse(params,BasicConfig.WORK_MNG_changeSellerPhone);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_MNG_changeSellerPhone,"换绑手机号失败",response.body().asString()));
}
@Test(description = "查看销售部门详情",priority = 38)
public void 查看销售部门详情(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", INVITE_ID);
Response response = network.postResponse(params, BasicConfig.WORK_MNG_sellerDetail);
int dept = response.jsonPath().getInt("data.allSidDeptIds[0]");
Assert.assertEquals(dept,29,network.message(params,BasicConfig.WORK_MNG_sellerDetail,"销售列表为空",response.body().asString()));
}
@Test(description = "成员存在跟进入客户不可离职",priority = 40)
public void 成员存在跟进入客户不可离职(){
dimissionStatus(INVITE_ID);
dimissionStatus(SELLER_ID);
dimissionStatus(EXPERT_ID);
}
@Test(description ="获取任务管理列表",priority = 41)
public void 获取任务管理列表(){
otoManagerAuth();
Response response = network.getResponse(BasicConfig.WORK_taskConfList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size==7,network.message(BasicConfig.WORK_taskConfList,"获取任务配置数量错误",response.body().asString()));
}
@Test(description = "修改任务配置",priority = 42)
public void 修改任务配置(){
HashMap<String,Object> params = new HashMap<>();
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_taskEdit);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_taskEdit,"修改任务失败",response.body().asString()));
//获取任务列表验证修改是否成功
Response listRes = network.getResponse(BasicConfig.WORK_taskConfList);
int sellerRole = listRes.jsonPath().getInt("data[0].sellerRole.size()");
int notCustSource = listRes.jsonPath().getInt("data[0].notCustSource.size()");
Assert.assertEquals(sellerRole,2,network.message(BasicConfig.WORK_taskConfList,"修改任务配置失败",listRes.body().asString()));
Assert.assertEquals(notCustSource,1,network.message(BasicConfig.WORK_taskConfList,"修改任务配置失败",listRes.body().asString()));
//恢复默认配置
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_taskEdit);
boolean acqData = acqRes.jsonPath().getBoolean("data");
Assert.assertTrue(acqData,network.message(params,BasicConfig.WORK_taskEdit,"修改任务失败",acqRes.body().asString()));
}
@Test(description = "客户管理查询问题详情",priority = 43)
public void 客户管理查询问题详情(){
HashMap<String,Object> params = new HashMap<>();
params.put("customerId", cust_id);
Response response = network.getResponse(params,BasicConfig.WORK_MNG_qaDetail);;
int answer = response.jsonPath().getInt("data.list[0].optionTitles.size()");
Assert.assertTrue(answer>0,network.message(params,BasicConfig.WORK_MNG_qaDetail,"问题详情为空",response.body().asString()));
}
@Test(description = "会话查询销售",priority = 44)
public void 会话查询销售(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerName", "带看");
Response response = network.getResponse(params,BasicConfig.WORK_conversationGetSellers);;
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,2,network.message(params,BasicConfig.WORK_conversationGetSellers,"问题详情为空",response.body().asString()));
}
@Test(description = "查询企微会话管理",priority = 45)
public void 查询企微会话管理(){
HashMap<String,Object> params = new HashMap<>();
params.put("beginMsgTime","2022-10-01" );
params.put("endMsgTime", "2023-01-01");
params.put("pageIndex", 1);
params.put("pageSize", 20);
Response response = network.postResponse(params,BasicConfig.WORK_wxList);;
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size,0,network.message(params,BasicConfig.WORK_wxList,"问题详情为空",response.body().asString()));
}
@Test(description = "查询微信会话管理",priority = 46)
public void 查询微信会话管理(){
HashMap<String,Object> params = new HashMap<>();
params.put("beginMsgTime","2022-10-01" );
params.put("endMsgTime", "2023-01-01");
params.put("pageIndex", 1);
params.put("pageSize", 20);
Response response = network.postResponse(params,BasicConfig.WORK_ykList);;
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size,0,network.message(params,BasicConfig.WORK_ykList,"问题详情为空",response.body().asString()));
}
@Test(description = "我的审批搜索成员",priority = 47)
public void 我的审批搜索成员(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerName","自动化" );
Response response = network.getResponse(params,BasicConfig.WORK_findMySellerByFuzzyName);;
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size,11,network.message(params,BasicConfig.WORK_findMySellerByFuzzyName,"问题详情为空",response.body().asString()));
}
public void dimissionStatus(int sellreid){
HashMap<String,Object> params = new HashMap<>();
params.put("id", sellreid);
params.put("dimissionStatus", 1);
Response response = network.postResponse(params,BasicConfig.WORK_MNG_switchDimissionStatus);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.WORK_MNG_switchDimissionStatus,"名下存在销售但离职成功",response.body().asString()));
}
}
package com.oto.cases.otoseller;
import com.oto.bean.InvitationRecord;
import com.oto.bean.InviteDay;
import com.oto.cases.admin.Authorization;
import com.oto.config.BasicConfig;
import com.oto.utils.IdMakeUtil;
import com.oto.utils.JsonUtil;
import com.oto.utils.NetworkUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.oto.cases.otoseller.Manager.cust_id;
import static com.oto.cases.otoseller.Work.assignSeller;
import static com.oto.config.BasicConfig.INVITE_ID;
import static com.oto.config.BasicConfig.WX_confirm;
import static com.oto.utils.ThreadSleepUtils.sleep;
public class Invite implements Authorization {
private static final NetworkUtils network = NetworkUtils.getInstance();
public static Map<String,Integer> header;
public Map<String,Double> coefficient;
public static long sceneId;
public String inviteUrl;//邀请函链接
public static long now; //当前时间戳
public static long today; //当前日期0点时间戳
public double takerCoefficient;
public static InvitationRecord recordItem;
@BeforeTest
public void setUp(){
header = new HashMap<>();
coefficient = new HashMap<>();
now = System.currentTimeMillis();
today = now-(now + 8*3600 * 1000) % (60*60*24*1000);
otoManagerAuth();
}
@Test(description = "新增见面场景",priority = 1)
public void 新增见面场景(){
HashMap<String,Object> params = new HashMap<>();
params.put("confUsable",1);
params.put("companyIds",new int[]{5});
params.put("sceneName","勿动-自动化场景");
params.put("sceneType",2);
params.put("sceneDesc","勿动,这是自动化测试专用的面访场景");
Response response =network.postResponse(params, BasicConfig.WORK_custConfSave);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_custConfSave,"新增见面场景失败",response.body().asString()));
}
@Test(description = "查看见面场景列表",priority = 2)
public void 查看见面场景列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex",1);
params.put("pageSize",20);
Response response =network.getResponse(params,BasicConfig.WORK_custConfList);
int size = response.jsonPath().getInt("data.list.size()");
int confUsable = response.jsonPath().getInt("data.list[0].confUsable");
String sceneName = response.jsonPath().getString("data.list[0].sceneName");
Assert.assertTrue(size>0 ,network.message(params,BasicConfig.WORK_custConfList,"查看列表场景不为空",response.body().asString()));
Assert.assertEquals(confUsable, 1,network.message(params,BasicConfig.WORK_custConfList,"查看见面场景非0",response.body().asString()));
Assert.assertEquals(sceneName,"勿动-自动化场景",network.message(params,BasicConfig.WORK_custConfList,"查看见面名称错误",response.body().asString()));
sceneId = response.jsonPath().getLong("data.list[0].id");
}
@Test(description = "修改见面场景",priority = 3)
public void 修改见面场景(){
int companyIds[] ={5};
HashMap<String,Object> params = new HashMap<>();
params.put("id",sceneId);
params.put("confUsable",1);
params.put("sceneType",1);
params.put("companyIds",companyIds);
params.put("sceneName","勿动-自动化面访场景");
params.put("sceneDesc","勿动,这是自动化测试专用的面访场景");
Response response =network.postResponse(params,BasicConfig.WORK_custConfSave);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_custConfSave,"修改自动化场景失败",response.body().asString()));
}
@Test(description = "查看客户面访状态为尚未约到",priority = 4)
public void 查看客户面访状态为尚未约到(){
otoInviterAuth();
getHasFirstInvite(-1,true);
}
@Test(description = "修改客户面访状态为明确拒绝",priority = 5)
public void 修改客户面访状态为明确拒绝(){
updateInvite(0,now+86400000);
getHasFirstInvite(0,true);
}
@Test(description = "修改客户面访状态为已约到时间未定",priority = 6)
public void 修改客户面访状态为已约到时间未定(){
updateInvite(2,now+86400000);
getHasFirstInvite(2,true);
}
@Test(description = "获取客户适用场景",priority = 7)
public void 获取客户适用场景(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId",cust_id);
Response response =network.getResponse(params,BasicConfig.WORK_getAllSceneConfs);
int size = response.jsonPath().getInt("data.size()");
int confUsableSize = response.jsonPath().getInt("data.findAll{it.confUsable == 1}.size()");
Assert.assertEquals(size,3 ,network.message(params,BasicConfig.WORK_getAllSceneConfs,"面访场景包含场景未根据产品组关联",response.body().asString()));
Assert.assertEquals(confUsableSize,2 ,network.message(params,BasicConfig.WORK_getAllSceneConfs,"面访场景包含场景未根据产品组关联",response.body().asString()));
}
@Test(description = "修改客户面访承诺时间为1天后",priority = 8)
public void 修改客户面访承诺时间为1天后(){
updateInvite(1,now+86400000);
getHasFirstInvite(1,true);
getCallCustInfo(1);
}
@Test(description = "查看约面日历为已确认",priority = 9)
public void 查看约面日历为已确认(){
getCalendarlist(today+86400000,2,"自动化激活用户","勿动-自动化测试邀约");
}
@Test(description = "修改客户具体时间客户状态不变",priority = 10)
public void 修改客户具体时间客户状态不变(){
updateInvite(1,now + 86400000+3600000);
getHasFirstInvite(1,true);
getCallCustInfo(1);
getCalendarlist(today+86400000,2,"自动化激活用户","勿动-自动化测试邀约");
}
@Test(description = "修改客户具体日期,老邀约为已鸽",priority = 11)
public void 修改客户具体日期老邀约变为已鸽(){
updateInvite(1,now + 86400000*2);
getHasFirstInvite(1,true);
getCallCustInfo(1);
getCalendarlist(today+86400000,3,"自动化激活用户","勿动-自动化测试邀约");
getCalendarlist(today+86400000*2,1,"自动化激活用户","勿动-自动化测试邀约");
}
@Test(description = "修改客户未约到客户状态变为已鸽",priority = 12)
public void 修改客户未约到客户状态变为已鸽(){
updateInvite(0,now + 3600000);
getHasFirstInvite(0,true);
getCallCustInfo(0);;
getCalendarlist(today+86400000*2,3,"自动化激活用户","勿动-自动化测试邀约");
}
@Test(description = "修改客户已约到客户状态时间今天后变为已确认",priority =13)
public void 修改客户已约到客户状态时间今天后变为已确认(){
updateInvite(1,now + 3600000);
getHasFirstInvite(1,true);
getCallCustInfo(1);
getCalendarlist(today,2,"自动化激活用户","勿动-自动化测试邀约");
}
@Test(description = "查询客户的面访上传记录<1",priority = 14)
public void 查询客户的面访上传记录(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId",cust_id);
Response response =network.getResponse(params,BasicConfig.WORK_invire);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertFalse(data ,network.message(params,BasicConfig.WORK_invire,"上传面访记录>=1",response.body().asString()));
}
@Test(description = "生成加微邀请函二维码",priority = 15)
public void 生成加微邀请函二维码(){
HashMap<String,Object> params = new HashMap<>();
params.put("content",inviteUrl);
params.put("height",209);
params.put("width",209);
Response response =network.postResponse(params,BasicConfig.WORK_generate);
String data = response.jsonPath().getString("data");
Assert.assertNotNull(data ,network.message(params,BasicConfig.WORK_generate,"二维码生成失败",response.body().asString()));
}
@Test(description = "查看邀请函客户信息",priority = 16)
public void 查看邀请函客户信息(){
agent2Tku();
HashMap<String,Object> params = new HashMap<>();
params.put("custId", IdMakeUtil.encodingId((long)cust_id));
Response response =network.postResponse(params,BasicConfig.WX_look);
String visitDate = response.jsonPath().getString("data.visitDate");
int visitorNum = response.jsonPath().getInt("data.visitorNum");
boolean confirmFlag = response.jsonPath().getBoolean("data.confirmFlag");
Assert.assertNotNull(visitDate ,network.message(params,BasicConfig.WX_look,"约面状态未更新为【已约到】",response.body().asString()));
Assert.assertEquals(visitorNum ,10,network.message(params,BasicConfig.WX_look,"约面状态未更新为【已约到】",response.body().asString()));
Assert.assertFalse(confirmFlag ,network.message(params,BasicConfig.WX_look,"约面状态未更新为【已约到】",response.body().asString()));
}
@Test(description = "客户确认邀请函",priority = 17)
public void 客户确认邀请函(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", IdMakeUtil.encodingId((long)cust_id));
Response response =network.postResponse(params, WX_confirm);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(params,BasicConfig.WX_confirm,"客户确认邀请函失败",response.body().asString()));
otoInviterAuth();
}
@Test(description = "邀约组拨打电话回填面访信息正常",priority = 18)
public void 邀约组拨打电话回填面访信息正常(){
getCallCustInfo(1);
getHasFirstInvite(1,true);
}
@Test(description = "关闭见面场景状态",priority = 19)
public void 关闭见面场景状态(){
HashMap<String,Object> params = new HashMap<>();
params.put("id",sceneId);
params.put("confUsable",0);
Response response =network.postResponse(params,BasicConfig.WORK_updateStatus);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_updateStatus,"关闭见面场景失败",response.body().asString()));
}
@Test(description = "重新分配邀约后邀约任务继承",priority = 20)
public void 重新分配邀约后邀约任务继承(){
//重新分配邀约
assignSeller(cust_id,320,true,1,"crm");
//查看回显
getHasFirstInvite(1,true);
getCallCustInfo(1);
getCalendarlist(today,2,"自动化激活用户","勿动-自动化备用邀约");
//还原
assignSeller(cust_id,INVITE_ID,true,1,"crm");
}
@Test(description = "CRM查询场景专家列表",priority = 21)
public void CRM查询场景专家列表(){
otoManagerAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("recordId",recordItem.recordId);
params.put("expertFlag",true);
Response response =network.getResponse(params,BasicConfig.WORK_calendar_workMenu);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,3 ,network.message(BasicConfig.WORK_calendar_workMenu,"查看产品列表不为空",response.body().asString()));
}
@Test(description = "CRM查询场景带看人列表",priority = 22)
public void CRM查询场景带看人列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("recordId",recordItem.recordId);
params.put("expertFlag",false);
Response response =network.getResponse(params,BasicConfig.WORK_calendar_workMenu);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,2 ,network.message(BasicConfig.WORK_calendar_workMenu,"查看产品列表不为空",response.body().asString()));
}
@Test(description = "预分配客户",priority = 23)
public void 预分配客户(){
otoInviterAuth();
coefficient.put("totalCoefficient",getSellertotalCoefficient());
otoTakerAuth();
takerCoefficient = getSellertotalCoefficient();
otoInviterAuth();
//预分配
HashMap<String,Object> params = new HashMap<>();
otoInviterAuth();
params.put("recordId",recordItem.recordId);
params.put("takeLookId",290);
params.put("expertId",284);
Response response =network.postResponse(params,BasicConfig.WORK_calendar_preAssign);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_calendar_preAssign,"预分配失败",response.body().asString()));
//验证约面日历状态/专家/带看人变更
getCalendarlist(today,4,"自动化激活用户","勿动-自动化测试邀约");
Assert.assertEquals(recordItem.expertName,"勿动-自动化测试专家",network.message(params,BasicConfig.WORK_calendar_list,"专家名称错误",response.body().asString()));
Assert.assertEquals(recordItem.takeLookName,"勿动-自动化测试带看",network.message(params,BasicConfig.WORK_calendar_list,"带看人名称错误",response.body().asString()));
Assert.assertTrue(recordItem.hasAssignFlag,network.message(params,BasicConfig.WORK_calendar_list,"是否分配状态非【已分配】",response.body().asString()));
//验证邀约人系数不变
double sellertotalCoefficient = getSellertotalCoefficient();
Assert.assertEquals(sellertotalCoefficient,coefficient.get("totalCoefficient"),network.message(params,BasicConfig.WORK_coefficient_detail,"邀约人系数变化",response.body().asString()));
//验证带看人系数不变
otoTakerAuth();
double leadertotalCoefficient = getSellertotalCoefficient();
Assert.assertEquals(leadertotalCoefficient,takerCoefficient,network.message(params,BasicConfig.WORK_coefficient_detail,"邀约人系数未增加",response.body().asString()));
}
@Test(description = "退回邀约组",priority = 24)
public void 退回邀约组(){
//退回邀约组
otoManagerAuth();
HashMap<String,Object> params = new HashMap<>();
otoInviterAuth();
params.put("recordId",recordItem.recordId);
Response response =network.postResponse(params,BasicConfig.WORK_calendar_assignRollback);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_calendar_assignRollback,"退回邀约组失败",response.body().asString()));
//验证约面日历状态/专家/带看人清空
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()));
otoInviterAuth();
//验证邀约人系数不变
double sellertotalCoefficient = getSellertotalCoefficient();
Assert.assertEquals(sellertotalCoefficient,coefficient.get("totalCoefficient"),network.message(params,BasicConfig.WORK_coefficient_detail,"邀约人系数变化",response.body().asString()));
}
@Test(description = "立即分配邀约客户",priority = 25)
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);
params.put("takeLookId",290);
params.put("expertId",284);
Response response =network.postResponse(params,BasicConfig.WORK_calendar_nowAssign);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_calendar_nowAssign,"立即分配失败",response.body().asString()));
//验证约面日历状态/专家/带看人变更
getCalendarlist(today,4,"自动化激活用户","勿动-自动化测试邀约");
Assert.assertEquals(recordItem.expertName,"勿动-自动化测试专家",network.message(params,BasicConfig.WORK_calendar_list,"专家名称错误",response.body().asString()));
Assert.assertEquals(recordItem.takeLookName,"勿动-自动化测试带看",network.message(params,BasicConfig.WORK_calendar_list,"带看人名称错误",response.body().asString()));
Assert.assertTrue(recordItem.hasAssignFlag,network.message(params,BasicConfig.WORK_calendar_list,"是否分配状态非【已分配】",response.body().asString()));
//验证邀约人系数不变
otoInviterAuth();
double sellertotalCoefficient = getSellertotalCoefficient();
Assert.assertEquals(sellertotalCoefficient,coefficient.get("totalCoefficient"),network.message(params,BasicConfig.WORK_coefficient_detail,"邀约人系数变化",response.body().asString()));
//验证带看人系数增加
otoTakerAuth();
double leadertotalCoefficient = getSellertotalCoefficient();
Assert.assertTrue(leadertotalCoefficient>takerCoefficient,network.message(params,BasicConfig.WORK_coefficient_detail,"带看人系数未增加",response.body().asString()));
takerCoefficient = leadertotalCoefficient;
}
//获取销售系数
public Double getSellertotalCoefficient(){
sleep(1000);
Response response =network.getResponse(BasicConfig.WORK_coefficient_detail);
Double totalCoefficient = response.jsonPath().getDouble("data.totalCoefficient");
Assert.assertTrue(totalCoefficient>=0,network.message(BasicConfig.WORK_coefficient_detail,"销售总系数<0",response.body().asString()));
return totalCoefficient;
}
//获取电话回填客户约面信息
public void getCallCustInfo(int interviewFlag){
sleep(1000);
HashMap<String,Object> params = new HashMap<>();
params.put("custId", cust_id);
Response response =network.getResponse(params,BasicConfig.WORK_getCallCustInfo);
int firstInterviewFlag = response.jsonPath().getInt("data.firstInterviewFlag");
Assert.assertEquals(firstInterviewFlag ,interviewFlag ,network.message(params,BasicConfig.WORK_getCallCustInfo,"约面状态回显非"+"",response.body().asString()));
if(interviewFlag == 1){
String interviewTime = response.jsonPath().getString("data.interviewTime");
Assert.assertNotNull(interviewTime ,network.message(params,BasicConfig.WORK_getCallCustInfo,"约面状态未更新为【已约到】",response.body().asString()));
}else {
String nextContactTime = response.jsonPath().getString("data.nextContactTime");
Assert.assertNotNull(nextContactTime ,network.message(params,BasicConfig.WORK_getCallCustInfo,"约面状态未更新为【已约到】",response.body().asString()));
}
}
//修改客户的约面情况
public void updateInvite(int interviewFlag,long time){
HashMap<String,Object> params = new HashMap<>();
params.put("custId",cust_id);
params.put("eventType",2);
params.put("firstInterviewFlag",interviewFlag);
if(interviewFlag == 1){ //1为已约到需要填写时间地点
params.put("interviewConfId",440);
params.put("interviewTime",time);
params.put("haveMealFlag",1);
params.put("pickTakeFlag",1);
params.put("custNum",10);
params.put("pickTakeAddress","杭州数字娱乐大厦");
params.put("receiveAndSendOffTime",time-3600000);
} 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()));
}
//获取客户详情回填的客户约面信息
public void getHasFirstInvite(int interviewFlag,boolean isinviter){
sleep(1000);
HashMap<String,Object> params = new HashMap<>();
params.put("custId",cust_id);
Response response =network.getResponse(params,BasicConfig.WORK_getHasFirstInvite);
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()));
}
}
}
}
//获取约面日历列表
public static void getCalendarlist(long calendarTime,int inviteStatus,String custName,String inviterName){
sleep(1000);
int flag= 0 ;
HashMap<String,Object> params = new HashMap<>();
SimpleDateFormat sdt = new SimpleDateFormat("yyyy-MM-dd");
params.put("calendarTime", sdt.format(now));
Response response =network.getResponse(params,BasicConfig.WORK_calendar_list);
List<InviteDay> invitationList = JsonUtil.parseResponseToListBean(response, InviteDay.class);
for (InviteDay day: invitationList) {
if(day.calendarTime == calendarTime){
for(InvitationRecord record:day.invitationInfo) {
if(record.custName != null && record.custName.equals(custName)){
flag=1;
recordItem = record;
Assert.assertEquals(record.inviteStatus, inviteStatus ,network.message(params,BasicConfig.WORK_calendar_list,"约面状态回显非"+inviteStatus,response.body().asString()));
Assert.assertEquals(record.inviterName, inviterName ,network.message(params,BasicConfig.WORK_calendar_list,"邀约人非【"+inviterName+"】",response.body().asString()));
break;
}
}
break;
}
}
if(flag == 0){
Assert.fail("未找到相应的约面记录");
}
}
}
package com.oto.cases.otoseller;
import com.alibaba.fastjson.JSONObject;
import com.oto.cases.admin.Authorization;
import com.oto.config.BasicConfig;
import com.oto.utils.IdMakeUtil;
......@@ -15,6 +14,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import static com.oto.cases.otoseller.Work.assignSeller;
import static com.oto.config.BasicConfig.*;
import static com.oto.utils.BaseUtils.ssoLogin;
import static com.oto.utils.ThreadSleepUtils.sleep;
......@@ -22,7 +22,9 @@ import static com.oto.utils.ThreadSleepUtils.sleep;
public class Manager implements Authorization {
private static final NetworkUtils network = NetworkUtils.getInstance();
public static int cust_id;
private String insureOrderstr; //告知书的保单号
public static int tagId; //标签ID
private String pdfUrl; //告知书的模板pdfURL
private String encryptId; //告知书的加密id
private int linkId; //直播投放链接id
......@@ -35,116 +37,9 @@ public class Manager implements Authorization {
ssoLogin();
}
@Test(description = "分页查看销售列表",priority = 1)
public void 分页查看销售列表(){
Response response = null;
HashMap<String,Object> params = new HashMap<>();
int size= 0 ;
int i= 10;
while(size<1 && i<20){
params.put("pageIndex",i);
params.put("pageSize", "20");
response = network.getResponse(params, BasicConfig.MANAGER_oto_sellerList);
size = response.jsonPath().getInt("data.list.findAll{it.id == "+ INVITE_ID +"}.size()");
i++;
}
int workStatus = response.jsonPath().getInt("data.list.find{it.id == "+ INVITE_ID +"}.workStatus");
int assignNewCustPermission = response.jsonPath().getInt("data.list.find{it.id == "+ INVITE_ID +"}.assignNewCustPermission");
int assignRecycleCustPermission = response.jsonPath().getInt("data.list.find{it.id == "+ INVITE_ID +"}.assignRecycleCustPermission");
int callPermission = response.jsonPath().getInt("data.list.find{it.id == "+ INVITE_ID +"}.callPermission");
Assert.assertEquals(workStatus,1,network.message(params,BasicConfig.MANAGER_oto_searchSeller,"工作状态错误",response.body().asString()));
Assert.assertEquals(assignNewCustPermission,1,network.message(params,BasicConfig.MANAGER_oto_searchSeller,"认领新客户及强制分配权限错误",response.body().asString()));
Assert.assertEquals(assignRecycleCustPermission,1,network.message(params,BasicConfig.MANAGER_oto_searchSeller,"认领回收客户权限错误",response.body().asString()));
Assert.assertEquals(callPermission,1,network.message(params,BasicConfig.MANAGER_oto_searchSeller,"呼叫权限错误",response.body().asString()));
}
@Test(description = "通过销售名称查找销售",priority = 2)
public void 通过销售名称查找销售(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerName", "勿动-自动化测试邀约");
Response response = network.getResponse(params, BasicConfig.MANAGER_oto_searchSeller);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.MANAGER_oto_searchSeller,"查找结果为空",response.body().asString()));
}
@Test(description = "修改销售信息",priority = 3)
public void 修改销售信息(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", INVITE_ID);
params.put("sellerName", "勿动-自动化更新邀约");
params.put("phoneNumber", "18248405155");
params.put("roles",new int[]{2,5});
params.put("callPermission", 0);
params.put("roleType", 1);
params.put("sellerStatus", 0);
params.put("companyIds", new int[]{5});
params.put("companyNames", new String[]{"勿动-自动化测试公司"});
params.put("sellerLevel", 2);
params.put("workStatus", 1);
params.put("parentId", 28);
params.put("thirdParty",new int[]{1,2});
System.out.println(JSONObject.toJSONString(params));
Response response = network.postResponse(params, BasicConfig.MANAGER_oto_updateSeller);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_updateSeller,"修改客户失败",response.body().asString()));
sleep(1000);
HashMap<String,Object> selectParam = new HashMap<>();
selectParam.put("sellerName", "勿动-自动化更新邀约");
selectParam.put("phoneNumber", "18248405155");
selectParam.put("pageIndex", "1");
selectParam.put("pageSize", "10");
response = network.getResponse(selectParam, BasicConfig.MANAGER_oto_sellerList);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(selectParam,BasicConfig.MANAGER_oto_sellerList,"查找结果为空",response.body().asString()));
//还原
params.put("callPermission", 1);
params.put("sellerStatus", 1);
params.put("companyIds", new int[]{5});
params.put("companyNames", new String[]{"勿动-自动化测试公司"});
params.put("sellerLevel", 1);
params.put("roles", new int[]{5,});
params.put("parentId", LEADER_ID);
params.put("thirdParty",new int[]{1});
params.put("sellerName", "勿动-自动化测试邀约");
response = network.postResponse(params, BasicConfig.MANAGER_oto_updateSeller);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_updateSeller,"修改客户失败",response.body().asString()));
}
@Test(description = "查询渠道列表",priority = 4)
public void 查询渠道列表(){
Response response = network.getResponse(BasicConfig.MANAGER_oto_channelList);
int size = response.jsonPath().getInt("data.size");
Assert.assertTrue(size>0,network.message(BasicConfig.MANAGER_oto_channelList,"渠道列表为空",response.body().asString()));
}
@Test(description = "不可新增同一手机号销售",priority = 5)
public void 不可新增同一手机号销售(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerName", "勿动-自动化邀约");
params.put("phoneNumber", "18248405155");
params.put("roleType", 1);
params.put("callPermission", 1);
params.put("sellerStatus", 1);
params.put("companyIds", new int[]{5});
params.put("roles", new int[]{5});
params.put("sellerLevel", 1);
params.put("workStatus", 1);
params.put("assignNewCustPermission", 1);
params.put("assignRecycleCustPermission", 1);
params.put("thirdParty",new int[]{1,2});
Response response = network.postResponse(params, BasicConfig.MANAGER_oto_saveSeller);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.MANAGER_oto_saveSeller,"新增同一手机号销售成功",response.body().asString()));
}
//
@Test(description = "公域引流_填写表单",priority = 6)
@Test(description = "公域引流_填写表单",priority = 1)
public void 公域引流_填写表单(){
for(int i = 1;i<4;i++){
for(int i = 0;i<6;i++){
PubForm("1513636130"+i,"自动化测试用户"+i);
}
......@@ -163,7 +58,23 @@ public class Manager implements Authorization {
}
@Test(description = "不可新增同名公司",priority = 7)
@Test(description = "通过销售名称查找销售",priority = 2)
public void 通过销售名称查找销售(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerName", "勿动-自动化测试邀约");
Response response = network.getResponse(params, BasicConfig.MANAGER_oto_searchSeller);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.MANAGER_oto_searchSeller,"查找结果为空",response.body().asString()));
}
@Test(description = "查询渠道列表",priority = 3)
public void 查询渠道列表(){
Response response = network.getResponse(BasicConfig.MANAGER_oto_channelList);
int size = response.jsonPath().getInt("data.size");
Assert.assertTrue(size>0,network.message(BasicConfig.MANAGER_oto_channelList,"渠道列表为空",response.body().asString()));
}
@Test(description = "不可新增同名公司",priority = 4)
public void 不可新增同名公司(){
HashMap<String,Object> params = new HashMap<>();
params.put("companyName", "勿动-自动化测试公司");
......@@ -175,8 +86,8 @@ public class Manager implements Authorization {
Assert.assertFalse(success,network.message(params,BasicConfig.MANAGER_oto_saveCompany,"新增同名公司成功",response.body().asString()));
}
@Test(description = "修改产品组信息",priority = 8)
public void 修改产品信息(){
@Test(description = "修改产品信息",priority = 5)
public void 修改产品信息(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", 5);
params.put("areaCodes", new String[]{"330000", "330100"});
......@@ -188,7 +99,7 @@ public class Manager implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_updateCompany,"修改客户失败",response.body().asString()));
}
@Test(description = "分页查看产品组列表",priority = 9)
@Test(description = "分页查看产品组列表",priority = 6)
public void 分页查看产品组列表(){
HashMap<String,Object> params = new HashMap<>();
int size= 0 ;
......@@ -216,36 +127,21 @@ public class Manager implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_updateCompany,"修改客户失败",response.body().asString()));
}
@Test(description = "查看所有产品组列表",priority = 10)
@Test(description = "查看所有产品组列表",priority = 7)
public void 查看所有公司列表(){
Response response = network.getResponse(BasicConfig.MANAGER_oto_listAllCompany);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(BasicConfig.MANAGER_oto_listAllCompany,"查看所有公司列表为空",response.body().asString()));
}
@Test(description = "查看所有总监列表",priority = 11)
@Test(description = "查看所有总监列表",priority = 8)
public void 查看所有总监列表(){
Response response = network.getResponse(BasicConfig.MANAGER_oto_directorList);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(BasicConfig.MANAGER_oto_directorList,"查看所有总监列表为空",response.body().asString()));
}
@Test(description = "修改工作状态为请假中",priority = 12)
public void 修改工作状态为请假中(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", LEADER_ID);
params.put("workStatus", 0);
Response response = network.postResponse(params, BasicConfig.MANAGER_oto_switchWorkStatus);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_updateCompany,"修改工作状态为请假中失败",response.body().asString()));
}
@Test(description = "总监名下有销售离职失败",priority = 13)
public void 总监名下有销售离职失败(){
dimissionStatus(43);
}
@Test(description = "修改公司产品",priority = 14)
@Test(description = "修改公司产品",priority =9)
public void 修改公司产品(){
ArrayList companyIds = new ArrayList();
companyIds.add(5);
......@@ -269,7 +165,7 @@ public class Manager implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_productSave,"修改公司产品失败",response.body().asString()));
}
@Test(description = "查看产品列表",priority = 15)
@Test(description = "查看产品列表",priority = 10)
public void 查看产品列表(){
Response response = null;
HashMap<String,Object> params = new HashMap<>();
......@@ -290,7 +186,7 @@ public class Manager implements Authorization {
Assert.assertEquals(prodName,"勿动-自动化专用产品更新",network.message(params,BasicConfig.MANAGER_oto_productList,"产品的名称未更新",response.body().asString()));
}
@Test(description = "还原公司产品",priority = 16)
@Test(description = "还原公司产品",priority = 11)
public void 还原公司产品(){
ArrayList companyIds = new ArrayList();
companyIds.add(5);
......@@ -316,58 +212,8 @@ public class Manager implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_productSave,"修改公司产品失败",response.body().asString()));
}
@Test(description = "查看第三方账号列表",priority = 17)
public void 查看第三方账号列表(){
Response response = network.getResponse(BasicConfig.MANAGER_oto_accountList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(BasicConfig.MANAGER_oto_accountList,"查询第三方账号列表为空",response.body().asString()));
}
@Test(description = "绑定第三方坐席",priority = 18)
public void 绑定第三方坐席(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", INVITE_ID);
params.put("accountName", "8060@fhpcs");
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_accountBind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_accountBind,"绑定第三方账号失败",response.body().asString()));
}
@Test(description = "解绑第三方坐席",priority = 19)
public void 解绑第三方坐席(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", INVITE_ID);
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_accountUnbind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_accountUnbind,"解绑坐席账号失败",response.body().asString()));
}
@Test(description = "换绑手机并还原",priority = 20)
public void 换绑手机并还原(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", INVITE_ID);
params.put("newPhoneNum", "14783743847");
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_change);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_change,"换绑手机号失败",response.body().asString()));
params.clear();
params.put("phoneNumber", "14783743847");
params.put("pageIndex", "1");
params.put("pageSize", "20");
response = network.getResponse(params, BasicConfig.MANAGER_oto_sellerList);
int id = response.jsonPath().getInt("data.list[0].id");
Assert.assertEquals(id,INVITE_ID,network.message(params,BasicConfig.MANAGER_oto_sellerList,"销售列表为空",response.body().asString()));
params.clear();
params.put("id", INVITE_ID);
params.put("newPhoneNum", "18248405155");
response = network.postResponse(params,BasicConfig.MANAGER_oto_change);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_change,"换绑手机号失败",response.body().asString()));
}
@Test(description = "不可新增同名供应商",priority = 21)
@Test(description = "不可新增同名供应商",priority = 15)
public void 不可新增同名供应商(){
HashMap<String,Object> params = new HashMap<>();
params.put("supplierName", "勿动-自动化供应商");
......@@ -376,7 +222,7 @@ public class Manager implements Authorization {
Assert.assertFalse(success,network.message(params,BasicConfig.MANAGER_supplier_save,"新增同名供应商成功",response.body().asString()));
}
@Test(description = "修改供应商名称",priority = 22)
@Test(description = "修改供应商名称",priority = 16)
public void 修改供应商名称(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", 21);
......@@ -386,7 +232,7 @@ public class Manager implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_supplier_update,"修改供应商名称失败",response.body().asString()));
}
@Test(description = "查看第三方账号列表",priority = 23)
@Test(description = "查看第三方账号列表",priority = 17)
public void 查看供应商列表(){
Response response = network.getResponse(BasicConfig.MANAGER_supplier_list);
int size = response.jsonPath().getInt("data.list.size()");
......@@ -402,7 +248,7 @@ public class Manager implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_supplier_update,"修改供应商名称失败",response.body().asString()));
}
@Test(description = "告知书查看产品列表",priority = 24)
@Test(description = "告知书查看产品列表",priority = 18)
public void 告知书查看产品列表(){
Response response = network.getResponse( BasicConfig.MANAGER_product_listByAttachUs);
int size1 = response.jsonPath().getInt("data.findAll{it.id == 60}.size()");
......@@ -413,14 +259,14 @@ public class Manager implements Authorization {
Assert.assertEquals(size3,0,network.message(BasicConfig.MANAGER_product_listByAttachUs,"告知书产品列表包含其他渠道自营产品",response.body().asString()));
}
@Test(description = "获取告知书的模板",priority = 25)
@Test(description = "获取告知书的模板",priority = 19)
public void 获取告知书的模板(){
Response response = network.getResponse( BasicConfig.MANAGER_notification_getNotificationTemplate);
pdfUrl = response.jsonPath().getString("data");
Assert.assertNotNull(pdfUrl,network.message(BasicConfig.MANAGER_notification_getNotificationTemplate,"告知书的模板pdfURL为空",response.body().asString()));
}
@Test(description = "新增告知书",priority =26)
@Test(description = "新增告知书",priority =20)
public void 新增告知书(){
HashMap<String,Object> params = new HashMap<>();
Date date = new Date();
......@@ -437,14 +283,14 @@ public class Manager implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_notification_save,"增加告知书失败",response.body().asString()));
}
@Test(description = "查询所有供应商列表",priority = 27)
@Test(description = "查询所有供应商列表",priority = 21)
public void 查询所有供应商列表(){
Response response = network.getResponse(BasicConfig.MANAGER_supplier_listAll);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(BasicConfig.MANAGER_supplier_listAll,"查询供应商列表为空",response.body().asString()));
}
@Test(description = "查询告知书列表",priority = 28)
@Test(description = "查询告知书列表",priority = 22)
public void 查询告知书列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex", 1);
......@@ -459,7 +305,7 @@ public class Manager implements Authorization {
encryptId = response.jsonPath().getString("data.list[0].encryptId");
}
@Test(description = "修改告知书",priority = 29)
@Test(description = "修改告知书",priority = 23)
public void 修改告知书(){
HashMap<String,Object> params = new HashMap<>();
Date date = new Date();
......@@ -477,7 +323,7 @@ public class Manager implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_notification_update,"修改告知书失败",response.body().asString()));
}
@Test(description = "H5查询告知书详情",priority = 30)
@Test(description = "H5查询告知书详情",priority = 24)
public void H5查询告知书详情(){
HashMap<String,Object> params = new HashMap<>();
params.put("encryptId", encryptId);
......@@ -490,7 +336,7 @@ public class Manager implements Authorization {
Assert.assertEquals(sellerName,"自动化告知书销售",network.message(BasicConfig.PHONE_notification_getDetail,"告知书的销售名字错误",response.body().asString()));
}
@Test(description = "客户签名告知书",priority = 31)
@Test(description = "客户签名告知书",priority = 25)
public void 客户签名告知书(){
HashMap<String,Object> params = new HashMap<>();
params.put("encryptId", encryptId);
......@@ -508,7 +354,7 @@ public class Manager implements Authorization {
Assert.assertEquals(signatureState,2,network.message(BasicConfig.MANAGER_notification_list,"告知书的状态错误:非客户已签名",response.body().asString()));
}
@Test(description = "销售签名告知书",priority = 32)
@Test(description = "销售签名告知书",priority = 26)
public void 销售签名告知书(){
HashMap<String,Object> params = new HashMap<>();
params.put("encryptId", encryptId);
......@@ -526,7 +372,7 @@ public class Manager implements Authorization {
Assert.assertEquals(signatureState,3,network.message(BasicConfig.MANAGER_notification_list,"告知书的状态错误:非销售客户都签名",response.body().asString()));
}
@Test(description = "标记告知书失效",priority = 33)
@Test(description = "标记告知书失效",priority = 27)
public void 标记告知书失效(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", IdMakeUtil.decodingId(encryptId));
......@@ -542,7 +388,7 @@ public class Manager implements Authorization {
Assert.assertEquals(signatureState,4,network.message(BasicConfig.MANAGER_notification_list,"告知书的状态错误:非已失效",response.body().asString()));
}
@Test(description = "修改投放账户",priority =34)
@Test(description = "修改投放账户",priority =28)
public void 修改投放账户(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", 20);
......@@ -555,7 +401,7 @@ public class Manager implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_account_saveOrUpdate,"修改投放账户失败",response.body().asString()));
}
@Test(description = "查看投放账户列表",priority =35)
@Test(description = "查看投放账户列表",priority =29)
public void 查看投放账户列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex", 1);
......@@ -581,7 +427,7 @@ public class Manager implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_account_saveOrUpdate,"修改投放账户失败",response.body().asString()));
}
@Test(description = "创建固定直播投放链接",priority =36)
@Test(description = "创建固定直播投放链接",priority =30)
public void 创建固定直播投放链接(){
HashMap<String,Object> params = new HashMap<>();
linkRemark = "勿动_自动化直播公司的测试投放链接"+new Date();
......@@ -594,7 +440,7 @@ public class Manager implements Authorization {
Assert.assertNotNull(linkId,network.message(params,BasicConfig.MANAGER_link_save,"修改投放账户失败",response.body().asString()));
}
@Test(description = "获取直播链接生成进度",priority =37)
@Test(description = "获取直播链接生成进度",priority =31)
public void 获取直播链接生成进度(){
boolean data = false;
Response response = null;
......@@ -608,7 +454,7 @@ public class Manager implements Authorization {
Assert.assertTrue(data,network.message(BasicConfig.MANAGER_link_getStatus,"生成投放链接失败",response.body().asString()));
}
@Test(description = "查看直播投放链接列表",priority =38)
@Test(description = "查看直播投放链接列表",priority =32)
public void 查看直播投放链接列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex", 1);
......@@ -623,7 +469,7 @@ public class Manager implements Authorization {
pathkeyId = response.jsonPath().getLong("data.list[0].id");
}
@Test(description = "查看映射记录",priority =39)
@Test(description = "查看映射记录",priority =33)
public void 查看映射记录(){
HashMap<String,Object> params = new HashMap<>();
params.put("pathKey", pathkeyId);
......@@ -636,7 +482,7 @@ public class Manager implements Authorization {
Assert.assertEquals(liveSpreadLinkId,linkId,network.message(params,BasicConfig.MANAGER_link_listByPathKey,"投放账户列表不包含修改后的投放账户",response.body().asString()));
}
@Test(description = "修改固定直播投放链接",priority =40)
@Test(description = "修改固定直播投放链接",priority =34)
public void 修改固定直播投放链接(){
HashMap<String,Object> params = new HashMap<>();
linkRemark = "勿动_自动化直播公司的测试投放链接"+new Date();
......@@ -650,7 +496,7 @@ public class Manager implements Authorization {
Assert.assertNotNull(linkId,network.message(params,BasicConfig.MANAGER_link_fakeUpdate,"修改投放账户失败",response.body().asString()));
}
@Test(description = "修改固定链接后查看映射记录更新",priority =41)
@Test(description = "修改固定链接后查看映射记录更新",priority =35)
public void 修改固定链接后查看映射记录更新(){
HashMap<String,Object> params = new HashMap<>();
params.put("pathKey", pathkeyId);
......@@ -663,7 +509,7 @@ public class Manager implements Authorization {
Assert.assertEquals(liveSpreadLinkId,linkId,network.message(params,BasicConfig.MANAGER_link_listByPathKey,"投放账户列表不包含修改后的投放账户",response.body().asString()));
}
@Test(description = "名称模糊搜索投放账户",priority =42)
@Test(description = "名称模糊搜索投放账户",priority =37)
public void 名称模糊搜索投放账户(){
HashMap<String,Object> params = new HashMap<>();
params.put("accountName", "勿动");
......@@ -674,7 +520,7 @@ public class Manager implements Authorization {
Assert.assertEquals(launchAccountId,20,network.message(params,BasicConfig.MANAGER_account_fuzzyByAccountName,"模糊查询结果错误",response.body().asString()));
}
@Test(description = "投放链接进入直播后获取直播id",priority =43)
@Test(description = "投放链接进入直播后获取直播id",priority =38)
public void 投放链接进入直播后获取直播id(){
visitorAuth();
HashMap<String,Object> params = new HashMap<>();
......@@ -686,88 +532,83 @@ public class Manager implements Authorization {
Assert.assertEquals(liveId,IdMakeUtil.encodingId(8203L),network.message(params,BasicConfig.live_mapping_getTrueLinkInfo,"模糊查询结果错误",response.body().asString()));
}
@Test(description = "获取客户来源对应关系列表",priority =44)
@Test(description = "获取客户来源对应关系列表",priority =39)
public void 获取客户来源对应关系列表(){
Response response = network.getResponse(BasicConfig.MANAGER_custFromSourceList);
String custFromSource = response.jsonPath().getString("data[0].custFromSource");
String desc = response.jsonPath().getString("data[0].desc");
Assert.assertEquals(custFromSource,"01_01-01",network.message(BasicConfig.MANAGER_custFromSourceList,"修改投放账户失败",response.body().asString()));
Assert.assertEquals(desc,"投放客户-自建落地页-表单",network.message(BasicConfig.MANAGER_custFromSourceList,"修改投放账户失败",response.body().asString()));
Assert.assertEquals(custFromSource,"01_01-01",network.message(BasicConfig.MANAGER_custFromSourceList,"客户来源枚举值错误",response.body().asString()));
Assert.assertEquals(desc,"投放客户-自建落地页-表单",network.message(BasicConfig.MANAGER_custFromSourceList,"对应的来源描述错误",response.body().asString()));
}
@Test(description = "公域引流_查找客户",priority = 41)
public void 公域引流_查找客户(){
HashMap<String,Object> params = new HashMap<String,Object>();
params.put("pageIndex", 1);
params.put("pageSize", 10);
params.put("phoneNum", "15136361301");
Response response = network.getResponse(params,BasicConfig.MANAGER_oto_customerList);
int totalCount = response.jsonPath().getInt("data.totalCount");
Assert.assertTrue(totalCount == 1,network.message(params,BasicConfig.MANAGER_oto_customerList,"未查找到该客户",response.body().asString()));
String custName = response.jsonPath().getString("data.list[0].custName");
int companySize = response.jsonPath().getInt("data.list[0].companyIds.size()");
Assert.assertEquals(custName,"自动化测试用户1",network.message(params,BasicConfig.MANAGER_oto_customerList,"客户姓名与填单时错误",response.body().asString()));
Assert.assertEquals(companySize,3,network.message(params,BasicConfig.MANAGER_oto_customerList,"客户的产品组错误",response.body().asString()));
}
@Test(description = "批量分配客户",priority = 45)
@Test(description = "批量分配客户",priority = 42)
public void 批量分配客户(){
custids = new ArrayList<Integer>();
custids.add(searchCustName("自动化测试用户2"));
custids.add(searchCustName("自动化测试用户3"));
cust_id = searchCustName("自动化测试用户1","manage");
custids.add(cust_id-1);
custids.add(cust_id+1);
batchAssignSeller(1,INVITE_ID,custids); //批量分配给邀约
batchAssignSeller(2,SELLER_ID,custids); //批量分配给带看
batchAssignSeller(3,EXPERT_ID,custids); //批量分配给专家
batchAssignSeller(1,INVITE_ID,custids,"manage"); //批量分配给邀约
batchAssignSeller(2,SELLER_ID,custids,"manage"); //批量分配给带看
batchAssignSeller(3,EXPERT_ID,custids,"manage"); //批量分配给专家
}
@Test(description = "成员名下存在某角色中不可移除成员角色",priority = 46)
public void 成员名下存在某角色中不可移除成员角色(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", INVITE_ID);
params.put("sellerName", "勿动-自动化更新邀约");
params.put("phoneNumber", "18248405155");
params.put("roles",new int[]{2});
params.put("callPermission", 0);
params.put("sellerStatus", 0);
params.put("companyIds", new int[]{5});
params.put("companyNames", new String[]{"勿动-自动化测试公司"});
params.put("sellerLevel", 2);
params.put("workStatus", 1);
params.put("parentId", 28);
Response response = network.postResponse(params, BasicConfig.MANAGER_oto_updateSeller);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.MANAGER_oto_updateSeller,"修改客户失败",response.body().asString()));
@Test(description = "单个分配客户",priority = 43)
public void 单个分配客户(){
assignSeller(Manager.cust_id+2,23,false,1,"manage");
params.put("id", SELLER_ID);
response = network.postResponse(params, BasicConfig.MANAGER_oto_updateSeller);
success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.MANAGER_oto_updateSeller,"修改客户失败",response.body().asString()));
sleep(1000);
assignSeller(Manager.cust_id+2,SELLER_ID,true,2,"manage");
sleep(1000);
assignSeller(Manager.cust_id+2,INVITE_ID,true,1,"manage");
params.put("id", EXPERT_ID);
response = network.postResponse(params, BasicConfig.MANAGER_oto_updateSeller);
success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.MANAGER_oto_updateSeller,"修改客户失败",response.body().asString()));
}
@Test(description = "搜索角色列表",priority = 47)
@Test(description = "搜索角色列表",priority = 44)
public void 搜索角色列表(){
//邀约角色成功搜索到邀约成员
searchRole("勿动-自动化测试邀约",1,1);
searchRole("勿动-自动化测试邀约",1,1,"manage");
//邀约角色不可搜索到销售成员
searchRole("勿动-自动化测试带看",1,0);
searchRole("勿动-自动化测试带看",1,0,"manage");
//邀约角色不可搜索到专家成员
searchRole("勿动-自动化测试专家",1,0);
searchRole("勿动-自动化测试专家",1,0,"manage");
//销售角色不可搜索到邀约成员
searchRole("勿动-自动化测试邀约",2,0);
searchRole("勿动-自动化测试邀约",2,0,"manage");
//销售角色成功搜索到销售成员
searchRole("勿动-自动化测试带看",2,1);
searchRole("勿动-自动化测试带看",2,1,"manage");
//销售角色不可搜索到专家成员
searchRole("勿动-自动化测试专家",2,0);
searchRole("勿动-自动化测试专家",2,0,"manage");
//专家角色不可搜索到邀约成员
searchRole("勿动-自动化测试邀约",3,0);
searchRole("勿动-自动化测试邀约",3,0,"manage");
//专家角色不可搜索到销售成员
searchRole("勿动-自动化测试带看",3,0);
searchRole("勿动-自动化测试带看",3,0,"manage");
//专家角色成功搜索到专家成员
searchRole("勿动-自动化测试专家",3,1);
}
searchRole("勿动-自动化测试专家",3,1,"manage");
@Test(description = "销售存在跟进入客户不可离职",priority = 48)
public void 销售存在跟进入客户不可离职(){
dimissionStatus(INVITE_ID);
dimissionStatus(SELLER_ID);
dimissionStatus(EXPERT_ID);
//搜索不区分组织架构
searchRole("专家",3,5,"manage");
}
@Test(description = "修改客户标签",priority = 49)
@Test(description = "修改客户标签",priority = 45)
public void 修改客户标签(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custids.get(0));
......@@ -778,19 +619,19 @@ public class Manager implements Authorization {
}
@Test(description = "标记成单",priority = 50)
@Test(description = "标记成单",priority = 46)
public void 标记成单(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custids.get(0));
params.put("dealFlag", 1);
Response response = network.postResponse(params, BasicConfig.MANAGER_updateDealFlag);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.MANAGER_updateDealFlag, "批量分配失败", response.body().asString()));
Assert.assertTrue(data, network.message(params, BasicConfig.MANAGER_updateDealFlag, "标记成单失败", response.body().asString()));
HashMap<String,Object> selectParams = new HashMap<String,Object>();
selectParams.put("pageIndex", 1);
selectParams.put("pageSize", 10);
selectParams.put("phoneNum", "15136361302");
selectParams.put("phoneNum", "15136361300");
response = network.getResponse(selectParams,BasicConfig.MANAGER_oto_customerList);
int tagSize = response.jsonPath().getInt("data.list[0].tagNames.size()");
int dealFlag = response.jsonPath().getInt("data.list[0].dealFlag");
......@@ -804,7 +645,7 @@ public class Manager implements Authorization {
Assert.assertEquals(expertName,"勿动-自动化测试专家" ,network.message(selectParams, BasicConfig.MANAGER_oto_customerList, "当前跟进专家错误", response.body().asString()));
}
@Test(description = "批量给客户打标签",priority = 51)
@Test(description = "批量给客户打标签",priority = 47)
public void 批量给客户打标签(){
HashMap<String,Object> params = new HashMap<>();
params.put("custIds", custids);
......@@ -814,7 +655,7 @@ public class Manager implements Authorization {
Assert.assertTrue(data, network.message(params, BasicConfig.MANAGER_tag_batchUpdate, "批量修改客户标签失败", response.body().asString()));
}
@Test(description = "取消成单",priority = 52)
@Test(description = "取消成单",priority = 48)
public void 取消成单(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custids.get(0));
......@@ -826,7 +667,7 @@ public class Manager implements Authorization {
HashMap<String,Object> selectParams = new HashMap<String,Object>();
selectParams.put("pageIndex", 1);
selectParams.put("pageSize", 10);
selectParams.put("phoneNum", "15136361302");
selectParams.put("phoneNum", "15136361300");
response = network.getResponse(selectParams,BasicConfig.MANAGER_oto_customerList);
int tagSize = response.jsonPath().getInt("data.list[0].tagNames.size()");
int dealFlag = response.jsonPath().getInt("data.list[0].dealFlag");
......@@ -834,7 +675,7 @@ public class Manager implements Authorization {
Assert.assertEquals(dealFlag,0 ,network.message(selectParams, BasicConfig.MANAGER_oto_customerList, "取消客户成单失败", response.body().asString()));
}
@Test(description = "跟进人筛选客户",priority = 53)
@Test(description = "跟进人筛选客户",priority = 49)
public void 跟进人筛选客户(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex", 1);
......@@ -842,27 +683,27 @@ public class Manager implements Authorization {
params.put("otoSidList", 42);
Response response = network.getResponse(params, BasicConfig.MANAGER_oto_customerList);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size, 2,network.message(params, BasicConfig.MANAGER_oto_customerList, "邀约人筛选结果错误", response.body().asString()));
Assert.assertEquals(size, 3,network.message(params, BasicConfig.MANAGER_oto_customerList, "邀约人筛选结果错误", response.body().asString()));
params.put("otoSidList", 284);
response = network.getResponse(params, BasicConfig.MANAGER_oto_customerList);
size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size, 2,network.message(params, BasicConfig.MANAGER_oto_customerList, "带看人筛选结果错误", response.body().asString()));
Assert.assertEquals(size, 2,network.message(params, BasicConfig.MANAGER_oto_customerList, "专家筛选结果错误", response.body().asString()));
params.put("otoSidList", 290);
response = network.getResponse(params, BasicConfig.MANAGER_oto_customerList);
size = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(size, 2,network.message(params, BasicConfig.MANAGER_oto_customerList, "专家筛选结果错误", response.body().asString()));
Assert.assertEquals(size, 3,network.message(params, BasicConfig.MANAGER_oto_customerList, "带看人筛选结果错误", response.body().asString()));
}
@Test(description = "标签列表",priority = 54)
@Test(description = "标签列表",priority = 50)
public void 标签列表(){
Response response = network.getResponse(BasicConfig.MANAGER_tagList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(BasicConfig.MANAGER_tagList, "标签列表为空", response.body().asString()));
Assert.assertTrue(size>10,network.message(BasicConfig.MANAGER_tagList, "标签列表为空", response.body().asString()));
}
@Test(description = "角色列表",priority = 55)
@Test(description = "角色列表",priority = 51)
public void 角色列表(){
Response response = network.getResponse(BasicConfig.MANAGER_roleList);
int size = response.jsonPath().getInt("data.size()");
......@@ -870,7 +711,7 @@ public class Manager implements Authorization {
}
@Test(description = "修改客户的产品组",priority = 56)
@Test(description = "修改客户的产品组",priority = 52)
public void 修改客户产品组(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId",custids.get(0));
......@@ -882,27 +723,27 @@ public class Manager implements Authorization {
params.clear();
params.put("pageIndex", 1);
params.put("pageSize", 10);
params.put("phoneNum", "15136361302");
params.put("phoneNum", "15136361300");
response = network.getResponse(params,BasicConfig.MANAGER_oto_customerList);
int companySize = response.jsonPath().getInt("data.list[0].companyIds.size()");
Assert.assertEquals(companySize,2,network.message(params,BasicConfig.MANAGER_oto_customerList,"客户的产品组错误",response.body().asString()));
}
@Test(description = "查询所有产品列表",priority = 57)
@Test(description = "查询所有产品列表",priority = 53)
public void 查询所有产品列表(){
Response response =network.getResponse(BasicConfig.MANAGER_product_listAll);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0 ,network.message(BasicConfig.MANAGER_product_listAll,"查看产品列表为空",response.body().asString()));
}
@Test(description = "查询可导入的客户来源列表",priority = 58)
@Test(description = "查询可导入的客户来源列表",priority = 54)
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)
@Test(description = "导入客户文件并成功",priority = 55)
public void 导入客户文件(){
HashMap<String,Object> params = new HashMap<>();
params.put("companyIds", new int[]{5});
......@@ -933,7 +774,7 @@ public class Manager implements Authorization {
}
@Test(description = "查询导入的文件上传记录",priority = 60)
@Test(description = "查询导入的文件上传记录",priority = 56)
public void 查询导入的文件上传记录(){
HashMap<String,Object> params = new HashMap<>();
params.put("taskType", 34);
......@@ -944,72 +785,106 @@ public class Manager implements Authorization {
Assert.assertTrue(size>0 ,network.message(BasicConfig.MANAGER_listForType,"查看导入文件上传记录为空",response.body().asString()));
}
@Test(description = "查询设备列表",priority = 61)
public void 查询设备列表(){
Response response =network.getResponse(BasicConfig.MANAGER_ykAvailableList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0 ,network.message(BasicConfig.MANAGER_ykAvailableList,"查看设备列表为空",response.body().asString()));
@Test(description = "公域引流_查询问题详情",priority = 57)
public void 公域引流_查询问题详情(){
HashMap<String,Object> params = new HashMap<>();
params.put("customerId", cust_id);
Response response = network.getResponse(params,BasicConfig.MANAGER_oto_qaDetail);;
int answer = response.jsonPath().getInt("data.list[0].optionTitles.size()");
Assert.assertTrue(answer>0,network.message(params,BasicConfig.MANAGER_oto_qaDetail,"问题详情为空",response.body().asString()));
}
@Test(description = "绑定设备",priority = 62)
public void 绑定设备(){
@Test(description = "公域引流_创建标签",priority = 58)
public void 公域引流_创建标签(){
HashMap<String,Object> params = new HashMap<>();
params.put("accountName", "imei4");
params.put("sellerId", SELLER_ID);
Response response =network.postResponse(params,BasicConfig.MANAGER_ykBind);
params.put("tagName", "勿动-自动化测试标签");
params.put("roleTypes", new int[]{6});
params.put("sellerIds", new int[]{3});
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_saveTag);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(BasicConfig.MANAGER_ykBind,"绑定设备失败",response.body().asString()));
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_saveTag,"创建标签失败",response.body().asString()));
//创建名称相同的标签失败
response = network.postResponse(params,BasicConfig.MANAGER_oto_saveTag);
data = response.jsonPath().getBoolean("success");
Assert.assertFalse(data,network.message(params,BasicConfig.MANAGER_oto_saveTag,"创建同名的标签成功",response.body().asString()));
}
@Test(description = "解绑设备",priority = 63)
public void 解绑设备(){
@Test(description = "公域引流_查看标签列表",priority = 59)
public void 公域引流_查看标签列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", SELLER_ID);
Response response =network.postResponse(params,BasicConfig.MANAGER_ykUnbind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(BasicConfig.MANAGER_ykUnbind,"解绑设备失败",response.body().asString()));
params.put("pageIndex", 1);
params.put("pageSize", 20);
Response response = network.getResponse(params,BasicConfig.MANAGER_oto_tagList);
int size = response.jsonPath().getInt("data.list.size()");
String tagName = response.jsonPath().getString("data.list[0].tagName");
int customerCount = response.jsonPath().getInt("data.list[0].customerCount");
int tagStatus = response.jsonPath().getInt("data.list[0].tagStatus");
Assert.assertTrue(size>10 ,network.message(BasicConfig.MANAGER_oto_tagList,"标签列表为空",response.body().asString()));
Assert.assertEquals(tagName ,"勿动-自动化测试标签",network.message(params,BasicConfig.MANAGER_oto_tagList,"标签名称错误",response.body().asString()));
Assert.assertEquals(customerCount ,0,network.message(params,BasicConfig.MANAGER_oto_tagList,"新标签的客户数不为0",response.body().asString()));
Assert.assertEquals(tagStatus ,1,network.message(params,BasicConfig.MANAGER_oto_tagList,"新标签的状态不为打开",response.body().asString()));
tagId = response.jsonPath().getInt("data.list[0].id");
}
@Test(description = "刷新设备绑定情况",priority = 64)
public void 刷新设备绑定情况(){
Response response =network.postResponse(BasicConfig.MANAGER_ykSyncBind);
@Test(description = "公域引流_修改标签",priority = 60)
public void 公域引流_修改标签(){
HashMap<String,Object> params = new HashMap<>();
params.put("tagName", "勿动-自动化更新标签");
params.put("id", tagId);
params.put("roleTypes", new int[]{5,2});
params.put("sellerIds", new int[]{43});
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_updateTag);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data ,network.message(BasicConfig.MANAGER_ykSyncBind,"刷新设备失败",response.body().asString()));
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_updateTag,"修改标签失败",response.body().asString()));
}
public int searchCustName(String custName){
public static int searchCustName(String custName,String entrance){
HashMap<String,Object> params = new HashMap<>();
params.put("custName", custName);
Response response = network.getResponse(params, BasicConfig.MANAGER_custName);
String path;
if(entrance.equals("manage")){//如果是管理后台进入则路径为管理后台的接口,否则为CRM的接口
path = MANAGER_custName;
}else{
path =WORK_MNG_custName;
}
Response response = network.getResponse(params, path);
return response.jsonPath().getInt("data[0].custId");
}
public void batchAssignSeller(int assignType,int sellerId,ArrayList custids) {
public static void batchAssignSeller(int assignType,int sellerId,ArrayList custids,String entrance) {
HashMap<String,Object> params = new HashMap<>();
params.put("custIds", custids);
params.put("assignType", assignType);
params.put("sellerId", sellerId);
Response response = network.postResponse(params, BasicConfig.MANAGER_batchAssignSeller);
String path;
if(entrance.equals("manage")){//如果是管理后台进入则路径为管理后台的接口,否则为CRM的接口
path = MANAGER_batchAssignSeller;
}else{
path =WORK_MNG_batchAssignSeller;
}
Response response = network.postResponse(params, path);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.MANAGER_batchAssignSeller, "批量分配失败", response.body().asString()));
Assert.assertTrue(data, network.message(params, path, "批量分配失败", response.body().asString()));
}
public void searchRole(String sellerName,int roleType,int result) {
public static void searchRole(String sellerName,int roleType,int result,String entrance) {
HashMap<String,Object> params = new HashMap<>();
params.put("name", sellerName);
params.put("roleType", roleType);
Response response = network.getResponse(params, BasicConfig.MANAGER_roleSellerList);
int size = response.jsonPath().getInt("data.size");
Assert.assertEquals(size,result, network.message(params, BasicConfig.MANAGER_roleSellerList, "结果数量不为"+result, response.body().asString()));
}
public void dimissionStatus(int sellreid){
HashMap<String,Object> params = new HashMap<>();
params.put("id", sellreid);
params.put("dimissionStatus", 1);
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_switchDimissionStatus);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.MANAGER_oto_switchDimissionStatus,"名下存在销售但离职成功",response.body().asString()));
String path;
if(entrance.equals("manage")){//如果是管理后台进入则路径为管理后台的接口
path = MANAGER_roleSellerList;
}else if(entrance.equals("crm")){//如果CRM进入则路径为CRM客户管理的接口
path =WORK_MNG_roleSellerList;
}else{//否则是盘点详情重新分配的接口
path =WORK_roleSellerList;
}
Response response = network.getResponse(params, path);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,result, network.message(params, path, "结果数量不为"+result, response.body().asString()));
}
public static void PubForm(String phone,String username){
......
......@@ -14,16 +14,17 @@ import org.testng.annotations.Test;
import java.sql.SQLException;
import java.util.*;
import static com.oto.cases.otoseller.CheckTask.*;
import static com.oto.cases.otoseller.Invite.*;
import static com.oto.cases.otoseller.Manager.cust_id;
import static com.oto.cases.otoseller.Work.*;
import static com.oto.config.BasicConfig.EXPERT_ID;
import static com.oto.config.BasicConfig.INVITE_ID;
import static com.oto.utils.BaseUtils.*;
import static com.oto.utils.ThreadSleepUtils.sleep;
//手机端
public class Phone implements Authorization {
private static final NetworkUtils network = NetworkUtils.getInstance();
private String cust_id;//加密的客户ID
private String customer_id;//加密的客户ID
private String custName;
private String introduceCustomer_id;
private String myselfCustomer_id;
......@@ -53,7 +54,7 @@ public class Phone implements Authorization {
public void 创建缘故客户(){
HashMap<String,Object> params = new HashMap<>();
params.put("custName", "自动化缘故客户");
params.put("custPhoneNum", "15136361304");
params.put("custPhoneNum", "15136361308");
params.put("custActionType", "04");
Response response = network.postResponse(params, BasicConfig.PHONE_customerSave);
myselfCustomer_id = response.jsonPath().getString("data");
......@@ -64,7 +65,7 @@ public class Phone implements Authorization {
public void 创建社区客户(){
HashMap<String,Object> params = new HashMap<>();
params.put("custName", "自动化社区客户");
params.put("custPhoneNum", "15136361305");
params.put("custPhoneNum", "15136361309");
params.put("custActionType", "09");
Response response = network.postResponse(params, BasicConfig.PHONE_customerSave);
introduceCustomer_id = response.jsonPath().getString("data");
......@@ -80,7 +81,7 @@ public class Phone implements Authorization {
int size = response.jsonPath().getInt("data.myCustomerVos.size()");
Assert.assertEquals(size,1,network.message(params,BasicConfig.PHONE_customerList,"查找不到该客户",response.body().asString()));
cust_id = response.jsonPath().getString("data.myCustomerVos[0].id");
customer_id = response.jsonPath().getString("data.myCustomerVos[0].id");
custName = response.jsonPath().getString("data.myCustomerVos[0].custName");
}
......@@ -95,7 +96,7 @@ public class Phone implements Authorization {
@Test(description = "关闭见面场景后不可查看场景",priority = 6)
public void 关闭见面场景后不可查看场景(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", cust_id);
params.put("custId", customer_id);
Response response = network.getResponse(params, BasicConfig.PHONE_listCustInterConf);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,1,network.message(params,BasicConfig.PHONE_listCustInterConf,"见面场景列表数量错误",response.body().asString()));
......@@ -106,14 +107,14 @@ public class Phone implements Authorization {
public void 打开场景后查看客户对应的见面场景(){
otoManagerAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("id",Work.sceneId);
params.put("id",sceneId);
params.put("confUsable",1);
Response response =network.postResponse(params,BasicConfig.WORK_updateStatus);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_updateStatus,"关闭见面场景失败",response.body().asString()));
params.clear();
params.put("custId", cust_id);
params.put("custId", customer_id);
response = network.getResponse(params, BasicConfig.PHONE_listCustInterConf);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,2,network.message(params,BasicConfig.PHONE_listCustInterConf,"见面场景列表数量错误",response.body().asString()));
......@@ -121,7 +122,7 @@ public class Phone implements Authorization {
@Test(description = "创建社区参观的面访",priority = 8)
public void 创建社区参观的面访(){
interviewIds.add(saveInterview(cust_id,1));
interviewIds.add(saveInterview(customer_id,1));
interviewIds.add(saveInterview(myselfCustomer_id,1));
interviewIds.add(saveInterview(introduceCustomer_id,1));
}
......@@ -194,7 +195,7 @@ public class Phone implements Authorization {
public void 授权失败() throws SQLException {
agentTku();
Map<String, Object> result = KjyLiveNormalDB.getInstance().findSimpleResult(UserSqlFactory.selectCodeIdByCustomerId, IdMakeUtil.decodingId(cust_id));
Map<String, Object> result = KjyLiveNormalDB.getInstance().findSimpleResult(UserSqlFactory.selectCodeIdByCustomerId, cust_id);
scanCodeId = result.get("scan_code_id");
HashMap<String,Object> params = new HashMap<>();
......@@ -304,7 +305,7 @@ public class Phone implements Authorization {
//带看销售查看上传记录
otoTakerAuth();
params.clear();
params.put("custId",IdMakeUtil.decodingId(cust_id));
params.put("custId",cust_id);
response =network.getResponse(params,BasicConfig.WORK_invire);
boolean data = response.jsonPath().getBoolean("data");Assert.assertTrue(data ,network.message(params,BasicConfig.WORK_invire,"上传面访记录>=1",response.body().asString()));
......@@ -314,7 +315,7 @@ public class Phone implements Authorization {
//查看约面日历
otoManagerAuth();
Work.getCalendarlist(Work.today,5,"自动化激活用户","勿动-自动化测试邀约");
getCalendarlist(today,5,"自动化激活用户","勿动-自动化测试邀约");
//查看客户的跟进人
HashMap<String,Object> selectParams = new HashMap<String,Object>();
......@@ -357,7 +358,7 @@ public class Phone implements Authorization {
otoTakerAuth();
params.clear();
params.put("custId", IdMakeUtil.decodingId(cust_id));
params.put("custId", cust_id);
response = network.getResponse(params,BasicConfig.WORK_detail_v2);
int commitPlanFlag = response.jsonPath().getInt("data.otoCustInfo4Manage.commitPlanFlag");
Assert.assertEquals(commitPlanFlag,1,network.message(params,BasicConfig.WORK_detail_v2,"是否提交计划书为否",response.body().asString()));
......@@ -384,10 +385,10 @@ public class Phone implements Authorization {
@Test(description = "客户再次创建面访并扫码评价",priority = 28)
public void 客户再次创建面访并扫码评价() throws SQLException {
otoTakerTku();
interviewIds.add(saveInterview(cust_id,1));
interviewIds.add(saveInterview(customer_id,1));
agentTku();
Map<String, Object> result = KjyLiveNormalDB.getInstance().findSimpleResult(UserSqlFactory.selectCodeIdByCustomerId, IdMakeUtil.decodingId(cust_id));
Map<String, Object> result = KjyLiveNormalDB.getInstance().findSimpleResult(UserSqlFactory.selectCodeIdByCustomerId, cust_id);
scanCodeId = result.get("scan_code_id");
System.out.println(scanCodeId);
scanCode(IdMakeUtil.encodingId((Long) scanCodeId),1047);
......@@ -459,7 +460,7 @@ public class Phone implements Authorization {
otoTakerAuth();
params.clear();
params.put("custId", IdMakeUtil.decodingId(cust_id));
params.put("custId", cust_id);
response = network.getResponse(params,BasicConfig.WORK_detail_v2);
int commitPlanFlag = response.jsonPath().getInt("data.otoCustInfo4Manage.commitPlanFlag");
Assert.assertEquals(commitPlanFlag,1,network.message(params,BasicConfig.WORK_detail_v2,"是否提交计划书非【是】",response.body().asString()));
......@@ -470,7 +471,7 @@ public class Phone implements Authorization {
otoTakerTku();
Response response = network.getResponse( BasicConfig.PHONE_expertList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,2,network.message(BasicConfig.PHONE_expertList,"专家回显不为空",response.body().asString()));
Assert.assertEquals(size,3,network.message(BasicConfig.PHONE_expertList,"专家回显不为空",response.body().asString()));
}
@Test(description = "查看我的面访状态更新为已完成",priority =33)
......@@ -487,13 +488,13 @@ public class Phone implements Authorization {
@Test(description = "创建送计划书面访",priority = 34)
public void 创建送计划书面访(){
otoTakerTku();
interviewIds.add(saveInterview(cust_id,2));
interviewIds.add(saveInterview(customer_id,2));
}
@Test(description = "客户完成送计划书面访并扫码",priority = 35)
public void 客户完成送计划书面访并扫码() throws SQLException {
agentTku();
Map<String, Object> result = KjyLiveNormalDB.getInstance().findSimpleResult(UserSqlFactory.selectCodeIdByCustomerId, IdMakeUtil.decodingId(cust_id));
Map<String, Object> result = KjyLiveNormalDB.getInstance().findSimpleResult(UserSqlFactory.selectCodeIdByCustomerId, cust_id);
scanCodeId = result.get("scan_code_id");
System.out.println(scanCodeId);
scanCode(IdMakeUtil.encodingId((Long) scanCodeId),1047);
......@@ -513,7 +514,6 @@ public class Phone implements Authorization {
Assert.assertEquals(expertName,"勿动-自动化测试专家",network.message(params,BasicConfig.PHONE_custExtDetail,"是否已送计划书不为否",response.body().asString()));
}
@Test(description = "二次正常扫码面访异常类型为空",priority = 37)
public void 二次正常扫码面访异常类型为空(){
otoTakerTku();
......@@ -527,7 +527,7 @@ public class Phone implements Authorization {
@Test(description = "查看公司产品列表",priority = 38)
public void 查看公司产品列表() {
HashMap<String,Object> params = new HashMap<>();
params.put("custId", cust_id);
params.put("custId", customer_id);
Response response = network.getResponse(params,BasicConfig.PHONE_listBysellComp);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,2,network.message(BasicConfig.PHONE_listBysellComp,"产品列表未包含已上架产品",response.body().asString()));
......@@ -548,7 +548,7 @@ public class Phone implements Authorization {
otoTakerTku();
HashMap<String,Object> params = new HashMap<>();
params.put("custId", cust_id);
params.put("custId", customer_id);
Response response = network.getResponse(params,BasicConfig.PHONE_listBysellComp);
int size = response.jsonPath().getJsonObject("data.size()");
Assert.assertEquals(size,1,network.message(BasicConfig.PHONE_listBysellComp,"产品列表未包含已上架产品",response.body().asString()));
......@@ -578,65 +578,17 @@ public class Phone implements Authorization {
Assert.assertTrue(success,network.message(params,BasicConfig.PHONE_interviewFeedback,"上传面访失败",response.body().asString()));
}
@Test(description = "查看我的预约订单列表",priority = 46)
public void 查看我的预约订单列表(){
agent2Tku();
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex",1);
params.put("pageSize",20);
Response response =network.getResponse(params,BasicConfig.PHONE_getReservationList);
int bookingStatus = response.jsonPath().getInt("data[0].bookingStatus");
Assert.assertEquals(bookingStatus,1,network.message(BasicConfig.PHONE_getReservationList,"订单状态未更新为已参观",response.body().asString()));
}
@Test(description = "删除见面场景",priority = 47)
public void 删除见面场景(){
otoManagerAuth();
HashMap<String,Object> params = new HashMap<>();
params.put("id",Work.sceneId);
params.put("id",sceneId);
Response response =network.postResponse(params,BasicConfig.WORK_delete);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_delCust,"删除见面场景失败",response.body().asString()));
}
@Test(description = "查看我的日报为未提交",priority = 48)
public void 查看我的日报为未提交(){
otoTakerTku();
Response response =network.getResponse(BasicConfig.PHONE_paper_getReportFlag);
int reportFlag = response.jsonPath().getInt("data.reportFlag");
Assert.assertEquals(reportFlag,0,network.message(BasicConfig.PHONE_paper_getReportFlag,"日报提交状态非未提交",response.body().asString()));
}
@Test(description = "查看日报客户列表",priority = 49)
public void 查看日报客户列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageSize",20);
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()));
}
@Test(description = "提交日报",priority = 50)
public void 提交日报() {
HashMap<String, Object> params = new HashMap<>();
ArrayList custIds =new ArrayList();
custIds.add(IdMakeUtil.decodingId(cust_id));
custIds.add(IdMakeUtil.decodingId(introduceCustomer_id));
custIds.add(IdMakeUtil.decodingId(myselfCustomer_id));
params.put("custIds", custIds);
Response response = network.postResponse(params, BasicConfig.PHONE_paper_updateCustomer);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.PHONE_paper_updateCustomer,"提交日报失败",response.body().asString()));
}
@Test(description = "提交后查看日报状态",priority = 51)
public void 提交后查看日报状态() {
Response response =network.getResponse(BasicConfig.PHONE_paper_getReportFlag);
int reportFlag = response.jsonPath().getInt("data.reportFlag");
Assert.assertEquals(reportFlag,1,network.message(BasicConfig.PHONE_paper_getReportFlag,"日报提交状态非1:未提交",response.body().asString()));
}
@Test(description = "查看面访详情",priority = 53)
public void 查看面访详情(){
interviewdetail(interviewIds.get(0),3,2,"手机号不一致且非面对面扫码的情况说明",1,1,"勿动-自动化测试总监");
......@@ -658,7 +610,7 @@ public class Phone implements Authorization {
@Test(description = "邀约查看历史备注包含各种备注",priority = 56)
public void 邀约查看历史备注包含各种备注(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", IdMakeUtil.decodingId(cust_id));
params.put("custId", cust_id);
Response response = network.getResponse(params, BasicConfig.WORK_historyRecord);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,6,network.message(params,BasicConfig.WORK_historyRecord,"邀约面访列表不为空",response.body().asString()));
......@@ -696,23 +648,62 @@ public class Phone implements Authorization {
getSellerPlan(2,2,0,1,1,0);
}
@Test(description = "邀约销售查看见面次数",priority = 59)
public void 邀约销售查看见面次数(){
otoInviterTku();//邀约统计客户已上传的总面访次数
HashMap<String,Object> params1 = new HashMap<>();
params1.put("custId", cust_id);
params1.put("type", 1);
Response response = network.getResponse(params1,BasicConfig.WORK_detail_v2);
int meetTimeSize = response.jsonPath().getInt("data.otoCustInfo4Manage.meetTimeSize");
Assert.assertEquals(meetTimeSize,3,network.message(params1,BasicConfig.WORK_detail_v2,"客户的见面次数非3",response.body().asString()));
HashMap<String,Object> params2 = new HashMap<>();
params2.put("custName", "自动化激活用户");
params2.put("pageIndex", 1);
params2.put("pageSize", 50);
response = network.getResponse(params2,BasicConfig.WORK_inviterCustList);
int finishInterviewNum = response.jsonPath().getInt("data.list[0].finishInterviewNum");
Assert.assertEquals(finishInterviewNum,3,network.message(params2,BasicConfig.WORK_inviterCustList,"客户的见面次数非3",response.body().asString()));
otoTakerAuth();//销售统计当前与客户之间创建的已上传面访次数
response = network.getResponse(params1,BasicConfig.WORK_detail_v2);
meetTimeSize = response.jsonPath().getInt("data.otoCustInfo4Manage.meetTimeSize");
Assert.assertEquals(meetTimeSize,3,network.message(params1,BasicConfig.WORK_detail_v2,"客户的见面次数非3",response.body().asString()));
response = network.postResponse(params2,BasicConfig.WORK_SellerCustList);
finishInterviewNum = response.jsonPath().getInt("data.list[0].meetTimes");
Assert.assertEquals(finishInterviewNum,3,network.message(params2,BasicConfig.WORK_SellerCustList,"客户的见面次数非3",response.body().asString()));
otoExpertAuth();//专家统计当前与客户之间创建或关联的已上传面访次数
response = network.getResponse(params1,BasicConfig.WORK_detail_v2);
meetTimeSize = response.jsonPath().getInt("data.otoCustInfo4Manage.meetTimeSize");
Assert.assertEquals(meetTimeSize,1,network.message(params1,BasicConfig.WORK_detail_v2,"客户的见面次数非3",response.body().asString()));
response = network.postResponse(params2,BasicConfig.WORK_SellerCustList);
finishInterviewNum = response.jsonPath().getInt("data.list[0].meetTimes");
Assert.assertEquals(finishInterviewNum,1,network.message(params2,BasicConfig.WORK_SellerCustList,"客户的见面次数非3",response.body().asString()));
}
@Test(description = "查看跟进人标签",priority = 59)
@Test(description = "查看跟进人标签",priority = 60)
public void 查看跟进人标签(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", IdMakeUtil.decodingId(cust_id));
params.put("custId", cust_id);
params.put("type", 1);
Response response = network.getResponse(params,BasicConfig.WORK_header);
int sceneConfDesc= response.jsonPath().getInt("data.sceneConfDesc.size()");
Assert.assertEquals(sceneConfDesc,1,network.message(params,BasicConfig.WORK_header,"客户的场景标签数量错误",response.body().asString()));
}
@Test(description = "重新分配销售不显示该客户计划",priority = 60)
public void 重新分配销售不显示该客户计划(){
Long id = IdMakeUtil.decodingId(cust_id);
assignSeller(Math.toIntExact(id),457,true,2);
@Test(description = "盘点详情重新分配",priority = 65)
public void 盘点详情重新分配(){
otoLeaderAuth();
assignSeller(cust_id,457,true,2,"check");
}
@Test(description = "重新分配销售不显示该客户计划",priority = 66)
public void 重新分配销售不显示该客户计划(){
HashMap<String,Object> params = new HashMap<>();
params.put("beginTime", beginTime);
Response response = network.postResponse(params,BasicConfig.WORK_getDirectorPlanCalendarList);
......@@ -735,24 +726,64 @@ public class Phone implements Authorization {
Assert.assertEquals(size,0,network.message(params,BasicConfig.WORK_getDirectorPlanCalendarList,"销售的当前计划包含不在库客户",response.body().asString()));
}
@Test(description = "盘点详情重新分配",priority = 61)
public void 盘点详情重新分配(){
otoLeaderAuth();
@Test(description = "查看我的日报为未提交",priority = 75)
public void 查看我的日报为未提交(){
otoTakerTku();
Response response =network.getResponse(BasicConfig.PHONE_paper_getReportFlag);
int reportFlag = response.jsonPath().getInt("data.reportFlag");
Assert.assertEquals(reportFlag,0,network.message(BasicConfig.PHONE_paper_getReportFlag,"日报提交状态非未提交",response.body().asString()));
}
@Test(description = "查看日报客户列表",priority = 76)
public void 查看日报客户列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("assignType", 2);
params.put("customerId", IdMakeUtil.decodingId(cust_id));
params.put("sellerId", 290);
Response response = network.postResponse(params,BasicConfig.WORK_assignSeller);
params.put("pageSize",20);
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()));
}
@Test(description = "提交日报",priority = 77)
public void 提交日报() {
HashMap<String, Object> params = new HashMap<>();
ArrayList custIds =new ArrayList();
custIds.add(IdMakeUtil.decodingId(customer_id));
custIds.add(IdMakeUtil.decodingId(introduceCustomer_id));
custIds.add(IdMakeUtil.decodingId(myselfCustomer_id));
params.put("custIds", custIds);
Response response = network.postResponse(params, BasicConfig.PHONE_paper_updateCustomer);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_assignSeller,"查看销售在在库客户为空",response.body().asString()));
Assert.assertTrue(data,network.message(params,BasicConfig.PHONE_paper_updateCustomer,"提交日报失败",response.body().asString()));
}
@Test(description = "提交后查看日报状态",priority = 78)
public void 提交后查看日报状态() {
Response response =network.getResponse(BasicConfig.PHONE_paper_getReportFlag);
int reportFlag = response.jsonPath().getInt("data.reportFlag");
Assert.assertEquals(reportFlag,1,network.message(BasicConfig.PHONE_paper_getReportFlag,"日报提交状态非1:未提交",response.body().asString()));
}
@Test(description = "删除客户",priority = 79)
@Test(description = "查看我的预约订单列表",priority = 79)
public void 查看我的预约订单列表(){
agent2Tku();
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex",1);
params.put("pageSize",20);
Response response =network.getResponse(params,BasicConfig.PHONE_getReservationList);
int bookingStatus = response.jsonPath().getInt("data[0].bookingStatus");
Assert.assertEquals(bookingStatus,1,network.message(BasicConfig.PHONE_getReservationList,"订单状态未更新为已参观",response.body().asString()));
}
@Test(description = "删除客户",priority = 90)
public void 删除客户(){
long id= IdMakeUtil.decodingId(cust_id);
for(int i = (int)id;i<id+7;i++){
int id= cust_id;
for(int i = id-1;i<id+10;i++){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", i);
Response response = network.postResponse(params,BasicConfig.WORK_delCust);
......@@ -760,17 +791,17 @@ public class Phone implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_delCust,"删除客户失败",response.body().asString()));
}
// for(int i = 8512;i<8552;i++){
// for(int i = 8885;i<8895;i++){
// HashMap<String,Object> params = new HashMap<>();
// params.put("custId", 7665);
// params.put("custId", i);
// Response response = network.postResponse(params,BasicConfig.WORK_delCust);
//
// }
}
@Test(description = "删除客户填写的表单记录",priority = 80)
@Test(description = "删除客户填写的表单记录",priority = 91)
public void 删除客户填写的表单记录(){
for(int i =1;i<4;i++){
for(int i =0;i<6;i++){
HashMap<String,Object> params = new HashMap<>();
params.put("phoneNum", "1513636130"+i);
Response response = network.postResponse(params,BasicConfig.WORK_delPubFormRecord);
......@@ -784,7 +815,7 @@ public class Phone implements Authorization {
// }
}
@Test(description = "退出登录",priority = 81)
@Test(description = "退出登录",priority = 92)
public void 退出登录(){
Response response = network.postResponse(BasicConfig.WORK_logout);
boolean data = response.jsonPath().getBoolean("data");
......@@ -795,7 +826,7 @@ 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("interviewConfId", IdMakeUtil.encodingId(sceneId));
params.put("custPhase", custPhase);
params.put("custPhase", custPhase);
params.put("appointmentTime", System.currentTimeMillis()+3600000);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,8 +3,6 @@ package com.oto.config;
public class BasicConfig {
// 是否开启钉钉机器人推送
public static final boolean isPushReport =true; //true
// 代理人微信昵称
public static final String WECHAT_NAME = "吉吉";
public static final String TKU_COOKIE_NAME = "tku";
......@@ -72,32 +70,21 @@ public class BasicConfig {
public static final String MANAGER_oto_deleteTag = MANAGER_HOST +"/kjy/manager/oto/tag/delete";
public static final String MANAGER_oto_tagList = MANAGER_HOST + "/kjy/manager/oto/tag/list";
public static final String MANAGER_oto_switchStatus = MANAGER_HOST + "/kjy/manager/oto/tag/switchStatus";
public static final String MANAGER_oto_sellerList = MANAGER_HOST + "/kjy/manager/oto/seller/list";
public static final String MANAGER_oto_saveSeller = MANAGER_HOST + "/kjy/manager/oto/seller/save";
public static final String MANAGER_oto_updateSeller = MANAGER_HOST + "/kjy/manager/oto/seller/update";
public static final String MANAGER_oto_directorList = MANAGER_HOST + "/kjy/manager/oto/seller/directorList";
public static final String MANAGER_oto_updateCompany = MANAGER_HOST + "/kjy/manager/oto/company/update";
public static final String MANAGER_oto_saveCompany = MANAGER_HOST + "/kjy/manager/oto/company/save";
public static final String MANAGER_oto_listCompany = MANAGER_HOST + "/kjy/manager/oto/company/list";
public static final String MANAGER_oto_listAllCompany = MANAGER_HOST + "/kjy/manager/oto/company/listAll";
public static final String MANAGER_oto_switchWorkStatus = MANAGER_HOST + "/kjy/manager/oto/seller/switchWorkStatus";
public static final String MANAGER_oto_customerList = MANAGER_HOST +"/kjy/manager/pub/form/customer/list/v2";
public static final String MANAGER_oto_assignSeller = MANAGER_HOST +"/kjy/manager/pub/form/customer/assignSeller";
public static final String MANAGER_oto_switchSellerStatus = MANAGER_HOST +"/kjy/manager/oto/seller/switchSellerStatus";
public static final String MANAGER_oto_switchCallPermissio = MANAGER_HOST +"/kjy/manager/oto/seller/switchCallPermission";
public static final String MANAGER_oto_searchSeller = MANAGER_HOST +"/kjy/manager/pub/form/customer/searchSeller";
public static final String MANAGER_oto_customerPhone = MANAGER_HOST +"/kjy/manager/pub/form/customer/customerPhone";
public static final String MANAGER_oto_qaDetail = MANAGER_HOST +"/kjy/manager/pub/form/customer/qaDetail";
public static final String MANAGER_oto_channelList = MANAGER_HOST +"/kjy/manager/pub/form/channelList";
public static final String MANAGER_oto_updatePermission = MANAGER_HOST +"/kjy/manager/oto/seller/updatePermission";
public static final String MANAGER_oto_switchDimissionStatus = MANAGER_HOST +"/kjy/manager/oto/seller/switchDimissionStatus";
public static final String MANAGER_oto_productList = MANAGER_HOST +"/kjy/manager/oto/product/list";
public static final String MANAGER_oto_productSave = MANAGER_HOST +"/kjy/manager/oto/product/save";
public static final String MANAGER_oto_productUpdateStatus = MANAGER_HOST +"/kjy/manager/oto/product/updateStatus";
public static final String MANAGER_oto_accountList = MANAGER_HOST + "/kjy/manager/oto/seller/account/availableList";
public static final String MANAGER_oto_accountBind = MANAGER_HOST + "/kjy/manager/oto/seller/account/bind";
public static final String MANAGER_oto_accountUnbind = MANAGER_HOST + "/kjy/manager/oto/seller/account/unbind";
public static final String MANAGER_oto_change = MANAGER_HOST + "/kjy/manager/oto/seller/phone/change";
public static final String MANAGER_supplier_save = MANAGER_HOST + "/kjy/manager/oto/supplier/save";
public static final String MANAGER_supplier_update = MANAGER_HOST + "/kjy/manager/oto/supplier/update";
public static final String MANAGER_supplier_list = MANAGER_HOST + "/kjy/manager/oto/supplier/list";
......@@ -135,9 +122,6 @@ public class BasicConfig {
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";
public static final String MANAGER_ykAvailableList = MANAGER_HOST + "/kjy/manager/oto/seller/account/yk/availableList";
public static final String MANAGER_ykBind = MANAGER_HOST + "/kjy/manager/oto/seller/account/yk/bind";
public static final String MANAGER_ykUnbind = MANAGER_HOST + "/kjy/manager/oto/seller/account/yk/unbind";
public static final String MANAGER_ykSyncBind = MANAGER_HOST + "/kjy/manager/oto/seller/account/yk/syncBind";
//*************** OTO销售工作台 ***************
public static final String WORK_getCaptcha = WORK_HOST + "/kjy/oto/manager/auth/captcha";
......@@ -177,9 +161,6 @@ public class BasicConfig {
public static final String WORK_saveOrModifySchedule= WORK_HOST + "/kjy/oto/manager/sellerNotify/saveOrModifySchedule";
public static final String WORK_cancelSchedule= WORK_HOST + "/kjy/oto/manager/sellerNotify/cancelSchedule";
public static final String WORK_abandonCust= WORK_HOST + "/kjy/oto/manager/customer/abandonCust";
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/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/task/statistic/header";
......@@ -245,13 +226,76 @@ public class BasicConfig {
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 WORK_assignSeller= WORK_HOST + "/kjy/oto/manager/customer/assignSeller";
public static final String WORK_liveDynamic= WORK_HOST + "/kjy/oto/manager/customer/liveDynamic";
public static final String WORK_minimumDept= WORK_HOST + "/kjy/oto/manager/customer/minimum/dept/list";
//*************************我的审批****************************
public static final String WORK_findMySellerByFuzzyName= WORK_HOST + "/kjy/oto/manager/audit/findMySellerByFuzzyName";
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_liveSearch= WORK_HOST + "/kjy/oto/manager/customer/liveSearch";
public static final String WORK_roleSellerList= WORK_HOST + "/kjy/oto/manager/customer/roleSellerList";
public static final String WORK_check_sellerList= WORK_HOST + "/kjy/oto/manager/customer/check/sellerList";
//*************************会话管理***************************
public static final String WORK_wxList= WORK_HOST + "/kjy/oto/manager/wx/conversation/list";
public static final String WORK_conversationGetSellers= WORK_HOST + "/kjy/oto/manager/wx/conversation/getSellers";
public static final String WORK_ykList= WORK_HOST + "/kjy/oto/manager/wx/conversation/yunke/list";
//*************************组织架构****************************
public static final String WORK_deptList= WORK_HOST + "/kjy/oto/manager/dept/list";
public static final String WORK_listSellerByDeptId= WORK_HOST + "/kjy/oto/manager/dept/listSellerByDeptId";
public static final String WORK_deptSave= WORK_HOST +"/kjy/oto/manager/dept/save";
public static final String WORK_deptUpdate= WORK_HOST + "/kjy/oto/manager/dept/update";
public static final String WORK_deptDel= WORK_HOST + "/kjy/oto/manager/dept/delete";
public static final String WORK_batchAddSeller= WORK_HOST + "/kjy/oto/manager/dept/batchAddSeller";
//**************************客户管理***************************
public static final String WORK_MNG_custSourceList = WORK_HOST + "/kjy/oto/mng/common/custFromSourceList";
public static final String WORK_MNG_customerList = WORK_HOST + "/kjy/oto/mng/pub/form/customer/list/v2";
public static final String WORK_MNG_getCustSourceEnum = WORK_HOST + "/kjy/oto/mng/import/getCustSourceEnum";
public static final String WORK_MNG_listForType = WORK_HOST + "/kjy/oto/mng/import/listForType";
public static final String WORK_MNG_importOtoCustomer = WORK_HOST + "/kjy/oto/mng/form/importOtoCustomer";
public static final String WORK_MNG_importResult = WORK_HOST + "/kjy/oto/mng/import/result";
public static final String WORK_MNG_roleSellerList = WORK_HOST + "/kjy/oto/mng/pub/form/customer/roleSellerList";
public static final String WORK_MNG_batchAssignSeller = WORK_HOST + "/kjy/oto/mng/pub/form/customer/batchAssignSeller";
public static final String WORK_MNG_tagList = WORK_HOST + "/kjy/oto/mng/pub/form/customer/tag/list";
public static final String WORK_MNG_batchUpdateTag = WORK_HOST + "/kjy/oto/mng/pub/form/customer/tag/batchUpdate";
public static final String WORK_MNG_assignSeller = WORK_HOST + "/kjy/oto/mng/pub/form/customer/assignSeller";
public static final String WORK_MNG_updateCompany = WORK_HOST + "/kjy/oto/mng/pub/form/customer/update";
public static final String WORK_MNG_updateTag = WORK_HOST + "/kjy/oto/manager/customer/tag";
public static final String WORK_MNG_updateDealFlag = WORK_HOST + "/kjy/oto/mng/pub/form/customer/updateDealFlag";
public static final String WORK_MNG_searchSeller = WORK_HOST + "/kjy/oto/mng/pub/form/customer/searchSeller";
public static final String WORK_MNG_custName = WORK_HOST + "/kjy/oto/mng/pub/form/customer/fuzzy/custName";
public static final String WORK_MNG_qaDetail = WORK_HOST + "/kjy/oto/mng/pub/form/customer/qaDetail";
//*************************成员管理****************************
public static final String WORK_MNG_sellerList = WORK_HOST + "/kjy/oto/mng/seller/list";
public static final String WORK_MNG_sellerSave = WORK_HOST + "/kjy/oto/mng/seller/save";
public static final String WORK_MNG_sellerUpdate = WORK_HOST + "/kjy/oto/mng/seller/update";
public static final String WORK_MNG_sellerDetail = WORK_HOST + "/kjy/oto/mng/seller/detail";
public static final String WORK_MNG_companyAll = WORK_HOST + "/kjy/oto/mng/company/listAll";
public static final String WORK_MNG_workStatus = WORK_HOST + "/kjy/oto/mng/seller/switchWorkStatus";
public static final String WORK_MNG_changeSellerPhone = WORK_HOST + "/kjy/oto/mng/seller/phone/change";
public static final String WORK_MNG_updatePermission = WORK_HOST +"/kjy/oto/mng/seller/updatePermission";
public static final String WORK_MNG_syncBind = WORK_HOST + "/kjy/oto/mng/seller/account/yk/syncBind";
public static final String WORK_MNG_accountUnbind = WORK_HOST + "/kjy/oto/mng/seller/account/unbind";
public static final String WORK_MNG_ykBind = WORK_HOST + "/kjy/oto/mng/seller/account/yk/bind";
public static final String WORK_MNG_ykUnbind = WORK_HOST + "/kjy/oto/mng/seller/account/yk/unbind";
public static final String WORK_MNG_accountBind = WORK_HOST + "/kjy/oto/mng/seller/account/bind";
public static final String WORK_MNG_switchDimissionStatus = WORK_HOST +"/kjy/oto/mng/seller/switchDimissionStatus";
public static final String WORK_MNG_ykList = WORK_HOST + "/kjy/oto/mng/seller/account/yk/availableList";
public static final String WORK_MNG_accountList = WORK_HOST + "/kjy/oto/mng/seller/account/availableList";
public static final String WORK_getDeptList= WORK_HOST + "/kjy/oto/mng/seller/get/dept/list";
//*************************客集集营销平台******************************
public static final String PHONE_bindWxUser = HOST + "/kjy/oto/interview/bindWxUser";
public static final String PHONE_submitEvaluate = HOST + "/kjy/oto/interview/submitEvaluate";
public static final String WX_look= HOST + "/kjy/mp/oto/risk/invLetter/look";
public static final String WX_confirm= HOST + "/kjy/mp/oto/risk/invLetter/confirm";
//***********************销售工作台手机端**********************
public static final String PHONE_getCustPhase = WORK_HOST + "/kjy/oto/manager/customer/getCustPhase";
public static final String PHONE_updateCustPhase = WORK_HOST + "/kjy/oto/manager/customer/updateCustPhase";
......
......@@ -6,13 +6,32 @@
<class name="com.oto.cases.otoseller.Manager"/>
</classes>
</test>
<test preserve-order="true" name="销售工作台PC端">
<test preserve-order="true" name="PC_系统管理">
<classes>
<class name="com.oto.cases.otoseller.Depts"/>
</classes>
</test>
<test preserve-order="true" name="PC_基础工作台">
<classes>
<class name="com.oto.cases.otoseller.Work"/>
</classes>
</test>
<test preserve-order="true" name="销售工作台手机端">
<test preserve-order="true" name="PC_邀约承诺">
<classes>
<class name="com.oto.cases.otoseller.Invite"/>
</classes>
</test>
<test preserve-order="true" name="PC_客户盘点">
<classes>
<class name="com.oto.cases.otoseller.CheckTask"/>
</classes>
</test>
<test preserve-order="true" name="销售工作台_手机端">
<classes>
<class name="com.oto.cases.otoseller.Phone"/>
</classes>
......
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