Commit 21e11411 authored by 郭姣's avatar 郭姣

企业后台登录、架构名单录入、管理后台驾驶舱接口编写

parent 424ab629
This diff is collapsed.
......@@ -96,7 +96,7 @@ public class BasicConfig {
public static final String MANAGER_HOST = "https://kjj-mng.duibatest.com.cn";
public static final String MOBILE_HOST = "https://live.duibatest.com.cn";
public static final String MOBILE_SPOKEHOST = "https://tt.duibatest.com.cn";
public static final String CORP_HOST = "https://kjj-corp.duibatest.com.cn";
// *************** 开启&结束直播 ***************
public static final String ANCHOR_OPEN = MOBILE_HOST + "/conf/live/open";
public static final String ANCHOR_getConfDetail = MOBILE_HOST + "/conf/pre/getConfDetail";
......@@ -1182,20 +1182,27 @@ public class BasicConfig {
public static final String MANAGER_qa_pageList = MANAGER_HOST + "/kjy/manager/qa/pageList";
public static final String MANAGER_qa_del = MANAGER_HOST + "/kjy/manager/qa/del";
// 企业后台
public static final String MANAGER_corp_saveCorp = MANAGER_HOST + "/kjy/manager/corp/company/saveOrUpdate";
public static final String MANAGER_corp_CorpLists = MANAGER_HOST + "/kjy/manager/corp/company/selectList";
public static final String MANAGER_corp_searchCorp = MANAGER_HOST + "/kjy/manager/corp/company/search";
public static final String MANAGER_corp_saveAuth = MANAGER_HOST + "/kjy/manager/corp/company/auth/saveOrUpdate";
public static final String MANAGER_corp_authLists = MANAGER_HOST + "/kjy/manager/corp/company/auth/selectList";
public static final String MANAGER_corp_deleteAuthById = MANAGER_HOST + "/kjy/manager/corp/company/auth/deleteById";
public static final String MANAGER_corp_savePage = MANAGER_HOST + "/kjy/manager/corp/company/page/saveOrUpdate";
public static final String MANAGER_corp_pageLists = MANAGER_HOST + "/kjy/manager/corp/company/page/selectList";
public static final String MANAGER_corp_saveStaff = MANAGER_HOST + "/kjy/manager/corp/company/staff/saveOrUpdate";
public static final String MANAGER_corp_staffList = MANAGER_HOST + "/kjy/manager/corp/company/staff/selectList";
public static final String MANAGER_corp_phoneExist = MANAGER_HOST + "/kjy/manager/corp/company/staff/phoneExist";
public static final String MANAGER_corp_changePageState = MANAGER_HOST + "/kjy/manager/corp/company/page/changeState";
public static final String MANAGER_corp_delPageById = MANAGER_HOST + "/kjy/manager/corp/company/page/deleteById";
public static final String MANAGER_corp_changeStaffState = MANAGER_HOST + "/kjy/manager/corp/company/staff/changeState";
public static final String MANAGER_corp_delStaff = MANAGER_HOST + "/kjy/manager/corp/company/staff/deleteById";
// 管理后台—企业后台
public static final String MANAGER_cockpitSaveOrUpdate = MANAGER_HOST +"/kjy/manager/corp/cockpit/saveOrUpdate";
public static final String MANAGER_cockpitList = MANAGER_HOST +"/kjy/manager/corp/cockpit/list";
public static final String MANAGER_cockpitSwitchStatus = MANAGER_HOST + "/kjy/manager/corp/cockpit/switchStatus";
public static final String MANAGER_cockpitDelete = MANAGER_HOST +"/kjy/manager/corp/cockpit/delete";
//企业后台
public static final String CORP_pageList = CORP_HOST +"/kjy/corp/page/list";
public static final String CORP_batchImport = CORP_HOST +"/kjy/corp/employee/batch/import";
public static final String CORP_importResult = CORP_HOST + "/kjy/corp/import/result";
public static final String CORP_recordList = CORP_HOST + "/kjy/corp/import/record/list";
public static final String CORP_getCaptcha = CORP_HOST + "/kjy/corp/getCaptcha";
public static final String CORP_getCaptchaForAutoTest = CORP_HOST + "/kjy/corp/getCaptchaForAutoTest";
public static final String CORP_login = CORP_HOST +"/kjy/corp/login";
public static final String CORP_switchover = CORP_HOST + "/kjy/corp/company/switchover";
public static final String CORP_listSimple = CORP_HOST + "/kjy/corp/company/list/simple";
public static final String CORP_simpleList = CORP_HOST + "/kjy/corp/dept/simple/list";
public static final String CORP_employeeStat = CORP_HOST + "/kjy/corp/employee/stat";
public static final String CORP_employeeList = CORP_HOST + "/kjy/corp/employee/list";
public static final String CORP_deptEdit = CORP_HOST + "/kjy/corp/dept/edit";
public static final String CORP_employeeSaveOrUpdate = CORP_HOST + "/kjy/corp/employee/saveOrUpdate";
public static final String CORP_employeeDel = CORP_HOST +"/kjy/corp/employee/del";
public static final String CORP_deptDel = CORP_HOST +"/kjy/corp/dept/del";
}
......@@ -195,4 +195,143 @@ public class BaseUtils {
Assert.assertNotNull(data,network.message(myCountParam, BasicConfig.USER_myCount, "抽奖码数量错误", myCountRes.body().asString()));
}
}
/**
* 超管登录企业后台
*/
public static void superUserLogin(){
// 调用登录接口
Map<String, Object> params = new HashMap<String, Object>();
params.put("phone","15136361308");
Response response = network.getResponse(params,BasicConfig.CORP_getCaptcha);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.CORP_getCaptcha,"获取验证码失败",response.body().asString()));
//专用于自动化获取验证码
params.clear();
params.put("phone","15136361308");
Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest);
long captcha = autoTestRes.jsonPath().getLong("data");
System.out.println(captcha);
//登录接口
ThreadSleepUtils.sleep(1000);
params.clear();
params.put("phone","15136361308");
params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.CORP_login);
boolean success = loginRes.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params,BasicConfig.CORP_login,"登录失败",loginRes.body().asString()));
//获取cookie
String header = loginRes.getHeader("Set-Cookie");
String cookieStr = header.split(";")[0];
String[] cookieKeyValue = cookieStr.split("=");
network.agentCookies.put(cookieKeyValue[0],cookieKeyValue[1]); //存入cookies
//选择接口 CORP_switchover
params.clear();
Response switchRes = network.postResponse(params,BasicConfig.CORP_switchover+"?companyId=Kj20MjE1");
boolean switchData = switchRes.jsonPath().getBoolean("data");
Assert.assertTrue(switchData, network.message(params,BasicConfig.CORP_switchover,"选择公司失败",switchRes.body().asString()));
//重复获取一次cookie,覆盖现有cookie
header = switchRes.getHeader("Set-Cookie");
cookieStr = header.split(";")[0];
cookieKeyValue= cookieStr.split("=");
network.agentCookies.put(cookieKeyValue[0],cookieKeyValue[1]); //存入cookies
network.agentCookies.put("companyId","Kj20MjE1");
}
/**
* 公司管理员登录企业后台
*/
public static void companyUserLogin(){
// 调用登录接口
Map<String, Object> params = new HashMap<String, Object>();
params.put("phone","15136361307");
Response response = network.getResponse(params,BasicConfig.CORP_getCaptcha);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.CORP_getCaptcha,"获取验证码失败",response.body().asString()));
//专用于自动化获取验证码
params.clear();
params.put("phone","15136361307");
Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest);
long captcha = autoTestRes.jsonPath().getLong("data");
System.out.println(captcha);
//登录接口
ThreadSleepUtils.sleep(1000);
params.clear();
params.put("phone","15136361307");
params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.CORP_login);
boolean success = loginRes.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params,BasicConfig.CORP_login,"登录失败",loginRes.body().asString()));
//获取cookie
String header = loginRes.getHeader("Set-Cookie");
String cookieStr = header.split(";")[0];
String[] cookieKeyValue = cookieStr.split("=");
network.agentCookies.put(cookieKeyValue[0],cookieKeyValue[1]); //存入cookies
//选择接口 CORP_switchover
params.clear();
Response switchRes = network.postResponse(params,BasicConfig.CORP_switchover+"?companyId=Kj20MjE1");
boolean switchData = switchRes.jsonPath().getBoolean("data");
Assert.assertTrue(switchData, network.message(params,BasicConfig.CORP_switchover,"选择公司失败",switchRes.body().asString()));
//重复获取一次cookie,覆盖现有cookie
header = switchRes.getHeader("Set-Cookie");
cookieStr = header.split(";")[0];
cookieKeyValue= cookieStr.split("=");
network.agentCookies.put(cookieKeyValue[0],cookieKeyValue[1]); //存入cookies
//put company Id
network.agentCookies.put("companyId","Kj20MjE1");
}
/**
* 营业部管理员登录企业后台
*/
public static void officeUserLogin(){
// 调用登录接口
Map<String, Object> params = new HashMap<String, Object>();
params.put("phone","15136361306");
Response response = network.getResponse(params,BasicConfig.CORP_getCaptcha);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.CORP_getCaptcha,"获取验证码失败",response.body().asString()));
//专用于自动化获取验证码
params.clear();
params.put("phone","15136361306");
Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest);
long captcha = autoTestRes.jsonPath().getLong("data");
System.out.println(captcha);
//登录接口
ThreadSleepUtils.sleep(1000);
params.clear();
params.put("phone","15136361306");
params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.CORP_login);
boolean success = loginRes.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params,BasicConfig.CORP_login,"登录失败",loginRes.body().asString()));
//获取cookie
String header = loginRes.getHeader("Set-Cookie");
String cookieStr = header.split(";")[0];
String[] cookieKeyValue = cookieStr.split("=");
network.agentCookies.put(cookieKeyValue[0],cookieKeyValue[1]); //存入cookies
//选择接口 CORP_switchover
params.clear();
Response switchRes = network.postResponse(params,BasicConfig.CORP_switchover+"?companyId=Kj20MjE1");
boolean switchData = switchRes.jsonPath().getBoolean("data");
Assert.assertTrue(switchData, network.message(params,BasicConfig.CORP_switchover,"选择公司失败",switchRes.body().asString()));
//重复获取一次cookie,覆盖现有cookie
header = switchRes.getHeader("Set-Cookie");
cookieStr = header.split(";")[0];
cookieKeyValue= cookieStr.split("=");
network.agentCookies.put(cookieKeyValue[0],cookieKeyValue[1]); //存入cookies
//put company Id
network.agentCookies.put("companyId","Kj20MjE1");
}
}
......@@ -78,12 +78,7 @@
</test>
<test preserve-order="true" name = "邀请函和趣味测评">
<classes>
<class name="com.kjj.cases.assistant.markettools.InvitationLetter"/>
</classes>
</test>
<test preserve-order="true" name = "使用攻略和设置中心">
<classes>
<class name="com.kjj.cases.assistant.menu.PersonalCenter"/>
<class name="com.kjj.cases.assistant.enterprise.Enterprise"/>
</classes>
</test>
</suite>
......
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