Commit 5c4aae80 authored by 龚小红's avatar 龚小红

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

增加移动端1.2的自动化测试接口

See merge request !5
parents 80034ba3 40b5d52a
......@@ -118,23 +118,6 @@ public class Manager {
Assert.assertFalse(success,network.message(params,BasicConfig.MANAGER_oto_saveSeller,"新增同一手机号销售成功",response.body().asString()));
}
//接口对此场景做校验,仅前端做了限制
// @Test(description = "不可修改总监为普通",priority = 6)
// public void 不可修改总监为普通(){
// HashMap<String,Object> params = new HashMap<>();
// params.put("id", LEADER_ID);
// params.put("sellerName", "勿动-自动化测试总监");
// params.put("phoneNumber", "18248405155");
// params.put("roleType", 1);
// params.put("callPermission", 1);
// params.put("sellerStatus", 1);
// params.put("companyId", 3);
// params.put("sellerLevel", 1);
// 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 = 7)
public void 不可新增同名公司(){
HashMap<String,Object> params = new HashMap<>();
......@@ -219,6 +202,8 @@ public class Manager {
moneyOptions.add(2);
HashMap<String,Object> params = new HashMap<>();
params.put("id", 19);
params.put("businessType", 2);
params.put("supplierId", 11);
params.put("prodName", "勿动-自动化专用产品更新");
params.put("companyIds", companyIds);
params.put("costOptions", costOptions);
......@@ -261,6 +246,8 @@ public class Manager {
moneyOptions.add(3);
HashMap<String,Object> params = new HashMap<>();
params.put("id", 19);
params.put("businessType", 2);
params.put("supplierId", 21);
params.put("prodName", "勿动-自动化专用产品");
params.put("companyIds", companyIds);
params.put("costOptions", costOptions);
......
......@@ -22,6 +22,7 @@ public class Work implements Authorization {
public int followTimes; //跟进次数
public static Map<String,Integer> header;
public static Map<String,Integer> chart;
public static long sceneId;
@BeforeTest
public void setUp(){
......@@ -98,7 +99,6 @@ public class Work implements Authorization {
Assert.assertTrue(data,network.message(params,BasicConfig.FORM_submitQuestion,"客户填写表单失败",response.body().asString()));
}
@Test(description = "公域引流_查找客户",priority = 5)
public void 公域引流_查找客户(){
HashMap<String,Object> params = new HashMap<String,Object>();
......@@ -168,11 +168,11 @@ public class Work implements Authorization {
Response response = network.getResponse(BasicConfig.WORK_staticChart);
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data,network.message(BasicConfig.WORK_staticChart,"流程组表格数量为空",response.body().asString()));
chart.put("ondStep",response.jsonPath().getInt("data[0].custNum"));
chart.put("twoStep",response.jsonPath().getInt("data[1].custNum"));
chart.put("threeStep",response.jsonPath().getInt("data[2].custNum"));
chart.put("fourStep",response.jsonPath().getInt("data[3].custNum"));
chart.put("fiveStep",response.jsonPath().getInt("data[4].custNum"));
chart.put("ondStep",response.jsonPath().getInt("data[1].custNum"));
chart.put("twoStep",response.jsonPath().getInt("data[2].custNum"));
chart.put("threeStep",response.jsonPath().getInt("data[3].custNum"));
chart.put("fourStep",response.jsonPath().getInt("data[4].custNum"));
chart.put("fiveStep",response.jsonPath().getInt("data[5].custNum"));
}
@Test(description = "工作台_标签列表",priority = 11)
......@@ -238,12 +238,12 @@ public class Work implements Authorization {
HashMap<String,Object> params = new HashMap<>();
params.put("custId", custId);
Response response = network.getResponse(params,BasicConfig.WORK_detail);
Object custInfo = response.jsonPath().getJsonObject("data.custInfo");
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,1,network.message(params,BasicConfig.WORK_detail,"新客户流程组状态错误非1",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()));
Object formInfo = response.jsonPath().getJsonObject("data.formInfo");
Assert.assertNotNull(custInfo,network.message(params,BasicConfig.WORK_detail,"新客户提交计划书状态错误非0",response.body().asString()));
Assert.assertNotNull(formInfo,network.message(params,BasicConfig.WORK_detail,"新客户投保要素确认状态错误非0",response.body().asString()));
Assert.assertEquals(custFlow,1,network.message(params,BasicConfig.WORK_detail,"客户阶段不为1:具备机构养老理念",response.body().asString()));
}
@Test(description = "查询客户电话表单回填状态",priority = 17)
......@@ -272,6 +272,17 @@ 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.getResponse(params,BasicConfig.PHONE_getCustPhase);
int custFlow = response.jsonPath().getInt("data.custFlow");
int commitPlanFlag = response.jsonPath().getInt("data.commitPlanFlag");
Assert.assertEquals(custFlow,1,network.message(params,BasicConfig.WORK_callLog,"新客户的客户阶段不为1:具备机构养老理念",response.body().asString()));
Assert.assertEquals(commitPlanFlag,0,network.message(params,BasicConfig.WORK_callLog,"是否提交计划书不为否",response.body().asString()));
}
@Test(description = "修改客户跟进权重",priority = 24)
public void 修改客户跟进权重(){
HashMap<String,Object> params = new HashMap<>();
......@@ -785,8 +796,8 @@ public class Work implements Authorization {
Assert.assertTrue(listSize>0,network.message(params,BasicConfig.WORK_taskDetailsList,"待完成客户数统计错误",response.body().asString()));
}
@Test(description = "查看我的预约列表",priority = 70)
public void 查看我的预约列表(){
@Test(description = "查看我的预约订单列表",priority = 70)
public void 查看我的预约订单列表(){
agent2Tku();
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex",1);
......@@ -799,4 +810,64 @@ public class Work implements Authorization {
Assert.assertEquals(bookingStatus,0,network.message(BasicConfig.PHONE_getReservationList,"预约状态错误:非待参观",response.body().asString()));
}
@Test(description = "新增见面场景",priority = 71)
public void 新增见面场景(){
otoManagerAuth();
int companyIds[] = {1,5};
int custFlows[] = {1,2};
HashMap<String,Object> params = new HashMap<>();
params.put("confUsable",0);
params.put("companyIds",companyIds);
params.put("custFlows",custFlows);
params.put("sceneName","勿动-自动化场景");
params.put("sceneDesc","勿动,这是自动化测试专用的面访场景");
Response response =network.postResponse(params,BasicConfig.PHONE_custConfSave);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.PHONE_custConfSave,"新增见面场景失败",response.body().asString()));
}
@Test(description = "查看见面场景列表",priority = 72)
public void 查看见面场景列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex",1);
params.put("pageSize",20);
Response response =network.getResponse(params,BasicConfig.PHONE_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.PHONE_custConfList,"查看预约列表不为空",response.body().asString()));
Assert.assertEquals(confUsable, 0,network.message(params,BasicConfig.PHONE_custConfList,"查看预约列表不为空",response.body().asString()));
Assert.assertEquals(sceneName,"勿动-自动化场景",network.message(params,BasicConfig.PHONE_custConfList,"查看预约列表不为空",response.body().asString()));
sceneId = response.jsonPath().getLong("data.list[0].id");
}
@Test(description = "修改见面场景",priority = 73)
public void 修改见面场景(){
int companyIds[] ={5};
int custFlows[] = {1,2,3,4,5};
HashMap<String,Object> params = new HashMap<>();
params.put("id",sceneId);
params.put("confUsable",1);
params.put("companyIds",companyIds);
params.put("custFlows",custFlows);
params.put("sceneName","勿动-自动化面访场景");
params.put("sceneDesc","勿动,这是自动化测试专用的面访场景");
Response response =network.postResponse(params,BasicConfig.PHONE_custConfSave);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.PHONE_custConfSave,"修改自动化场景失败",response.body().asString()));
}
@Test(description = "关闭见面场景状态",priority = 74)
public void 关闭见面场景状态(){
HashMap<String,Object> params = new HashMap<>();
params.put("id",sceneId);
params.put("confUsable",0);
Response response =network.postResponse(params,BasicConfig.PHONE_updateStatus);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.PHONE_updateStatus,"关闭见面场景失败",response.body().asString()));
}
}
......@@ -135,7 +135,12 @@ public class BasicConfig {
public static final String WORK_modifyTaskConf= WORK_HOST + "/kjy/oto/manager/sellerTask/modifyTaskConf";
public static final String WORK_statisticHeader= WORK_HOST + "/kjy/oto/manager/sellerTask/statistic/header";
public static final String WORK_taskDetailsList= WORK_HOST + "/kjy/oto/manager/sellerTask/taskDetailsList";
public static final String PHONE_custConfSave = WORK_HOST + "/kjy/oto/manager/custconf/save";
public static final String PHONE_custConfList = WORK_HOST + "/kjy/oto/manager/custconf/list";
public static final String PHONE_updateStatus = WORK_HOST + "/kjy/oto/manager/custconf/updateStatus";
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";
public static final String PHONE_delete = WORK_HOST + "/kjy/oto/manager/custconf/delete";
public static final String PHONE_customerList = PHONE_HOST + "/kjy/oto/manager/customer/list";
public static final String PHONE_customerSave = PHONE_HOST + "/kjy/oto/manager/customer/introduce/save";
......@@ -161,6 +166,8 @@ public class BasicConfig {
public static final String PHONE_getUnusualTypes = PHONE_HOST + "/kjy/oto/h5/v1/getUnusualTypes";
public static final String PHONE_fail = HOST + "/kjy/oto/interview/authorize/fail";
public static final String PHONE_getReservationList = HOST + "/kjy/pub/form/getReservationList";
public static final String PHONE_listCustInterConf = PHONE_HOST + "/kjy/oto/interview/listCustInterConf";
public static final String PHONE_checkCustPhase = PHONE_HOST + "/kjy/oto/interview/checkCustPhase";
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";
......
package com.oto.utils;
import java.util.HashMap;
import java.util.Map;
/**
* @author lizhi
* @date 2020/4/9 11:36 AM
*/
public enum IdConvertBase64Enum {
/**
* 注意,code只能是两位
*/
DEF("j2", "默认类型"),
TRANS("t3", "短链接服务"),
;
private String code;
private String desc;
IdConvertBase64Enum(String code, String desc) {
this.code = code;
this.desc = desc;
}
public String getCode() {
return "K"+ code;
}
private static final Map<String, IdConvertBase64Enum> ENUM_MAP = new HashMap<>();
static{
for(IdConvertBase64Enum lengthEnum : values()){
ENUM_MAP.put(lengthEnum.getCode(), lengthEnum);
}
}
public static IdConvertBase64Enum getByCode(String code) {
if (code == null) {
return null;
}
return ENUM_MAP.get(code);
}
}
\ No newline at end of file
......@@ -78,14 +78,4 @@ public class IdMakeUtil implements Authorization {
return decodeId;
}
public static String encodingId(Long id, IdConvertBase64Enum base64Enum) {
if (id == null || base64Enum == null || base64Enum.getCode().length() != 3) {
return null;
}
id = (id << 3) ^ 7;
String encode = encoder.encodeToString(Long.toString(id).getBytes());
String replace = encode.replace("=", "");
return base64Enum.getCode() + (encode.length() - replace.length()) + replace;
}
}
......@@ -21,14 +21,6 @@ public class JmeterAccountFile {
public static void main(String[] args) {
// String path = String.valueOf(JmeterAccountFile.class.getResource("/"));
// accountFile(path);
otoCookieMaker();
}
/**
* 生成otoCookie,仅用于压力测试文件
*/
public static void otoCookieMaker() {
}
//仅用于生成直播账号Authkey文件
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="客集集" verbose="1" thread-count="3">
<suite name="oto" verbose="1" thread-count="3">
<suite-files>
<suite-file path="workTestNG.xml"></suite-file>
......
This diff is collapsed.
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