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

Merge branch 'Feature/20220418-gxh' into 'master'

Feature/20220418 gxh

See merge request test-group/kejiji!248
parents 9aba0cb1 e1e61a80
......@@ -6,6 +6,8 @@ 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.kjj.config.BasicConfig.LEADER_ID;
......@@ -204,4 +206,68 @@ public class Manager {
Assert.assertFalse(success,network.message(params,BasicConfig.MANAGER_oto_switchDimissionStatus,"总监名下存在销售但离职成功",response.body().asString()));
}
@Test(description = "修改公司产品",priority = 14)
public void 修改公司产品(){
ArrayList companyIds = new ArrayList();
companyIds.add(5);
ArrayList costOptions = new ArrayList();
costOptions.add(0);
costOptions.add(1);
costOptions.add(2);
ArrayList moneyOptions = new ArrayList();
moneyOptions.add(1);
moneyOptions.add(2);
HashMap<String,Object> params = new HashMap<>();
params.put("id", 19);
params.put("prodName", "勿动-自动化专用产品更新");
params.put("companyIds", companyIds);
params.put("costOptions", costOptions);
params.put("moneyOptions", moneyOptions);
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_productSave);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_productSave,"修改公司产品失败",response.body().asString()));
}
@Test(description = "查看产品列表",priority = 15)
public void 查看产品列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex", 1);
params.put("pageSize", 10);
params.put("companyIds", 5);
params.put("prodStatus", 1);
Response response = network.getResponse(params,BasicConfig.MANAGER_oto_productList);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.MANAGER_oto_productList,"查询公司产品为空",response.body().asString()));
int id = response.jsonPath().getInt("data.list[0].id");
Assert.assertEquals(id,19,network.message(params,BasicConfig.MANAGER_oto_productList,"查询公司产品错误",response.body().asString()));
int costOptionsSize = response.jsonPath().getInt("data.list[0].costOptions.size()");
String prodName = response.jsonPath().getString("data.list[0].prodName");
Assert.assertEquals(costOptionsSize,3,network.message(params,BasicConfig.MANAGER_oto_productList,"产品的缴费期未更新",response.body().asString()));
Assert.assertEquals(prodName,"勿动-自动化专用产品更新",network.message(params,BasicConfig.MANAGER_oto_productList,"产品的名称未更新",response.body().asString()));
}
@Test(description = "还原公司产品",priority = 15)
public void 还原公司产品(){
ArrayList companyIds = new ArrayList();
companyIds.add(5);
ArrayList costOptions = new ArrayList();
costOptions.add(0);
costOptions.add(1);
costOptions.add(2);
costOptions.add(3);
ArrayList moneyOptions = new ArrayList();
moneyOptions.add(1);
moneyOptions.add(2);
moneyOptions.add(3);
HashMap<String,Object> params = new HashMap<>();
params.put("id", 19);
params.put("prodName", "勿动-自动化专用产品");
params.put("companyIds", companyIds);
params.put("costOptions", costOptions);
params.put("moneyOptions", moneyOptions);
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_productSave);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_productSave,"修改公司产品失败",response.body().asString()));
}
}
......@@ -16,10 +16,10 @@ import org.testng.annotations.Test;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import static com.kjj.utils.BaseUtils.*;
import static com.kjj.utils.ThreadSleepUtils.sleep;
//手机端
......@@ -29,12 +29,16 @@ public class Phone implements Authorization {
private String custName;
private String introduceCustomer_id;
private String myselfCustomer_id;
private long productId = 19;
private ArrayList ids;
private ArrayList<String> interviewIds;
private Object scanCodeId;
@BeforeTest
public void setUp(){
//登录销售工作台手机端
otoSellerTku();
otoSellerLogin();
otoLeaderLogin();
ids = new ArrayList<>();
interviewIds = new ArrayList<>();
}
......@@ -166,151 +170,293 @@ public class Phone implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.PHONE_interviewUpdate,"修改社区时间失败",response.body().asString()));
}
// @Test(description = "客户扫码进行评价",priority = 12)
// public void 客户扫码进行评价() throws SQLException {
// userTku();
// Map<String, Object> result = KjyLiveNormalDB.getInstance().findSimpleResult(UserSqlFactory.selectCodeIdByCustomerId, IdMakeUtil.decodingId(cust_id));
// Object scanCodeId = result.get("scan_code_id");
//
// HashMap<String,Object> params = new HashMap<>();
// params.put("scanCodeId", scanCodeId);
// params.put("scanCodeType", 1047);
// params.put("evaluateDetail", "[2]");
// Response response = network.getResponse(params, BasicConfig.PHONE_submitEvaluate);
// boolean data = response.jsonPath().getBoolean("data");
// Assert.assertTrue(data,network.message(params,BasicConfig.PHONE_submitEvaluate,"扫码评价失败",response.body().asString()));
// }
//
// @Test(description = "销售查询面访状态",priority = 13)
// public void 销售查询面访状态() {
// sleep(2000);
// otoSellerTku();
//
// HashMap<String,Object> params = new HashMap<>();
// params.put("latitude", 30.287816);
// params.put("longitude", 120.111991);
// params.put("id", IdMakeUtil.decodingId(interviewIds.get(0)));
// Response response = network.postResponse(params, BasicConfig.PHONE_interviewStatus);
// int interviewStatus = response.jsonPath().getInt("data.interviewStatus");
// boolean isMatching = response.jsonPath().getBoolean("data.isMatching");
// Assert.assertEquals(interviewStatus,2,network.message(params,BasicConfig.PHONE_interviewStatus,"扫码评价失败",response.body().asString()));
// Assert.assertFalse(isMatching,network.message(params,BasicConfig.PHONE_interviewStatus,"扫码评价失败",response.body().asString()));
// }
//
// @Test(description = "销售查询客户授权手机号",priority = 14)
// public void 销售查询客户授权手机号() {
// HashMap<String,Object> params = new HashMap<>();
// params.put("id", interviewIds.get(0));
// Response response = network.getResponse(params, BasicConfig.PHONE_interviewPhone);
// String authPhone = response.jsonPath().getString("data.authPhone");
// boolean isMatching = response.jsonPath().getBoolean("data.isMatching");
// Assert.assertNotNull(authPhone,network.message(params,BasicConfig.PHONE_interviewPhone,"扫码评价失败",response.body().asString()));
// Assert.assertFalse(isMatching,network.message(params,BasicConfig.PHONE_interviewPhone,"扫码评价失败",response.body().asString()));
// }
//
// @Test(description = "销售取消关联手机号",priority = 15)
// public void 销售取消关联手机号() {
// HashMap<String,Object> params = new HashMap<>();
// params.put("id", IdMakeUtil.decodingId(interviewIds.get(0)));
// Response response = network.postResponse(params, BasicConfig.PHONE_interviewCancel);
// String authPhone = response.jsonPath().getString("data.authPhone");
// boolean isMatching = response.jsonPath().getBoolean("data.isMatching");
// Assert.assertNotNull(authPhone,network.message(params,BasicConfig.PHONE_interviewCancel,"扫码评价失败",response.body().asString()));
// Assert.assertFalse(isMatching,network.message(params,BasicConfig.PHONE_interviewCancel,"扫码评价失败",response.body().asString()));
// }
//
// @Test(description = "销售再次查询面访状态",priority = 16)
// public void 销售再次查询面访状态() {
// sleep(2000);
// otoSellerTku();
//
// HashMap<String,Object> params = new HashMap<>();
// params.put("latitude", 30.287816);
// params.put("longitude", 120.111991);
// params.put("id", IdMakeUtil.decodingId(interviewIds.get(0)));
// Response response = network.postResponse(params, BasicConfig.PHONE_interviewStatus);
// int interviewStatus = response.jsonPath().getInt("data.interviewStatus");
// Assert.assertEquals(interviewStatus,1,network.message(params,BasicConfig.PHONE_interviewStatus,"扫码评价失败",response.body().asString()));
// }
//
// @Test(description = "客户重新扫码进行评价",priority = 17)
// public void 客户重新扫码进行评价() throws SQLException {
// userTku();
// Map<String, Object> result = KjyUserDB.getInstance().findSimpleResult(UserSqlFactory.selectCodeIdByCustomerId, IdMakeUtil.decodingId(cust_id));
// Object scanCodeId = result.get("scan_code_id");
//
// HashMap<String,Object> params = new HashMap<>();
// params.put("scanCodeId", scanCodeId);
// params.put("scanCodeType", 1047);
// params.put("evaluateDetail", "[2]");
// Response response = network.postResponse(params, BasicConfig.PHONE_submitEvaluate);
// boolean data = response.jsonPath().getBoolean("data");
// Assert.assertTrue(data,network.message(params,BasicConfig.PHONE_submitEvaluate,"扫码评价失败",response.body().asString()));
// }
//
// @Test(description = "销售查询更新面访状态",priority = 18)
// public void 销售查询更新面访状态() {
// sleep(2000);
// otoSellerTku();
//
// HashMap<String,Object> params = new HashMap<>();
// params.put("latitude", 30.287816);
// params.put("longitude", 120.111991);
// params.put("id", IdMakeUtil.decodingId(interviewIds.get(0)));
// Response response = network.postResponse(params, BasicConfig.PHONE_interviewStatus);
// int interviewStatus = response.jsonPath().getInt("data.interviewStatus");
// Assert.assertEquals(interviewStatus,2,network.message(params,BasicConfig.PHONE_interviewStatus,"扫码评价失败",response.body().asString()));
// }
//
// @Test(description = "销售确定关联手机号",priority = 19)
// public void 销售确定关联手机号() {
// HashMap<String,Object> params = new HashMap<>();
// params.put("id", interviewIds.get(0));
// Response response = network.postResponse(params, BasicConfig.PHONE_interviewBind);
// boolean data = response.jsonPath().getBoolean("data");
// Assert.assertTrue(data,network.message(params,BasicConfig.PHONE_interviewBind,"确定关联失败",response.body().asString()));
// }
//
// @Test(description = "查看我的面访",priority = 20)
// public void 查看我的面访(){
// HashMap<String,Object> params = new HashMap<>();
// params.put("pageSize", "自动化测试用户");
// params.put("pageSize", "20");
// Response response = network.getResponse(params, BasicConfig.PHONE_interviewList);
// int size = response.jsonPath().getInt("data.customerInterviewVos.size()");
// int interviewStatus = response.jsonPath().getInt("data.customerInterviewVos[0].interviewStatus");
// Assert.assertEquals(size,1,network.message(params,BasicConfig.PHONE_interviewList,"面访列表为空",response.body().asString()));
// Assert.assertEquals(interviewStatus,3,network.message(params,BasicConfig.PHONE_interviewList,"面访列表为空",response.body().asString()));
// }
//
// @Test(description = "查询面访回填信息",priority = 21)
// public void 查询面访回填信息(){
// HashMap<String,Object> params = new HashMap<>();
// params.put("id", interviewIds.get(0));
// Response response = network.getResponse(params, BasicConfig.PHONE_custExtDetail);
// String interviewAddress = response.jsonPath().getString("data.interviewAddress");
// int commitPlanFlag = response.jsonPath().getInt("data.commitPlanFlag");
// Assert.assertNotNull(interviewAddress,network.message(params,BasicConfig.PHONE_custExtDetail,"面访列表为空",response.body().asString()));
// Assert.assertEquals(commitPlanFlag,0,network.message(params,BasicConfig.PHONE_custExtDetail,"面访列表为空",response.body().asString()));
// }
//
// @Test(description = "上传面访详情",priority = 22)
// public void 上传面访详情(){
// HashMap<String,Object> params = new HashMap<>();
// params.put("id", interviewIds.get(0));
// params.put("interviewRemark", "第一次社区参观");
// params.put("coreMaker", 2);
// params.put("followWeight", 1);
// params.put("commitPlanFlag", 0);
// Response response = network.getResponse(params, BasicConfig.PHONE_interviewList);
// int size = response.jsonPath().getInt("data.customerInterviewVos.size()");
// int interviewStatus = response.jsonPath().getInt("data.customerInterviewVos[0].interviewStatus");
// Assert.assertEquals(size,1,network.message(params,BasicConfig.PHONE_interviewList,"面访列表为空",response.body().asString()));
// Assert.assertEquals(interviewStatus,3,network.message(params,BasicConfig.PHONE_interviewList,"面访列表为空",response.body().asString()));
// }
//
//
//
@Test(description = "扫码绑定微信用户并评价",priority = 12)
public void 扫码绑定微信用户() throws SQLException {
agentTku();
Map<String, Object> result = KjyLiveNormalDB.getInstance().findSimpleResult(UserSqlFactory.selectCodeIdByCustomerId, IdMakeUtil.decodingId(cust_id));
scanCodeId = result.get("scan_code_id");
scanCode(IdMakeUtil.encodingId((Long) scanCodeId));
}
@Test(description = "销售查询面访状态",priority = 13)
public void 销售查询面访状态() {
sleep(2000);
otoSellerTku();
HashMap<String,Object> params = new HashMap<>();
params.put("latitude", 30.287816);
params.put("longitude", 120.111991);
params.put("id", interviewIds.get(0));
Response response = network.postResponse(params, BasicConfig.PHONE_interviewStatus);
int interviewStatus = response.jsonPath().getInt("data.interviewStatus");
boolean isMatching = response.jsonPath().getBoolean("data.isMatching");
Assert.assertEquals(interviewStatus,3,network.message(params,BasicConfig.PHONE_interviewStatus,"面访状态错误:非待上传",response.body().asString()));
Assert.assertFalse(isMatching,network.message(params,BasicConfig.PHONE_interviewStatus,"手机号匹配状态错误:非不匹配",response.body().asString()));
}
@Test(description = "销售查询客户授权手机号",priority = 15)
public void 销售查询客户授权手机号() {
HashMap<String,Object> params = new HashMap<>();
params.put("id", interviewIds.get(0));
Response response = network.getResponse(params, BasicConfig.PHONE_interviewPhone);
String authPhone = response.jsonPath().getString("data.authPhone");
boolean isMatching = response.jsonPath().getBoolean("data.isMatching");
Assert.assertNotNull(authPhone,network.message(params,BasicConfig.PHONE_interviewPhone,"获取的系统手机号为空",response.body().asString()));
Assert.assertFalse(isMatching,network.message(params,BasicConfig.PHONE_interviewPhone,"手机号匹配状态错误:非不匹配",response.body().asString()));
}
@Test(description = "销售取消关联手机号",priority = 16)
public void 销售取消关联手机号() {
HashMap<String,Object> params = new HashMap<>();
params.put("id", interviewIds.get(0));
Response response = network.postResponse(params, BasicConfig.PHONE_bindCancel);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.PHONE_bindCancel,"取消关联手机号失败",response.body().asString()));
}
@Test(description = "销售再次查询面访状态",priority = 17)
public void 销售再次查询面访状态() {
sleep(2000);
otoSellerTku();
HashMap<String,Object> params = new HashMap<>();
params.put("latitude", 30.287816);
params.put("longitude", 120.111991);
params.put("id", interviewIds.get(0));
Response response = network.postResponse(params, BasicConfig.PHONE_interviewStatus);
int interviewStatus = response.jsonPath().getInt("data.interviewStatus");
Assert.assertEquals(interviewStatus,1,network.message(params,BasicConfig.PHONE_interviewStatus,"扫码评价失败",response.body().asString()));
}
@Test(description = "客户重新扫码进行评价",priority = 18)
public void 客户重新扫码进行评价() throws SQLException {
agentTku();
scanCode(IdMakeUtil.encodingId((Long) scanCodeId));
}
@Test(description = "销售查询更新面访状态",priority = 19)
public void 销售查询更新面访状态() {
sleep(2000);
otoSellerTku();
HashMap<String,Object> params = new HashMap<>();
params.put("latitude", 30.287816);
params.put("longitude", 120.111991);
params.put("id", interviewIds.get(0));
Response response = network.postResponse(params, BasicConfig.PHONE_interviewStatus);
int interviewStatus = response.jsonPath().getInt("data.interviewStatus");
Assert.assertEquals(interviewStatus,3,network.message(params,BasicConfig.PHONE_interviewStatus,"面访状态错误:非待上传",response.body().asString()));
}
@Test(description = "销售确定关联手机号",priority = 20)
public void 销售确定关联手机号() {
HashMap<String,Object> params = new HashMap<>();
params.put("id", interviewIds.get(0));
Response response = network.postResponse(params, BasicConfig.PHONE_interviewBind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.PHONE_interviewBind,"确定关联失败",response.body().asString()));
}
@Test(description = "查看我的面访",priority = 21)
public void 查看我的面访(){
HashMap<String,Object> params = new HashMap<>();
params.put("custName", "自动化测试用户");
params.put("pageSize", "20");
Response response = network.getResponse(params, BasicConfig.PHONE_interviewList);
int size = response.jsonPath().getInt("data.customerInterviewVos.size()");
int interviewStatus = response.jsonPath().getInt("data.customerInterviewVos[0].interviewStatus");
Assert.assertEquals(size,1,network.message(params,BasicConfig.PHONE_interviewList,"面访列表为空",response.body().asString()));
Assert.assertEquals(interviewStatus,3,network.message(params,BasicConfig.PHONE_interviewList,"面访列表为空",response.body().asString()));
}
@Test(description = "查询面访回填信息",priority = 22)
public void 查询面访回填信息(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", interviewIds.get(0));
Response response = network.getResponse(params, BasicConfig.PHONE_custExtDetail);
String interviewAddress = response.jsonPath().getString("data.interviewAddress");
int commitPlanFlag = response.jsonPath().getInt("data.commitPlanFlag");
Assert.assertNotNull(interviewAddress,network.message(params,BasicConfig.PHONE_custExtDetail,"面访列表为空",response.body().asString()));
Assert.assertEquals(commitPlanFlag,0,network.message(params,BasicConfig.PHONE_custExtDetail,"面访列表为空",response.body().asString()));
}
@Test(description = "上传社区面访详情",priority = 23)
public void 上传社区面访详情(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", interviewIds.get(0));
params.put("interviewRemark", "第一次社区参观");
params.put("coreMaker", 2);
params.put("followWeight", 1);
params.put("commitPlanFlag", 0);
Response response = network.postResponse(params, BasicConfig.PHONE_interviewFeedback);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,BasicConfig.WORK_delCust,"上传面访失败",response.body().asString()));
}
@Test(description = "取消面访",priority = 24)
public void 取消面访(){
interviewCancle(interviewIds.get(1));
interviewCancle(interviewIds.get(2));
}
@Test(description = "客户流程组_表格总览",priority = 25)
public void 客户流程组_表格总览(){
otosellerAuth();
Response response = network.getResponse(BasicConfig.WORK_staticChart);
int ondStep = response.jsonPath().getInt("data[0].custNum");
int twoStep = response.jsonPath().getInt("data[1].custNum");
Assert.assertEquals(ondStep,Work.chart.get("ondStep")+1,network.message(BasicConfig.WORK_staticChart,"创建的转介绍和缘故客户的流程组非1",response.body().asString()));
Assert.assertEquals(twoStep,Work.chart.get("twoStep")+1,network.message(BasicConfig.WORK_staticChart,"客户社区参观后未提交计划书流程组状态未变为2",response.body().asString()));
}
@Test(description = "创建普通面访",priority = 26)
public void 创建普通面访(){
otoSellerTku();
HashMap<String,Object> params = new HashMap<>();
ids = new ArrayList();
ids.add(cust_id);
params.put("custIds", ids);
params.put("interviewType", 1);
Response response = network.postResponse(params, BasicConfig.PHONE_interviewSave);
int size = response.jsonPath().getJsonObject("data.size()");
Assert.assertEquals(size,1,network.message(params,BasicConfig.PHONE_interviewSave,"创建普通面访失败",response.body().asString()));
interviewIds.clear();
interviewIds.add(response.jsonPath().getString("data[0]"));
}
@Test(description = "客户完成普通面访并扫码",priority = 27)
public void 客户完成普通面访并扫码() throws SQLException {
agentTku();
Map<String, Object> result = KjyLiveNormalDB.getInstance().findSimpleResult(UserSqlFactory.selectCodeIdByCustomerId, IdMakeUtil.decodingId(cust_id));
scanCodeId = result.get("scan_code_id");
System.out.println(scanCodeId);
scanCode(IdMakeUtil.encodingId((Long) scanCodeId));
}
@Test(description = "销售查询客户授权手机号与关联手机号一致",priority = 28)
public void 销售查询客户授权手机号与关联手机号一致() {
sleep(2000);
otoSellerTku();
HashMap<String,Object> params = new HashMap<>();
params.put("latitude", 30.287816);
params.put("longitude", 120.111991);
params.put("id", interviewIds.get(0));
Response response = network.postResponse(params, BasicConfig.PHONE_interviewStatus);
int interviewStatus = response.jsonPath().getInt("data.interviewStatus");
boolean isMatching = response.jsonPath().getBoolean("data.isMatching");
Assert.assertEquals(interviewStatus,3,network.message(params,BasicConfig.PHONE_interviewStatus,"面访状态错误:非待上传",response.body().asString()));
// Assert.assertTrue(isMatching,network.message(params,BasicConfig.PHONE_interviewStatus,"手机号匹配状态错误:非匹配",response.body().asString()));
}
@Test(description = "查看公司产品列表",priority = 29)
public void 查看公司产品列表() {
otoSellerTku();
String encodeProductId = IdMakeUtil.encodingId(productId);
Response response = network.getResponse(BasicConfig.PHONE_listBysellComp);
int size = response.jsonPath().getInt("data.findAll{it.id == '"+encodeProductId+"'}.size()");
Assert.assertEquals(size,1,network.message(BasicConfig.PHONE_listBysellComp,"产品列表未包含已上架产品",response.body().asString()));
}
@Test(description = "下架公司产品",priority = 30)
public void 下架公司产品() {
ssoLogin();
HashMap<String,Object> params = new HashMap<>();
params.put("id", productId);
Response response = network.postResponse(params, BasicConfig.MANAGER_oto_productUpdateStatus);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_productUpdateStatus,"下架公司产品失败",response.body().asString()));
}
@Test(description = "产品下架后公司产品列表不显示",priority = 31)
public void 产品下架后公司产品列表不显示() {
otoSellerTku();
String encodeProductId = IdMakeUtil.encodingId(productId);
Response response = network.postResponse(BasicConfig.PHONE_listBysellComp);
int size = response.jsonPath().getJsonObject("data.findAll{it.id == "+encodeProductId+"}.size()");
Assert.assertEquals(size,0,network.message(BasicConfig.PHONE_listBysellComp,"产品列表未包含已上架产品",response.body().asString()));
HashMap<String,Object> params = new HashMap<>();
params.put("id", productId);
response = network.postResponse(params, BasicConfig.MANAGER_oto_productUpdateStatus);
boolean data = response.jsonPath().getBoolean("data");
}
@Test(description = "上传普通面访详情",priority = 32)
public void 上传普通面访详情(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", interviewIds.get(0));
params.put("interviewRemark", "第一次普通参观");
params.put("coreMaker", 1);
params.put("followWeight", 2);
params.put("commitPlanFlag", 1);
params.put("commitCustStatus", 1);
params.put("commitInsure", 1);
params.put("productId", IdMakeUtil.encodingId(productId));
params.put("insApplicant", 1);
params.put("insByApplicant", 1);
params.put("insPeriod", 3);
params.put("insMoney", 3);
Response response = network.postResponse(params, BasicConfig.PHONE_interviewFeedback);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,BasicConfig.WORK_delCust,"上传面访失败",response.body().asString()));
}
@Test(description = "客户流程组_表格总览更新为当下成交",priority = 33)
public void 客户流程组_表格总览更新为当下成交(){
otosellerAuth();
sleep(2000);
Response response = network.getResponse(BasicConfig.WORK_staticChart);
int fourStep = response.jsonPath().getInt("data[3].custNum");
Assert.assertEquals(fourStep,Work.chart.get("fourStep")+1,network.message(BasicConfig.WORK_staticChart,"客户社区参观后已确认投保要素流程组状态未变为4",response.body().asString()));
HashMap<String,Object> params = new HashMap<>();
params.put("custId", IdMakeUtil.decodingId(cust_id));
response = network.getResponse(params,BasicConfig.WORK_detail);
int custFlow = response.jsonPath().getInt("data.custInfo.custFlow");
int commitInsure = response.jsonPath().getInt("data.custInfo.commitInsure");
int commitPlanFlag = response.jsonPath().getInt("data.custInfo.commitPlanFlag");
Assert.assertEquals(custFlow,4,network.message(params,BasicConfig.WORK_detail,"新客户流程组状态错误非0",response.body().asString()));
Assert.assertEquals(commitInsure,1,network.message(params,BasicConfig.WORK_detail,"新客户提交计划书状态错误非0",response.body().asString()));
Assert.assertEquals(commitPlanFlag,1,network.message(params,BasicConfig.WORK_detail,"新客户投保要素确认状态错误非0",response.body().asString()));
}
@Test(description = "修改客户基础信息",priority = 34)
public void 修改客户基础信息(){
HashMap<String,Object> params = new HashMap<>();
ArrayList<Integer> array = new ArrayList<>();
params.put("custId", IdMakeUtil.decodingId(cust_id));
params.put("dealFlag", 1);
params.put("dealNumber", "ZDHCSBD000001");
params.put("custName", "自动化测试用户");
Response response = network.postResponse(params,BasicConfig.WORK_edit);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_edit,"修改客户基础信息失败",response.body().asString()));
}
@Test(description = "客户流程组_表格总览更新为已成单",priority = 35)
public void 客户流程组_表格总览更新为已成单(){
sleep(2000);
Response response = network.getResponse(BasicConfig.WORK_staticChart);
int fiveStep = response.jsonPath().getInt("data[4].custNum");
Assert.assertEquals(fiveStep,Work.chart.get("fiveStep")+1,network.message(BasicConfig.WORK_staticChart,"修改已成交后流程组状态未变为5",response.body().asString()));
HashMap<String,Object> params = new HashMap<>();
params.put("custId", IdMakeUtil.decodingId(cust_id));
response = network.getResponse(params,BasicConfig.WORK_detail);
int custFlow = response.jsonPath().getInt("data.custInfo.custFlow");
int dealFlag = response.jsonPath().getInt("data.custInfo.dealFlag");
String dealNumber = response.jsonPath().getString("data.custInfo.dealNumber");
Assert.assertEquals(custFlow,5,network.message(params,BasicConfig.WORK_detail,"新客户流程组状态错误非0",response.body().asString()));
Assert.assertEquals(dealFlag,1,network.message(params,BasicConfig.WORK_detail,"新客户提交计划书状态错误非0",response.body().asString()));
Assert.assertEquals(dealNumber,"ZDHCSBD000001",network.message(params,BasicConfig.WORK_detail,"新客户投保要素确认状态错误非0",response.body().asString()));
}
@Test(description = "删除客户",priority = 79)
public void 删除客户(){
......@@ -333,9 +479,34 @@ public class Phone implements Authorization {
@Test(description = "退出登录",priority = 80)
public void 退出登录(){
otosellerAuth();
Response response = network.postResponse(BasicConfig.WORK_logout);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(BasicConfig.WORK_logout,"退出登录失败",response.body().asString()));
}
public void scanCode(String scanCodeId) {
HashMap<String,Object> params = new HashMap<>();
params.put("scanCodeId", scanCodeId);
params.put("scanCodeType", 1047);
Response response = network.postResponse(params, BasicConfig.PHONE_bindWxUser);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.PHONE_bindWxUser,"扫码绑定失败",response.body().asString()));
ArrayList evaluateDetail = new ArrayList();
evaluateDetail.add(2);
evaluateDetail.add(3);
params.put("scanCodeId", scanCodeId);
params.put("evaluateDetail", evaluateDetail);
response = network.postResponse(params, BasicConfig.PHONE_submitEvaluate);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.PHONE_submitEvaluate,"扫码评价失败",response.body().asString()));
}
public void interviewCancle(String interviewId){
HashMap<String,Object> params = new HashMap<>();
params.put("id", interviewId);
Response response = network.postResponse(params, BasicConfig.PHONE_interviewCancel);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_delCust,"取消面访失败",response.body().asString()));
}
}
......@@ -198,12 +198,10 @@ public class Work implements Authorization {
Assert.assertEquals(customerId,custId,network.message(params,BasicConfig.WORK_customerList,"需要联系列表中首位客户非新增客户",response.body().asString()));
int custStar = response.jsonPath().getInt("data.list[0].custStar");
int followStatus = response.jsonPath().getInt("data.list[0].followStatus");
followTimes = response.jsonPath().getInt("data.list[0].followTimes");
Object custValue = response.jsonPath().getJsonObject("data.list[0].custValue");
Object lastFollowTime = response.jsonPath().getJsonObject("data.list[0].lastFollowTime");
Assert.assertEquals(custStar,0,network.message(params,BasicConfig.WORK_customerList,"新客户默认为星标客户",response.body().asString()));
Assert.assertEquals(followStatus,1,network.message(params,BasicConfig.WORK_customerList,"新客户的默认跟进状态非需要联系状态",response.body().asString()));
Assert.assertEquals(followTimes,0,network.message(params,BasicConfig.WORK_customerList,"新客户的默认跟进次数不为0",response.body().asString()));
Assert.assertNull(custValue,network.message(params,BasicConfig.WORK_customerList,"新客户的默认客户价值不为null",response.body().asString()));
Assert.assertNull(lastFollowTime,network.message(params,BasicConfig.WORK_customerList,"新客户的默认跟进时间不为null",response.body().asString()));
......@@ -251,8 +249,6 @@ public class Work implements Authorization {
Assert.assertEquals(custFlow,1,network.message(params,BasicConfig.WORK_detail,"新客户流程组状态错误非0",response.body().asString()));
Assert.assertEquals(commitInsure,0,network.message(params,BasicConfig.WORK_detail,"新客户提交计划书状态错误非0",response.body().asString()));
Assert.assertEquals(commitPlanFlag,0,network.message(params,BasicConfig.WORK_detail,"新客户投保要素确认状态错误非0",response.body().asString()));
}
@Test(description = "查询客户电话表单回填状态",priority = 17)
......@@ -281,15 +277,6 @@ public class Work implements Authorization {
Assert.assertNotNull(data,network.message(params,BasicConfig.WORK_callLog,"历史通话为空",response.body().asString()));
}
@Test(description = "标记星标用户",priority = 20)
public void 标记星标用户(){
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
Response response = network.postResponse(params,BasicConfig.WORK_star);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_star,"标记星标客户失败",response.body().asString()));
}
@Test(description = "修改客户跟进权重",priority = 24)
public void 修改客户跟进权重(){
HashMap<String,Object> params = new HashMap<>();
......@@ -391,8 +378,7 @@ public class Work implements Authorization {
HashMap<String,Object> params = new HashMap<>();
ArrayList<Integer> array = new ArrayList<>();
params.put("custId", custId);
params.put("commitPlanFlag", 1);
params.put("commitCustStatus", 1);
params.put("commitPlanFlag", 0);
params.put("addWxStatus", 0);
params.put("coreMaker", 1);
params.put("ideaAgree", 1);
......@@ -403,7 +389,7 @@ public class Work implements Authorization {
params.put("custArea", "北京-北京市");
params.put("custDescription", "客户的备注");
params.put("custName", "自动化测试用户");
params.put("dealFlag", 1);
params.put("dealFlag", 0);
params.put("forWho", array);
params.put("retireMoney", 0);
params.put("roomerAge", 0);
......
......@@ -1330,6 +1330,9 @@ public class BasicConfig {
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 WORK_getCaptcha = WORK_HOST + "/kjy/oto/manager/auth/captcha";
public static final String WORK_login = WORK_HOST + "/kjy/oto/manager/auth/login";
......@@ -1389,7 +1392,9 @@ public class BasicConfig {
public static final String PHONE_interviewDetail = PHONE_HOST + "/kjy/oto/interview/edit/detail";
public static final String PHONE_authPhone = PHONE_HOST + "/auth/oto/authPhone";
public static final String PHONE_getAuthPhone = PHONE_HOST + "/auth/oto/getAuthPhone";
public static final String PHONE_submitEvaluate = PHONE_HOST + "/kjy/oto/interview/submitEvaluate";
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 PHONE_listBysellComp = PHONE_HOST + "/kjy/oto/manager/customer/listBysellComp";
public static final String WORK_verifyCode = WORK_HOST + "/kjy/oto/auto/test/verifyCode";
public static final String WORK_delCust = WORK_HOST + "/kjy/oto/auto/test/delCust";
......
......@@ -9,5 +9,5 @@ public class UserSqlFactory {
public static final String selectUserIdForJmeter = "SELECT a.`id` FROM `tb_live_user` a, `tb_users` b ,`tb_users_wx_ext` c WHERE a.`biz_user_id` = b.`id` and b.`id` = c.`user_id` and b.`union_id` NOT LIKE \"-d%\" AND c.`open_id` IS NOT NULL and c.`oa_id` = 14";
public static final String selectCodeIdByCustomerId = "SELECT `scan_code_id` FROM `tb_cust_interview_record` WHERE `customer_id` = ?";
public static final String selectCodeIdByCustomerId = "SELECT `scan_code_id` FROM `tb_cust_interview_record` WHERE `customer_id` = ? and interview_status = 1 ORDER BY id DESC ";
}
This source diff could not be displayed because it is too large. You can view the blob instead.
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