Commit 4011d4fa authored by 龚小红's avatar 龚小红

增加权限管理的相关用例

parent 9a2d4c9e
......@@ -15,10 +15,9 @@
<class name="com.kjj.cases.live.liveConfig.SaveLive"/>
</classes>
</test>
<test preserve-order="true" name="配置秒杀轮次及秒杀预告">
<test preserve-order="true" name="配置代理人邀约奖励">
<classes>
<class name="com.kjj.cases.live.secondKill.ConfSecondKill"/>
<class name="com.kjj.cases.live.inviteReward.ManagerRewardConf"/>
</classes>
</test>
......@@ -28,21 +27,27 @@
</classes>
</test>
<test preserve-order="true" name="助播-开启直播">
<test preserve-order="true" name="代理人首页">
<classes>
<class name="com.kjj.cases.live.agent.Agent"/>
</classes>
</test>
<test preserve-order="true" name="小程序分享">
<classes>
<class name="com.kjj.cases.live.anchor.OpenLive"/>
<class name="com.kjj.cases.live.liveConfig.Share"/>
</classes>
</test>
<test preserve-order="true" name="秒杀到场">
<test preserve-order="true" name="获取抽奖码校验">
<classes>
<class name="com.kjj.cases.live.liveConfig.ConnectLive"/>
<class name="com.kjj.cases.live.lotteryCode.LotteryCode"/>
</classes>
</test>
<test preserve-order="true" name="秒杀互动">
<test preserve-order="true" name="亲友券">
<classes>
<class name="com.kjj.cases.live.secondKill.SecondKill"/>
<class name="com.kjj.cases.live.lottery.RelativeLottery"/>
</classes>
</test>
......
......@@ -31,7 +31,13 @@ public class Manager {
Assert.assertTrue(size>0,network.message(params,BasicConfig.MANAGER_oto_sellerList,"销售列表为空",response.body().asString()));
int workStatus = response.jsonPath().getInt("data.list.find{it.id == "+ 42+"}.workStatus");
int assignNewCustPermission = response.jsonPath().getInt("data.list.find{it.id == "+ 42+"}.assignNewCustPermission");
int assignRecycleCustPermission = response.jsonPath().getInt("data.list.find{it.id == "+ 42+"}.assignRecycleCustPermission");
int callPermission = response.jsonPath().getInt("data.list.find{it.id == "+ 42+"}.callPermission");
Assert.assertEquals(workStatus,1,network.message(params,BasicConfig.MANAGER_oto_searchSeller,"工作状态错误",response.body().asString()));
Assert.assertEquals(assignNewCustPermission,1,network.message(params,BasicConfig.MANAGER_oto_searchSeller,"工作状态错误",response.body().asString()));
Assert.assertEquals(assignRecycleCustPermission,1,network.message(params,BasicConfig.MANAGER_oto_searchSeller,"工作状态错误",response.body().asString()));
Assert.assertEquals(callPermission,1,network.message(params,BasicConfig.MANAGER_oto_searchSeller,"工作状态错误",response.body().asString()));
}
@Test(description = "通过销售名称查找销售",priority = 2)
......@@ -102,6 +108,9 @@ public class Manager {
params.put("sellerStatus", 1);
params.put("companyId", 1);
params.put("sellerLevel", 1);
params.put("workStatus", 1);
params.put("assignNewCustPermission", 1);
params.put("assignRecycleCustPermission", 1);
Response response = network.postResponse(params, BasicConfig.MANAGER_oto_saveSeller);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,BasicConfig.MANAGER_oto_saveSeller,"新增同一手机号销售成功",response.body().asString()));
......
package com.kjj.cases.otoseller;
import com.kjj.cases.admin.Authorization;
import com.kjj.utils.NetworkUtils;
import org.testng.annotations.BeforeTest;
import static com.kjj.utils.BaseUtils.ssoLogin;
//手机端
public class Phone implements Authorization {
private static final NetworkUtils network = NetworkUtils.getInstance();
private int sellerId; //销售ID
@BeforeTest
public void setUp(){
}
}
......@@ -14,8 +14,8 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import static com.kjj.config.BasicConfig.SELLER_ID;
import static com.kjj.config.BasicConfig.LEADER_ID;
import static com.kjj.config.BasicConfig.SELLER_ID;
import static com.kjj.utils.BaseUtils.*;
import static com.kjj.utils.ThreadSleepUtils.sleep;
......@@ -791,6 +791,71 @@ public class Work implements Authorization {
int logSize = logRes.jsonPath().getInt("data.list.size()");
Assert.assertTrue(logSize>0,network.message(BasicConfig.WORK_operation,"客户动态隔离失败",logRes.body().asString()));
}
@Test(description = "关闭总监的新客户认领权限和回收客户认领权限",priority = 59)
public void 关闭总监的新客户认领权限和回收客户认领权限(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", LEADER_ID);
params.put("sellerStatus", 1);
params.put("callPermission", 1);
params.put("workassignNewCustPermissionStatus", 0);
params.put("assignRecycleCustPermission", 0);
Response response = network.postResponse(params, BasicConfig.MANAGER_oto_updatePermission);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(BasicConfig.MANAGER_oto_updatePermission,"关闭总监的新客户认领权限和回收客户认领权限失败",response.body().asString()));
}
@Test(description = "无新客户认领权限不可查看新客户列表",priority = 60)
public void 无新客户认领权限不可查看新客户列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex", 1);
params.put("pageSize", 20);
Response response = network.getResponse(params,BasicConfig.WORK_freshList);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(BasicConfig.WORK_logout,"无新客户认领权限可查看新客户列表",response.body().asString()));
}
@Test(description = "无回收客户认领权限不可查看回收客户列表",priority = 61)
public void 无回收客户认领权限不可查看回收客户列表(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex", 1);
params.put("pageSize", 20);
Response response = network.getResponse(params,BasicConfig.WORK_recycleList);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(BasicConfig.WORK_logout,"无回收客户认领权限可查看回收客户列表",response.body().asString()));
}
@Test(description = "开启总监的新客户认领权限和回收客户认领权限",priority = 62)
public void 开启总监的新客户认领权限和回收客户认领权限(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", LEADER_ID);
params.put("sellerStatus", 1);
params.put("callPermission", 1);
params.put("workassignNewCustPermissionStatus", 1);
params.put("assignRecycleCustPermission", 1);
Response response = network.postResponse(params, BasicConfig.MANAGER_oto_updatePermission);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(BasicConfig.MANAGER_oto_updatePermission,"开启总监的新客户认领权限和回收客户认领权限失败",response.body().asString()));
}
@Test(description = "销售间客户动态取消隔离",priority = 63)
public void 销售间客户动态取消隔离(){
//将客户重新分配给总监
HashMap<String,Object> params = new HashMap<>();
params.put("customerId",custId);
params.put("sellerId",LEADER_ID);
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_assignSeller);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(BasicConfig.MANAGER_oto_assignSeller,"重新分配失败",response.body().asString()));
//总监查看客户动态
params.clear();
params.put("custId",custId);
params.put("logDays",1);
Response logRes = network.getResponse(params,BasicConfig.WORK_operation);
int logSize = logRes.jsonPath().getInt("data.list.size()");
Assert.assertTrue(logSize>0,network.message(BasicConfig.WORK_operation,"客户动态隔离失败",logRes.body().asString()));
}
@Test(description = "删除客户",priority = 79)
public void 删除客户(){
HashMap<String,Object> params = new HashMap<>();
......
......@@ -1324,9 +1324,9 @@ public class BasicConfig {
public static final String MANAGER_oto_customerPhone = MANAGER_HOST +"/kjy/manager/pub/form/customer/customerPhone";
public static final String MANAGER_oto_qaDetail = MANAGER_HOST +"/kjy/manager/pub/form/customer/qaDetail";
public static final String MANAGER_oto_channelList = MANAGER_HOST +"/kjy/manager/pub/form/channelList";
public static final String MANAGER_oto_updatePermission = MANAGER_HOST +"/kjy/manager/oto/seller/updatePermission";
public static final String MANAGER_oto_switchDimissionStatus = MANAGER_HOST +"/kjy/manager/oto/seller/switchDimissionStatus";
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_userInfo = WORK_HOST + "/kjy/oto/manager/auth/userInfo";
......@@ -1363,7 +1363,28 @@ public class BasicConfig {
public static final String WORK_attendanceList= WORK_HOST + "/kjy/oto/manager/attendance/list";
public static final String WORK_switchWorkStatus= WORK_HOST + "/kjy/oto/manager/attendance/switchWorkStatus";
public static final String WORK_verifyCodet = WORK_HOST + "/kjy/oto/auto/test/verifyCode";
public static final String PHONE_customerList = MOBILE_HOST + "kjy/oto/customer/list";
public static final String PHONE_customerSave = MOBILE_HOST + "kjy/oto/customer/introduce/save";
public static final String PHONE_appointmentDetail = MOBILE_HOST + "/kjy/oto/interview/appointment/detail";
public static final String PHONE_fuzzyList = MOBILE_HOST + "/kjy/oto/cust/fuzzy/list";
public static final String PHONE_interviewSave = MOBILE_HOST + "/kjy/oto/interview/save";
public static final String PHONE_interviewUpdate = MOBILE_HOST + "/kjy/oto/interview/appointment/update";
public static final String PHONE_interviewList = MOBILE_HOST + "/kjy/oto/interview/list";
public static final String PHONE_interviewCancel = MOBILE_HOST + "/kjy/oto/interview/cancel";
public static final String PHONE_interviewCode = MOBILE_HOST + "/kjy/oto/h5/interview/code";
public static final String PHONE_interviewStatus = MOBILE_HOST + "/kjy/oto/h5/interview/status";
public static final String PHONE_interviewPhone = MOBILE_HOST + "/kjy/oto/h5/interview/phone";
public static final String PHONE_interviewBind = MOBILE_HOST + "/kjy/oto/h5/interview/bind";
public static final String PHONE_bindCancel = MOBILE_HOST + "/kjy/oto/h5/interview/cancel";
public static final String PHONE_feedbackDetail = MOBILE_HOST + "/kjy/oto/interview/feedback/detail";
public static final String PHONE_custExtDetail = MOBILE_HOST + "/kjy/oto/interview/custExtDetail";
public static final String PHONE_interviewFeedback = MOBILE_HOST + "/kjy/oto/interview/feedback";
public static final String PHONE_interviewDetail = MOBILE_HOST + "/kjy/oto/interview/edit/detail";
public static final String PHONE_authPhone = MOBILE_HOST + "/auth/oto/authPhone";
public static final String PHONE_getAuthPhone = MOBILE_HOST + "/auth/oto/getAuthPhone";
public static final String PHONE_submitEvaluate = MOBILE_HOST + "/kjy/oto/interview/submitEvaluate";
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";
}
......@@ -408,7 +408,7 @@ public class BaseUtils {
//专用于自动化获取验证码
params.clear();
params.put("phoneNumber","18248405155");
Response autoTestRes = network.getResponse(params,BasicConfig.WORK_verifyCodet);
Response autoTestRes = network.getResponse(params,BasicConfig.WORK_verifyCode);
String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha);
......@@ -450,7 +450,7 @@ public class BaseUtils {
//专用于自动化获取验证码
params.clear();
params.put("phoneNumber","13454131091");
Response autoTestRes = network.getResponse(params,BasicConfig.WORK_verifyCodet);
Response autoTestRes = network.getResponse(params,BasicConfig.WORK_verifyCode);
String captcha = autoTestRes.jsonPath().getString("data");
System.out.println(captcha);
......
......@@ -32,9 +32,9 @@ public class JmeterAccountFile {
public static void otoCookieMaker() {
OtoTokenCookie otoTokenCookie = new OtoTokenCookie();
otoTokenCookie.setExpiredTime(System.currentTimeMillis() + 86400*1000*150L);
otoTokenCookie.setPhoneNumber("18909890978");
otoTokenCookie.setPhoneNumber("13454131091");
otoTokenCookie.setLoginId(IdMakeUtil.encodingId(21L, IdConvertBase64Enum.DEF));
otoTokenCookie.setLoginId(IdMakeUtil.encodingId(43L, IdConvertBase64Enum.DEF));
String json = JSON.toJSONString(otoTokenCookie);
String otoToken = BlowfishUtils.encryptBlowfish(json,"02a16fs1b6a3");
......
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