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

增加权限管理-换绑手机、绑定/解绑坐席、公众号查看预约订单列表的用例

parent 4531c3dd
...@@ -64,14 +64,13 @@ public interface Authorization { ...@@ -64,14 +64,13 @@ public interface Authorization {
} }
//代理人 //代理人xxx
default void agent2Tku() { default void agent2Tku() {
network.agentCookies.put(TKU_COOKIE_NAME, AGENT2_TKU); network.agentCookies.put(TKU_COOKIE_NAME, AGENT2_TKU);
System.out.println("代理人梦晨tku:" + AGENT2_TKU); System.out.println("代理人梦晨tku:" + AGENT2_TKU);
} }
// 获取访客tku:Su Yi // 获取访客tku:Su Yi
default void userTku() { default void userTku() {
network.agentCookies.put(TKU_COOKIE_NAME, VISITOR_UserTku); network.agentCookies.put(TKU_COOKIE_NAME, VISITOR_UserTku);
......
...@@ -246,7 +246,7 @@ public class Manager { ...@@ -246,7 +246,7 @@ public class Manager {
Assert.assertEquals(prodName,"勿动-自动化专用产品更新",network.message(params,BasicConfig.MANAGER_oto_productList,"产品的名称未更新",response.body().asString())); Assert.assertEquals(prodName,"勿动-自动化专用产品更新",network.message(params,BasicConfig.MANAGER_oto_productList,"产品的名称未更新",response.body().asString()));
} }
@Test(description = "还原公司产品",priority = 15) @Test(description = "还原公司产品",priority = 16)
public void 还原公司产品(){ public void 还原公司产品(){
ArrayList companyIds = new ArrayList(); ArrayList companyIds = new ArrayList();
companyIds.add(5); companyIds.add(5);
...@@ -270,4 +270,55 @@ public class Manager { ...@@ -270,4 +270,55 @@ public class Manager {
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_productSave,"修改公司产品失败",response.body().asString())); Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_productSave,"修改公司产品失败",response.body().asString()));
} }
@Test(description = "查看第三方账号列表",priority = 17)
public void 查看第三方账号列表(){
Response response = network.getResponse(BasicConfig.MANAGER_oto_accountList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(BasicConfig.MANAGER_oto_accountList,"查询第三方账号列表为空",response.body().asString()));
}
@Test(description = "绑定第三方坐席",priority = 18)
public void 绑定第三方坐席(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", sellerId);
params.put("accountName", "8060@fhpcs");
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_accountBind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_accountBind,"绑定第三方账号失败",response.body().asString()));
}
@Test(description = "解绑第三方坐席",priority = 19)
public void 解绑第三方坐席(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", sellerId);
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_accountUnbind);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_accountUnbind,"解绑坐席账号失败",response.body().asString()));
}
@Test(description = "换绑手机并还原",priority = 20)
public void 换绑手机并还原(){
HashMap<String,Object> params = new HashMap<>();
params.put("id", sellerId);
params.put("newPhoneNum", "14783743847");
Response response = network.postResponse(params,BasicConfig.MANAGER_oto_change);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_change,"解绑坐席账号失败",response.body().asString()));
params.clear();
params.put("phoneNumber", "14783743847");
params.put("pageIndex", "1");
params.put("pageSize", "20");
response = network.getResponse(params, BasicConfig.MANAGER_oto_sellerList);
int id = response.jsonPath().getInt("data.list[0].id");
Assert.assertEquals(id,sellerId,network.message(params,BasicConfig.MANAGER_oto_sellerList,"销售列表为空",response.body().asString()));
params.clear();
params.put("id", sellerId);
params.put("newPhoneNum", "18248405155");
response = network.postResponse(params,BasicConfig.MANAGER_oto_change);
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,BasicConfig.MANAGER_oto_change,"解绑坐席账号失败",response.body().asString()));
}
} }
...@@ -619,6 +619,17 @@ public class Phone implements Authorization { ...@@ -619,6 +619,17 @@ public class Phone implements Authorization {
Assert.assertTrue(finishCustNum>0,network.message(params,BasicConfig.WORK_taskDetailsList,"已完成数量记录错误",response.body().asString())); Assert.assertTrue(finishCustNum>0,network.message(params,BasicConfig.WORK_taskDetailsList,"已完成数量记录错误",response.body().asString()));
} }
@Test(description = "查看我的预约列表",priority = 46)
public void 查看我的预约列表(){
agent2Tku();
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex",1);
params.put("pageSize",20);
Response response =network.getResponse(params,BasicConfig.PHONE_getReservationList);
int bookingStatus = response.jsonPath().getInt("data[0].bookingStatus");
Assert.assertEquals(bookingStatus,1,network.message(BasicConfig.PHONE_getReservationList,"查看审批列表不为空",response.body().asString()));
}
@Test(description = "删除客户",priority = 79) @Test(description = "删除客户",priority = 79)
public void 删除客户(){ public void 删除客户(){
HashMap<String,Object> params = new HashMap<>(); HashMap<String,Object> params = new HashMap<>();
......
...@@ -10,8 +10,7 @@ import org.testng.annotations.Test; ...@@ -10,8 +10,7 @@ import org.testng.annotations.Test;
import java.util.*; import java.util.*;
import static com.kjj.config.BasicConfig.LEADER_ID; import static com.kjj.config.BasicConfig.*;
import static com.kjj.config.BasicConfig.SELLER_ID;
import static com.kjj.utils.BaseUtils.*; import static com.kjj.utils.BaseUtils.*;
import static com.kjj.utils.ThreadSleepUtils.sleep; import static com.kjj.utils.ThreadSleepUtils.sleep;
...@@ -19,7 +18,7 @@ public class Work implements Authorization { ...@@ -19,7 +18,7 @@ public class Work implements Authorization {
private static final NetworkUtils network = NetworkUtils.getInstance(); private static final NetworkUtils network = NetworkUtils.getInstance();
public int tagId; //标签ID public int tagId; //标签ID
public int custId; //客户ID public int custId; //客户ID
public static String phone = "15938213001"; //客户手机号 public static String phone = "13705566425"; //客户手机号
public int followTimes; //跟进次数 public int followTimes; //跟进次数
public static Map<String,Integer> header; public static Map<String,Integer> header;
public static Map<String,Integer> chart; public static Map<String,Integer> chart;
...@@ -786,4 +785,18 @@ public class Work implements Authorization { ...@@ -786,4 +785,18 @@ public class Work implements Authorization {
Assert.assertTrue(listSize>0,network.message(params,BasicConfig.WORK_taskDetailsList,"待完成客户数统计错误",response.body().asString())); Assert.assertTrue(listSize>0,network.message(params,BasicConfig.WORK_taskDetailsList,"待完成客户数统计错误",response.body().asString()));
} }
@Test(description = "查看我的预约列表",priority = 70)
public void 查看我的预约列表(){
agent2Tku();
HashMap<String,Object> params = new HashMap<>();
params.put("pageIndex",1);
params.put("pageSize",20);
Response response =network.getResponse(params,BasicConfig.PHONE_getReservationList);
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,1,network.message(BasicConfig.PHONE_getReservationList,"查看预约列表不为空",response.body().asString()));
int bookingStatus = response.jsonPath().getInt("data[0].bookingStatus");
Assert.assertEquals(bookingStatus,0,network.message(BasicConfig.PHONE_getReservationList,"预约状态错误",response.body().asString()));
}
} }
...@@ -1333,6 +1333,10 @@ public class BasicConfig { ...@@ -1333,6 +1333,10 @@ public class BasicConfig {
public static final String MANAGER_oto_productList = MANAGER_HOST +"/kjy/manager/oto/product/list"; public static final String MANAGER_oto_productList = MANAGER_HOST +"/kjy/manager/oto/product/list";
public static final String MANAGER_oto_productSave = MANAGER_HOST +"/kjy/manager/oto/product/save"; public static final String MANAGER_oto_productSave = MANAGER_HOST +"/kjy/manager/oto/product/save";
public static final String MANAGER_oto_productUpdateStatus = MANAGER_HOST +"/kjy/manager/oto/product/updateStatus"; public static final String MANAGER_oto_productUpdateStatus = MANAGER_HOST +"/kjy/manager/oto/product/updateStatus";
public static final String MANAGER_oto_accountList = MANAGER_HOST + "/kjy/manager/oto/seller/account/availableList";
public static final String MANAGER_oto_accountBind = MANAGER_HOST + "/kjy/manager/oto/seller/account/bind";
public static final String MANAGER_oto_accountUnbind = MANAGER_HOST + "/kjy/manager/oto/seller/account/unbind";
public static final String MANAGER_oto_change = MANAGER_HOST + "/kjy/manager/oto/seller/phone/change";
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";
...@@ -1404,6 +1408,7 @@ public class BasicConfig { ...@@ -1404,6 +1408,7 @@ public class BasicConfig {
public static final String PHONE_address = PHONE_HOST + "/kjy/oto/h5/v1/save/address"; public static final String PHONE_address = PHONE_HOST + "/kjy/oto/h5/v1/save/address";
public static final String PHONE_getUnusualTypes = PHONE_HOST + "/kjy/oto/h5/v1/getUnusualTypes"; public static final String PHONE_getUnusualTypes = PHONE_HOST + "/kjy/oto/h5/v1/getUnusualTypes";
public static final String PHONE_fail = HOST + "/kjy/oto/interview/authorize/fail"; public static final String PHONE_fail = HOST + "/kjy/oto/interview/authorize/fail";
public static final String PHONE_getReservationList = HOST + "/kjy/pub/form/getReservationList";
public static final String WORK_verifyCode = WORK_HOST + "/kjy/oto/auto/test/verifyCode"; 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"; public static final String WORK_delCust = WORK_HOST + "/kjy/oto/auto/test/delCust";
......
This diff is collapsed.
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