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

1.更换企业后台的自动化管理员的手机号

2.增加公域引流中的接口自动化
parent 16148d6f
This diff is collapsed.
...@@ -1289,6 +1289,7 @@ public class BasicConfig { ...@@ -1289,6 +1289,7 @@ public class BasicConfig {
public static final String MANAGER_oto_saveTag = MANAGER_HOST + "/kjy/manager/oto/tag/save"; public static final String MANAGER_oto_saveTag = MANAGER_HOST + "/kjy/manager/oto/tag/save";
public static final String MANAGER_oto_updateTag = MANAGER_HOST + "/kjy/manager/oto/tag/update"; public static final String MANAGER_oto_updateTag = MANAGER_HOST + "/kjy/manager/oto/tag/update";
public static final String MANAGER_oto_tagList = MANAGER_HOST + "/kjy/manager/oto/tag/list"; 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 WORK_getCaptcha = WORK_HOST + "/kjy/oto/manager/auth/captcha"; 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"; public static final String WORK_login = WORK_HOST + "/kjy/oto/manager/auth/login";
public static final String WORK_userInfo = WORK_HOST + "/kjy/oto/manager/auth/userInfo"; public static final String WORK_userInfo = WORK_HOST + "/kjy/oto/manager/auth/userInfo";
...@@ -1298,4 +1299,22 @@ public class BasicConfig { ...@@ -1298,4 +1299,22 @@ public class BasicConfig {
public static final String WORK_notifyList = WORK_HOST + "/kjy/oto/manager/customer/notify/list"; public static final String WORK_notifyList = WORK_HOST + "/kjy/oto/manager/customer/notify/list";
public static final String MANAGER_oto_customerList = MANAGER_HOST +"/kjy/manager/pub/form/customer/list/v2"; 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_assignSeller = MANAGER_HOST +"/kjy/manager/pub/form/customer/assignSeller";
public static final String WORK_tagList = WORK_HOST + "/kjy/oto/manager/tag/list";
public static final String WORK_customerList = WORK_HOST + "/kjy/oto/manager/customer/list";
public static final String WORK_phone = WORK_HOST + "/kjy/oto/manager/customer/phoneNum";
public static final String WORK_info = WORK_HOST + "kjy/oto/manager/customer/visit/info";
public static final String WORK_header = WORK_HOST + "/kjy/oto/manager/customer/header";
public static final String WORK_detail = WORK_HOST + "/kjy/oto/manager/customer/detail";
public static final String WORK_showFeedback = WORK_HOST + "/kjy/oto/manager/customer/call/showFeedback";
public static final String WORK_regionCity = WORK_HOST + "/kjy/oto/manager/customer/regionCity";
public static final String WORK_callLog = WORK_HOST + "/kjy/oto/manager/customer/log/call";
public static final String WORK_meet = WORK_HOST + "/kjy/oto/manager/customer/meet";
public static final String WORK_star = WORK_HOST + "/kjy/oto/manager/customer/star";
public static final String WORK_assess = WORK_HOST + "/kjy/oto/manager/customer/assess";
public static final String WORK_weight = WORK_HOST + "/kjy/oto/manager/customer/follow/weight";
public static final String WORK_tag = WORK_HOST + "/kjy/oto/manager/customer/tag";
public static final String WORK_order = WORK_HOST + "/kjy/oto/manager/customer/order";
public static final String WORK_feedback = WORK_HOST + "/kjy/oto/manager/customer/feedback";
public static final String WORK_edit = WORK_HOST + "/kjy/oto/manager/customer/edit";
public static final String WORK_operation = WORK_HOST + "/kjy/oto/manager/customer/log/operation";
} }
...@@ -25,6 +25,8 @@ public class BaseUtils { ...@@ -25,6 +25,8 @@ public class BaseUtils {
public static String companyCookieValue; public static String companyCookieValue;
public static String officeCookieKey; public static String officeCookieKey;
public static String officeCookieValue; public static String officeCookieValue;
public static String otoCookieKey;
public static String otoCookieValue;
/** /**
...@@ -244,14 +246,14 @@ public class BaseUtils { ...@@ -244,14 +246,14 @@ public class BaseUtils {
public static void superUserLogin(){ public static void superUserLogin(){
// 调用登录接口 // 调用登录接口
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
params.put("phone","15136361308"); params.put("phone","15136361301");
Response response = network.getResponse(params,BasicConfig.CORP_getCaptcha); Response response = network.getResponse(params,BasicConfig.CORP_getCaptcha);
boolean data = response.jsonPath().getBoolean("data"); boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.CORP_getCaptcha,"获取验证码失败",response.body().asString())); Assert.assertTrue(data,network.message(params,BasicConfig.CORP_getCaptcha,"获取验证码失败",response.body().asString()));
//专用于自动化获取验证码 //专用于自动化获取验证码
params.clear(); params.clear();
params.put("phone","15136361308"); params.put("phone","15136361301");
Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest); Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest);
String captcha = autoTestRes.jsonPath().getString("data"); String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha); System.out.println(captcha);
...@@ -259,7 +261,7 @@ public class BaseUtils { ...@@ -259,7 +261,7 @@ public class BaseUtils {
//登录接口 //登录接口
ThreadSleepUtils.sleep(2000); ThreadSleepUtils.sleep(2000);
params.clear(); params.clear();
params.put("phone","15136361308"); params.put("phone","15136361301");
params.put("captcha",captcha); params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.CORP_login); Response loginRes = network.postResponse(params,BasicConfig.CORP_login);
boolean success = loginRes.jsonPath().getBoolean("success"); boolean success = loginRes.jsonPath().getBoolean("success");
...@@ -284,6 +286,7 @@ public class BaseUtils { ...@@ -284,6 +286,7 @@ public class BaseUtils {
superCookieValue = cookieKeyValue[1]; superCookieValue = cookieKeyValue[1];
network.agentCookies.put(cookieKeyValue[0],cookieKeyValue[1]); //存入cookies network.agentCookies.put(cookieKeyValue[0],cookieKeyValue[1]); //存入cookies
network.agentCookies.put("companyId","Kj20MjE1"); network.agentCookies.put("companyId","Kj20MjE1");
System.out.println("超级管理员Cookie中key:"+superCookieKey+" ,values:"+superCookieValue);
} }
/** /**
...@@ -293,14 +296,14 @@ public class BaseUtils { ...@@ -293,14 +296,14 @@ public class BaseUtils {
ThreadSleepUtils.sleep(2000); ThreadSleepUtils.sleep(2000);
// 调用登录接口 // 调用登录接口
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
params.put("phone","15136361307"); params.put("phone","13758231257");
Response response = network.getResponse(params,BasicConfig.CORP_getCaptcha); Response response = network.getResponse(params,BasicConfig.CORP_getCaptcha);
boolean data = response.jsonPath().getBoolean("data"); boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.CORP_getCaptcha,"获取验证码失败",response.body().asString())); Assert.assertTrue(data,network.message(params,BasicConfig.CORP_getCaptcha,"获取验证码失败",response.body().asString()));
//专用于自动化获取验证码 //专用于自动化获取验证码
params.clear(); params.clear();
params.put("phone","15136361307"); params.put("phone","13758231257");
Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest); Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest);
String captcha = autoTestRes.jsonPath().getString("data"); String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha); System.out.println(captcha);
...@@ -308,7 +311,7 @@ public class BaseUtils { ...@@ -308,7 +311,7 @@ public class BaseUtils {
//登录接口 //登录接口
ThreadSleepUtils.sleep(2000); ThreadSleepUtils.sleep(2000);
params.clear(); params.clear();
params.put("phone","15136361307"); params.put("phone","13758231257");
params.put("captcha",captcha); params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.CORP_login); Response loginRes = network.postResponse(params,BasicConfig.CORP_login);
boolean success = loginRes.jsonPath().getBoolean("success"); boolean success = loginRes.jsonPath().getBoolean("success");
...@@ -334,6 +337,7 @@ public class BaseUtils { ...@@ -334,6 +337,7 @@ public class BaseUtils {
network.agentCookies.put(cookieKeyValue[0],cookieKeyValue[1]); //存入cookies network.agentCookies.put(cookieKeyValue[0],cookieKeyValue[1]); //存入cookies
//put company Id //put company Id
network.agentCookies.put("companyId","Kj20MjE1"); network.agentCookies.put("companyId","Kj20MjE1");
System.out.println("公司管理员Cookie中key:"+companyCookieKey+" ,values:"+companyCookieValue);
} }
/** /**
...@@ -343,14 +347,14 @@ public class BaseUtils { ...@@ -343,14 +347,14 @@ public class BaseUtils {
ThreadSleepUtils.sleep(2000); ThreadSleepUtils.sleep(2000);
// 调用登录接口 // 调用登录接口
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
params.put("phone","15136361306"); params.put("phone","13600546247");
Response response = network.getResponse(params,BasicConfig.CORP_getCaptcha); Response response = network.getResponse(params,BasicConfig.CORP_getCaptcha);
boolean data = response.jsonPath().getBoolean("data"); boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.CORP_getCaptcha,"获取验证码失败",response.body().asString())); Assert.assertTrue(data,network.message(params,BasicConfig.CORP_getCaptcha,"获取验证码失败",response.body().asString()));
//专用于自动化获取验证码 //专用于自动化获取验证码
params.clear(); params.clear();
params.put("phone","15136361306"); params.put("phone","13600546247");
Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest); Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest);
String captcha = autoTestRes.jsonPath().getString("data"); String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha); System.out.println(captcha);
...@@ -358,7 +362,7 @@ public class BaseUtils { ...@@ -358,7 +362,7 @@ public class BaseUtils {
//登录接口 //登录接口
ThreadSleepUtils.sleep(2000); ThreadSleepUtils.sleep(2000);
params.clear(); params.clear();
params.put("phone","15136361306"); params.put("phone","13600546247");
params.put("captcha",captcha); params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.CORP_login); Response loginRes = network.postResponse(params,BasicConfig.CORP_login);
boolean success = loginRes.jsonPath().getBoolean("success"); boolean success = loginRes.jsonPath().getBoolean("success");
...@@ -384,6 +388,7 @@ public class BaseUtils { ...@@ -384,6 +388,7 @@ public class BaseUtils {
network.agentCookies.put(officeCookieKey,officeCookieValue); //存入cookies network.agentCookies.put(officeCookieKey,officeCookieValue); //存入cookies
//put company Id //put company Id
network.agentCookies.put("companyId","Kj20MjE1"); network.agentCookies.put("companyId","Kj20MjE1");
System.out.println("营业部管理员Cookie中key:"+officeCookieKey+" ,values:"+officeCookieValue);
} }
/** /**
...@@ -400,7 +405,7 @@ public class BaseUtils { ...@@ -400,7 +405,7 @@ public class BaseUtils {
//专用于自动化获取验证码 //专用于自动化获取验证码
params.clear(); params.clear();
params.put("phone","15136361308"); params.put("phone","15136361301");
Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest); Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest);
String captcha = autoTestRes.jsonPath().getString("data"); String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha); System.out.println(captcha);
...@@ -408,7 +413,7 @@ public class BaseUtils { ...@@ -408,7 +413,7 @@ public class BaseUtils {
//登录接口 //登录接口
ThreadSleepUtils.sleep(2000); ThreadSleepUtils.sleep(2000);
params.clear(); params.clear();
params.put("phone","15136361308"); params.put("phone","15136361301");
params.put("captcha",captcha); params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.WORK_login); Response loginRes = network.postResponse(params,BasicConfig.WORK_login);
boolean success = loginRes.jsonPath().getBoolean("success"); boolean success = loginRes.jsonPath().getBoolean("success");
...@@ -418,8 +423,9 @@ public class BaseUtils { ...@@ -418,8 +423,9 @@ public class BaseUtils {
String header = loginRes.getHeader("Set-Cookie"); String header = loginRes.getHeader("Set-Cookie");
String cookieStr = header.split(";")[0]; String cookieStr = header.split(";")[0];
String[] cookieKeyValue = cookieStr.split("="); String[] cookieKeyValue = cookieStr.split("=");
officeCookieKey = cookieKeyValue[0]; otoCookieKey = cookieKeyValue[0];
officeCookieValue = cookieKeyValue[1]; otoCookieValue = cookieKeyValue[1];
network.agentCookies.put(officeCookieKey,officeCookieValue); //存入cookies network.agentCookies.put(otoCookieKey,otoCookieValue); //存入cookies
System.out.println("销售Cookie中key:"+otoCookieKey+" ,values:"+otoCookieValue);
} }
} }
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