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

更换OTO自动化销售手机号

parent d8d3a7f0
......@@ -36,7 +36,7 @@ public interface Authorization {
//oto后台销售
default void otosellerAuth() {
network.agentCookies.put(otoCookieKey, otoCookieValue);
network.agentCookies.put(otoSellerCookieKey, otoSellerCookieValue);
}
......
......@@ -21,7 +21,7 @@ public class Work implements Authorization {
private static final NetworkUtils network = NetworkUtils.getInstance();
public int tagId; //标签ID
public int custId; //客户ID
public int collectCustId = 2011; //客户ID
public int collectCustId = 2129; //客户ID
public String name; //客户手机号
public String phone; //客户手机号
public int followTimes; //跟进次数
......@@ -125,7 +125,7 @@ public class Work implements Authorization {
HashMap<String,Object> params = new HashMap<>();
String str= String.valueOf(System.currentTimeMillis());
params.put("customerId",custId);
params.put("sellerId", 23);
params.put("sellerId", 35);
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_assignSeller);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_assignSeller,"分配客户失败",response.body().asString()));
......@@ -280,21 +280,16 @@ public class Work implements Authorization {
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()));
params.put("custId", collectCustId);
response = network.postResponse(params,BasicConfig.WORK_star);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_star,"标记星标客户失败",response.body().asString()));
}
@Test(description = "查询星标客户更新",priority = 21)
public void 查询星标客户更新(){
sleep(1000);
sleep(2000);
Response response = network.getResponse(BasicConfig.WORK_staticHeader);
int unContactNum = response.jsonPath().getInt("data.unContactNum");
int starNum = response.jsonPath().getInt("data.starNum");
Assert.assertEquals(unContactNum,header.get("unContactNum")-1,network.message(BasicConfig.WORK_staticHeader,"需要联系客户数量未减1",response.body().asString()));
Assert.assertEquals(starNum, header.get("starNum")+2,network.message(BasicConfig.WORK_staticHeader,"星标客户数量未加2",response.body().asString()));
Assert.assertEquals(starNum, header.get("starNum")+1,network.message(BasicConfig.WORK_staticHeader,"星标客户数量未加2",response.body().asString()));
}
@Test(description = "取消星标用户",priority = 22)
......@@ -305,13 +300,14 @@ public class Work implements Authorization {
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_star,"取消客户星标失败",response.body().asString()));
sleep(1000);
sleep(2000);
response = network.getResponse(BasicConfig.WORK_staticHeader);
int unContactNum = response.jsonPath().getInt("data.unContactNum");
int starNum = response.jsonPath().getInt("data.starNum");
int num= header.get("unContactNum");
Assert.assertEquals(starNum, header.get("starNum")+1,network.message(BasicConfig.WORK_staticHeader,"星标客户数量未减1",response.body().asString()));
Assert.assertEquals(unContactNum, num,network.message(BasicConfig.WORK_staticHeader,"需要联系客户数量未加1",response.body().asString()));
int num1= header.get("unContactNum");
int num2= header.get("starNum");
Assert.assertEquals(starNum, num2,network.message(BasicConfig.WORK_staticHeader,"星标客户数量未减1",response.body().asString()));
Assert.assertEquals(unContactNum, num1,network.message(BasicConfig.WORK_staticHeader,"需要联系客户数量未加1",response.body().asString()));
}
@Test(description = "修改客户价值",priority = 23)
......@@ -437,7 +433,7 @@ public class Work implements Authorization {
@Test(description = "客户状态见面为待计划",priority = 31)
public void 客户状态见面为待计划(){
sleep(1000);
sleep(2000);
Response response = network.getResponse(BasicConfig.WORK_staticHeader);
int unContactNum = response.jsonPath().getInt("data.unContactNum");
int unMeetNum = response.jsonPath().getInt("data.unMeetNum");
......@@ -598,7 +594,7 @@ public class Work implements Authorization {
@Test(description = "公域引流_关闭销售呼叫权限",priority = 42)
public void 公域引流_关闭销售呼叫权限(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", 23);
params.put("id", 35);
params.put("callPermission", 0);
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_switchCallPermissio);
boolean data = response.jsonPath().getBoolean("data");
......@@ -614,7 +610,7 @@ public class Work implements Authorization {
Assert.assertFalse(success,network.message(params,BasicConfig.WORK_call,"关闭呼叫权限后呼叫成功",response.body().asString()));
params.clear();
params.put("id", 23);
params.put("id", 35);
params.put("callPermission", 1);
response = network.postResponse(params,BasicConfig.MANAGER_oto_switchCallPermissio);
boolean data = response.jsonPath().getBoolean("data");
......@@ -624,7 +620,7 @@ public class Work implements Authorization {
@Test(description = "公域引流_禁用销售账号",priority = 44)
public void 公域引流_禁用销售账号(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", 23);
params.put("id", 35);
params.put("sellerStatus", 0);
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_switchSellerStatus);
boolean data = response.jsonPath().getBoolean("data");
......@@ -642,7 +638,7 @@ public class Work implements Authorization {
Assert.assertFalse(success,network.message(params,BasicConfig.WORK_customerList,"关闭销售权限后访问成功",response.body().asString()));
params.clear();
params.put("id", 23);
params.put("id", 35);
params.put("sellerStatus", 1);
response = network.postResponse(params,BasicConfig.MANAGER_oto_switchSellerStatus);
boolean data = response.jsonPath().getBoolean("data");
......
......@@ -25,8 +25,10 @@ public class BaseUtils {
public static String companyCookieValue;
public static String officeCookieKey;
public static String officeCookieValue;
public static String otoCookieKey;
public static String otoCookieValue;
public static String otoSellerCookieKey;
public static String otoSellerCookieValue;
public static String otoLeaderCookieKey;
public static String otoLeaderCookieValue;
/**
......@@ -392,20 +394,20 @@ public class BaseUtils {
}
/**
* 销售员登录销售工作台
* 普通销售员登录销售工作台
*/
public static void otoSellerLogin(){
ThreadSleepUtils.sleep(2000);
// 调用登录接口
Map<String, Object> params = new HashMap<String, Object>();
params.put("phoneNumber","15136361301");
params.put("phoneNumber","18852895892");
Response response = network.getResponse(params,BasicConfig.WORK_getCaptcha);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_getCaptcha,"获取验证码失败",response.body().asString()));
//专用于自动化获取验证码
params.clear();
params.put("phoneNumber","15136361301");
params.put("phoneNumber","18852895892");
Response autoTestRes = network.getResponse(params,BasicConfig.WORK_verifyCodet);
String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha);
......@@ -413,7 +415,7 @@ public class BaseUtils {
//登录接口
ThreadSleepUtils.sleep(2000);
params.clear();
params.put("phoneNumber","15136361301");
params.put("phoneNumber","18852895892");
params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.WORK_login);
boolean success = loginRes.jsonPath().getBoolean("success");
......@@ -423,13 +425,53 @@ public class BaseUtils {
String header = loginRes.getHeader("Set-Cookie");
String cookieStr = header.split(";")[0];
String[] cookieKeyValue = cookieStr.split("=");
otoCookieKey = cookieKeyValue[0];
otoCookieValue = cookieKeyValue[1];
otoSellerCookieKey = cookieKeyValue[0];
otoSellerCookieValue = cookieKeyValue[1];
// otoCookieKey = "otoToken";
// otoCookieValue = "64e83LYGbaXYX9EkHumCho2Um1GgEB1fbKaZdh8QYa2vxD8xezqsMmAyVvbChD8h3z3q8Gm3UAwoBaXcXRnhmhtg9s4szxELntHRrdut4W9";
network.agentCookies.put(otoCookieKey,otoCookieValue); //存入cookies
System.out.println("销售Cookie中key:"+otoCookieKey+" ,values:"+otoCookieValue);
// otoSellerCookieKey = "otoToken";
// otoSellerCookieValue = "64e83LYGbaXYX9EkHumCho2Um1Gg9q8bFzwARTRumNzN6Rhk6daEZTsjNPH2GeKiTAnfV1uzt6EdwxQw2bkStkifNAc5B5yPWNzS4kEQBCP";
network.agentCookies.put(otoSellerCookieKey, otoSellerCookieValue); //存入cookies
System.out.println("销售Cookie中key:"+ otoSellerCookieKey +" ,values:"+ otoSellerCookieValue);
}
/**
* 总监登录销售工作台
*/
public static void otoLeaderLogin(){
ThreadSleepUtils.sleep(2000);
// 调用登录接口
Map<String, Object> params = new HashMap<String, Object>();
params.put("phoneNumber","13600546247");
Response response = network.getResponse(params,BasicConfig.WORK_getCaptcha);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.WORK_getCaptcha,"获取验证码失败",response.body().asString()));
//专用于自动化获取验证码
params.clear();
params.put("phoneNumber","13600546247");
Response autoTestRes = network.getResponse(params,BasicConfig.WORK_verifyCodet);
String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha);
//登录接口
ThreadSleepUtils.sleep(2000);
params.clear();
params.put("phoneNumber","13600546247");
params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.WORK_login);
boolean success = loginRes.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params,BasicConfig.WORK_login,"登录失败",loginRes.body().asString()));
//获取cookie
String header = loginRes.getHeader("Set-Cookie");
String cookieStr = header.split(";")[0];
String[] cookieKeyValue = cookieStr.split("=");
otoLeaderCookieKey = cookieKeyValue[0];
otoLeaderCookieValue = cookieKeyValue[1];
network.agentCookies.put(otoLeaderCookieKey, otoLeaderCookieValue); //存入cookies
System.out.println("销售Cookie中key:"+ otoLeaderCookieKey +" ,values:"+ otoLeaderCookieValue);
}
}
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