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

替换自动化角色手机号

parent 191b78a0
......@@ -43,7 +43,7 @@ public class Enterprise implements Authorization {
Response comListRes = network.getResponse(BasicConfig.CORP_listSimple);
Object dataRes = comListRes.jsonPath().getJsonObject("data.size()");
Object data = comListRes.jsonPath().getJsonObject("data");
Assert.assertEquals(dataRes,2, network.message(BasicConfig.CORP_listSimple,"获取公司列表个数错误",comListRes.body().asString()));
Assert.assertEquals(dataRes,1, network.message(BasicConfig.CORP_listSimple,"获取公司列表个数错误",comListRes.body().asString()));
System.out.println(data);
}
......
......@@ -8,13 +8,14 @@ import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.util.HashMap;
import static com.kjj.config.BasicConfig.LEADER_ID;
import static com.kjj.utils.BaseUtils.ssoLogin;
import static com.kjj.utils.ThreadSleepUtils.sleep;
public class Manager {
private static final NetworkUtils network = NetworkUtils.getInstance();
private int sellerId;
private int sellerId; //销售ID
@BeforeTest
public void setUp(){
ssoLogin();
......@@ -29,7 +30,7 @@ public class Manager {
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.MANAGER_oto_sellerList,"销售列表为空",response.body().asString()));
int workStatus = response.jsonPath().getInt("data.list.find{it.id == "+ 40+"}.workStatus");
int workStatus = response.jsonPath().getInt("data.list.find{it.id == "+ 42+"}.workStatus");
Assert.assertEquals(workStatus,1,network.message(params,BasicConfig.MANAGER_oto_searchSeller,"工作状态错误",response.body().asString()));
}
......@@ -49,7 +50,7 @@ public class Manager {
HashMap<String,Object> params = new HashMap<>();
params.put("id", sellerId);
params.put("sellerName", "勿动-自动化更新销售");
params.put("phoneNumber", "18852895892");
params.put("phoneNumber", "18248405155");
params.put("roleType", 1);
params.put("callPermission", 0);
params.put("sellerStatus", 0);
......@@ -65,7 +66,7 @@ public class Manager {
sleep(1000);
HashMap<String,Object> selectParam = new HashMap<>();
selectParam.put("sellerName", "勿动-自动化更新销售");
selectParam.put("phoneNumber", "18852895892");
selectParam.put("phoneNumber", "18248405155");
selectParam.put("pageIndex", "1");
selectParam.put("pageSize", "10");
response = network.getResponse(selectParam, BasicConfig.MANAGER_oto_sellerList);
......@@ -77,7 +78,7 @@ public class Manager {
params.put("sellerStatus", 1);
params.put("companyId", 5);
params.put("sellerLevel", 1);
params.put("parentId", 36);
params.put("parentId", LEADER_ID);
params.put("sellerName", "勿动-自动化测试销售");
response = network.postResponse(params, BasicConfig.MANAGER_oto_updateSeller);
data = response.jsonPath().getBoolean("data");
......@@ -94,8 +95,8 @@ public class Manager {
@Test(description = "不可新增同一手机号销售",priority = 5)
public void 不可新增同一手机号销售(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerName", "勿动-自动化更新销售");
params.put("phoneNumber", "18852895892");
params.put("sellerName", "勿动-自动化销售");
params.put("phoneNumber", "18248405155");
params.put("roleType", 1);
params.put("callPermission", 1);
params.put("sellerStatus", 1);
......@@ -109,7 +110,7 @@ public class Manager {
@Test(description = "不可修改总监为普通",priority = 6)
public void 不可修改总监为普通(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", 40);
params.put("id", LEADER_ID);
params.put("sellerName", "勿动-自动化测试销售");
params.put("phoneNumber", "18852895892");
params.put("roleType", 3);
......@@ -176,7 +177,7 @@ public class Manager {
@Test(description = "修改工作状态为请假中",priority = 12)
public void 修改工作状态为请假中(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", 36);
params.put("sellerId", LEADER_ID);
params.put("workStatus", 0);
Response response = network.postResponse(params, BasicConfig.MANAGER_oto_switchWorkStatus);
boolean data = response.jsonPath().getBoolean("data");
......
......@@ -14,6 +14,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import static com.kjj.config.BasicConfig.SELLER_ID;
import static com.kjj.utils.BaseUtils.*;
import static com.kjj.utils.ThreadSleepUtils.sleep;
......@@ -126,7 +127,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", 40);
params.put("sellerId", SELLER_ID);
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()));
......@@ -147,8 +148,8 @@ public class Work implements Authorization {
Assert.assertEquals(size,1,network.message(BasicConfig.WORK_notifyList,"通知栏不为空",response.body().asString()));
int notifyType = response.jsonPath().getInt("data[0].notifyType");
int custCount = response.jsonPath().getInt("data[0].custCount");
Assert.assertEquals(custCount,1,network.message(BasicConfig.WORK_notifyList,"通知栏不为空",response.body().asString()));
Assert.assertEquals(notifyType,2,network.message(BasicConfig.WORK_notifyList,"通知栏不为空",response.body().asString()));
Assert.assertEquals(custCount,1,network.message(BasicConfig.WORK_notifyList,"客户数量错误",response.body().asString()));
Assert.assertEquals(notifyType,2,network.message(BasicConfig.WORK_notifyList,"通知栏类型错误",response.body().asString()));
}
@Test(description = "客户状态分类_数量总览",priority = 9)
......@@ -596,7 +597,7 @@ public class Work implements Authorization {
@Test(description = "公域引流_关闭销售呼叫权限",priority = 42)
public void 公域引流_关闭销售呼叫权限(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", 40);
params.put("id", SELLER_ID);
params.put("callPermission", 0);
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_switchCallPermissio);
boolean data = response.jsonPath().getBoolean("data");
......@@ -612,7 +613,7 @@ public class Work implements Authorization {
Assert.assertFalse(success,network.message(params,BasicConfig.WORK_call,"关闭呼叫权限后呼叫成功",response.body().asString()));
params.clear();
params.put("id", 40);
params.put("id", SELLER_ID);
params.put("callPermission", 1);
response = network.postResponse(params,BasicConfig.MANAGER_oto_switchCallPermissio);
boolean data = response.jsonPath().getBoolean("data");
......@@ -622,7 +623,7 @@ public class Work implements Authorization {
@Test(description = "公域引流_禁用销售账号",priority = 44)
public void 公域引流_禁用销售账号(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", 40);
params.put("id", SELLER_ID);
params.put("sellerStatus", 0);
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_switchSellerStatus);
boolean data = response.jsonPath().getBoolean("data");
......@@ -640,7 +641,7 @@ public class Work implements Authorization {
Assert.assertFalse(success,network.message(params,BasicConfig.WORK_customerList,"关闭销售权限后访问成功",response.body().asString()));
params.clear();
params.put("id", 40);
params.put("id", SELLER_ID);
params.put("sellerStatus", 1);
response = network.postResponse(params,BasicConfig.MANAGER_oto_switchSellerStatus);
boolean data = response.jsonPath().getBoolean("data");
......@@ -754,7 +755,7 @@ public class Work implements Authorization {
@Test(description = "总监修改名下销售工作状态",priority = 56)
public void 总监修改名下销售工作状态(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", 40);
params.put("sellerId", SELLER_ID);
params.put("workStatus", 0);
Response response = network.postResponse(params, BasicConfig.WORK_switchWorkStatus);
boolean data = response.jsonPath().getBoolean("data");
......
......@@ -7,6 +7,11 @@ public class BasicConfig {
public static final String WECHAT_NAME = "吉吉";
public static final String TKU_COOKIE_NAME = "tku";
// 销售工作台销售ID
public static final int SELLER_ID = 42;
// 销售工作台总监ID
public static final int LEADER_ID = 43;
/**
* 直播账号授权key
*/
......
......@@ -248,14 +248,14 @@ public class BaseUtils {
public static void superUserLogin(){
// 调用登录接口
Map<String, Object> params = new HashMap<String, Object>();
params.put("phone","15136361301");
params.put("phone","18248405155");
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","15136361301");
params.put("phone","18248405155");
Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest);
String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha);
......@@ -263,7 +263,7 @@ public class BaseUtils {
//登录接口
ThreadSleepUtils.sleep(2000);
params.clear();
params.put("phone","15136361301");
params.put("phone","18248405155");
params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.CORP_login);
boolean success = loginRes.jsonPath().getBoolean("success");
......@@ -298,14 +298,14 @@ public class BaseUtils {
ThreadSleepUtils.sleep(2000);
// 调用登录接口
Map<String, Object> params = new HashMap<String, Object>();
params.put("phone","13758231257");
params.put("phone","13454131091");
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","13758231257");
params.put("phone","13454131091");
Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest);
String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha);
......@@ -313,7 +313,7 @@ public class BaseUtils {
//登录接口
ThreadSleepUtils.sleep(2000);
params.clear();
params.put("phone","13758231257");
params.put("phone","13454131091");
params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.CORP_login);
boolean success = loginRes.jsonPath().getBoolean("success");
......@@ -349,14 +349,14 @@ public class BaseUtils {
ThreadSleepUtils.sleep(2000);
// 调用登录接口
Map<String, Object> params = new HashMap<String, Object>();
params.put("phone","13600546247");
params.put("phone","18248405149");
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","13600546247");
params.put("phone","18248405149");
Response autoTestRes = network.getResponse(params,BasicConfig.CORP_getCaptchaForAutoTest);
String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha);
......@@ -364,7 +364,7 @@ public class BaseUtils {
//登录接口
ThreadSleepUtils.sleep(2000);
params.clear();
params.put("phone","13600546247");
params.put("phone","18248405149");
params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.CORP_login);
boolean success = loginRes.jsonPath().getBoolean("success");
......@@ -400,14 +400,14 @@ public class BaseUtils {
ThreadSleepUtils.sleep(2000);
// 调用登录接口
Map<String, Object> params = new HashMap<String, Object>();
params.put("phoneNumber","18852895892");
params.put("phoneNumber","18248405155");
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","18852895892");
params.put("phoneNumber","18248405155");
Response autoTestRes = network.getResponse(params,BasicConfig.WORK_verifyCodet);
String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha);
......@@ -415,7 +415,7 @@ public class BaseUtils {
//登录接口
ThreadSleepUtils.sleep(2000);
params.clear();
params.put("phoneNumber","18852895892");
params.put("phoneNumber","18248405155");
params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.WORK_login);
boolean success = loginRes.jsonPath().getBoolean("success");
......@@ -429,7 +429,7 @@ public class BaseUtils {
otoSellerCookieValue = cookieKeyValue[1];
// otoSellerCookieKey = "otoToken";
// otoSellerCookieValue = "64e83LYGbaXYX9EkHumCho2Um1GyikzWhYrmAfaxDJLTKWo3R3ftLtTdVx1ZCaihHqi9qG45dqQ8CdEya9eWEXSiEW9LjCXQoFeJWJvNcVQ";
// otoSellerCookieValue = "64e83LYGbaXYX9EkHumCho2Um1H6zBcWkw5JtD5N2YjRB7RFmU6uG7ziBmmBWwsRz2uLkFruaQMtPTc4XJVhTmCWQmdZCYvYzyru4GEVxxw";
network.agentCookies.put(otoSellerCookieKey, otoSellerCookieValue); //存入cookies
System.out.println("销售Cookie中key:"+ otoSellerCookieKey +" ,values:"+ otoSellerCookieValue);
......@@ -442,14 +442,14 @@ public class BaseUtils {
ThreadSleepUtils.sleep(2000);
// 调用登录接口
Map<String, Object> params = new HashMap<String, Object>();
params.put("phoneNumber","13600546247");
params.put("phoneNumber","13454131091");
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");
params.put("phoneNumber","13454131091");
Response autoTestRes = network.getResponse(params,BasicConfig.WORK_verifyCodet);
String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha);
......@@ -457,7 +457,7 @@ public class BaseUtils {
//登录接口
ThreadSleepUtils.sleep(2000);
params.clear();
params.put("phoneNumber","13600546247");
params.put("phoneNumber","13454131091");
params.put("captcha",captcha);
Response loginRes = network.postResponse(params,BasicConfig.WORK_login);
boolean success = loginRes.jsonPath().getBoolean("success");
......@@ -471,7 +471,7 @@ public class BaseUtils {
otoLeaderCookieValue = cookieKeyValue[1];
// otoLeaderCookieKey = "otoToken";
// otoLeaderCookieValue = "64e83LYGbaXYX9EkHumCho2Um1GyikzWh7fhCVMnZpMvdoMsVm4TxDVoLbzCHGf4BqHzR5nXdrjL6VeJLdpEPHJpVDDg2A3TRyCz7yhttRB";
// otoLeaderCookieValue = "64e83LYGbaXYX9EkHumCho2Um1H6zBcWhBxmWqfu76gC91GAkfnauguistbDFNVTyYSWjjEpQURiMofMzYTYYbBWC2BA95ZJBjKDaspWvRE";
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