Commit 9e82d6ec authored by 龚小红's avatar 龚小红

增加权限管理的相关用例

parent 63d06560
package com.kjj.cases.otoseller;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.utils.NetworkUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.util.HashMap;
import static com.kjj.utils.BaseUtils.ssoLogin;
//手机端
public class Phone implements Authorization {
private static final NetworkUtils network = NetworkUtils.getInstance();
private int sellerId; //销售ID
private String cust_id;
@BeforeTest
public void setUp(){
//登录销售工作台手机端
}
@Test(description = "查看我的客户",priority = 1)
public void 查看我的客户(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageSize", "20");
Response response = network.getResponse(params, BasicConfig.PHONE_customerList);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.PHONE_customerList,"客户列表为空",response.body().asString()));
cust_id = response.jsonPath().getString("data.list[0].id");
}
@Test(description = "查看我的面访",priority = 1)
public void 查看我的面访(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageSize", "20");
Response response = network.getResponse(params, BasicConfig.PHONE_interviewList);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.PHONE_interviewList,"面访列表为空",response.body().asString()));
}
@Test(description = "不可创建重复手机号的客户",priority = 1)
public void 不可创建重复手机号的客户(){
HashMap<String,Object> params = new HashMap<>();
params.put("pageSize", "20");
Response response = network.postResponse(params, BasicConfig.PHONE_interviewList);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(params,BasicConfig.PHONE_interviewList,"面访列表为空",response.body().asString()));
}
}
......@@ -795,7 +795,7 @@ public class Work implements Authorization {
@Test(description = "关闭总监的新客户认领权限和回收客户认领权限",priority = 59)
public void 关闭总监的新客户认领权限和回收客户认领权限(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", LEADER_ID);
params.put("id", LEADER_ID);
params.put("sellerStatus", 1);
params.put("callPermission", 1);
params.put("workassignNewCustPermissionStatus", 0);
......@@ -828,7 +828,7 @@ public class Work implements Authorization {
@Test(description = "开启总监的新客户认领权限和回收客户认领权限",priority = 62)
public void 开启总监的新客户认领权限和回收客户认领权限(){
HashMap<String,Object> params = new HashMap<>();
params.put("sellerId", LEADER_ID);
params.put("id", LEADER_ID);
params.put("sellerStatus", 1);
params.put("callPermission", 1);
params.put("workassignNewCustPermissionStatus", 1);
......
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