Commit 0b3426b9 authored by 郭姣's avatar 郭姣

企业后台代理人端接口修改

parent 6c559ab5
......@@ -14,6 +14,7 @@ import java.util.Map;
import com.kjj.config.BasicConfig;
import static com.kjj.utils.BaseUtils.*;
import static com.kjj.utils.BaseUtils.superUserLogin;
public class Enterprise implements Authorization {
@BeforeClass
......@@ -259,6 +260,7 @@ public class Enterprise implements Authorization {
**/
@Test(description = "导入架构名单",priority = 18)
public void 导入架构名单(){
superUserLogin();
Map<String,Object> params = new HashMap<>();
//导入的架构名单内容为工号KJJ002一条数据,营业部为余杭区营业部
params.put("excelUrl","https://yun.dui88.com/kjy/corp/media/file/20211116/82d1352f96526be537e1635c42a37231.xlsx");
......@@ -294,6 +296,7 @@ public class Enterprise implements Authorization {
**/
@Test(description = "获取当前公司营业部列表",priority = 21)
public void 获取当前公司营业部列表(){
ThreadSleepUtils.sleep(2000);
Response response = network.getResponse(BasicConfig.CORP_simpleList);
//通过批量上传的营业部,余杭区营业部
departmentId1 = response.jsonPath().getJsonObject("data.get(0).id");
......@@ -314,7 +317,7 @@ public class Enterprise implements Authorization {
int importCount = response.jsonPath().getInt("data.importCount");
Assert.assertEquals(accountCount,3, network.message(BasicConfig.CORP_employeeStat,"账号总量记录错误",response.body().asString()));
Assert.assertEquals(activateCount,0, network.message(BasicConfig.CORP_employeeStat,"已激活数量记录错误",response.body().asString()));
Assert.assertEquals(importCount,2, network.message(BasicConfig.CORP_employeeStat,"已录入数量记录错误",response.body().asString()));
Assert.assertEquals(importCount,1, network.message(BasicConfig.CORP_employeeStat,"已录入数量记录错误",response.body().asString()));
}
@Test(description = "分页查询员工列表",priority = 23)
......@@ -351,7 +354,7 @@ public class Enterprise implements Authorization {
//验证已录入数量增加1
Response statRes = network.getResponse(BasicConfig.CORP_employeeStat);
int importCount = statRes.jsonPath().getInt("data.importCount");
Assert.assertEquals(importCount,3,network.message(BasicConfig.CORP_employeeStat,"已录入数量记录错误",statRes.body().asString()));
Assert.assertEquals(importCount,2,network.message(BasicConfig.CORP_employeeStat,"已录入数量记录错误",statRes.body().asString()));
//获取新增成员的id信息
params.clear();
......
......@@ -9,10 +9,8 @@ import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.text.SimpleDateFormat;
import java.util.*;
import static com.kjj.utils.BaseUtils.ssoLogin;
import static com.kjj.utils.BaseUtils.superUserLogin;
......@@ -31,20 +29,37 @@ public class EnterpriseAgent implements Authorization {
public Object activityId; //企业后台新增的活动id
public int totalCount; //企业后台活动数量
public Object customerUserId; //代理人端获取直播线索客户id
public long jobNumber;
@Test(description = "企业后台_新增账号", priority = 1)
public void 企业后台_新增账号() {
//利用当前时间戳作为工号
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
jobNumber= new Date().getTime();
@Test(description = "激活账号", priority = 1)
Map<String, Object> params = new HashMap<>();
params.put("deptId", "Kj22MTU5MQ");//西湖区营业部
params.put("employeeName", "张三");
params.put("jobNumber", jobNumber);
params.put("employeePhone", "15634278283");
params.put("jobPost", "业务员");
Response response = network.postResponse(params, BasicConfig.CORP_employeeSaveOrUpdate);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.CORP_employeeSaveOrUpdate, "新增成员失败", response.body().asString()));
}
@Test(description = "激活账号", priority = 2)
public void 激活账号() {
Map<String, Object> params = new HashMap<>();
params.put("corpCompanyId", "Kj20MjE1");
params.put("jobNumber", "KJJ000");
params.put("jobNumber", jobNumber);
Response response = network.postResponse(params, BasicConfig.HOME_employeeActivate);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.HOME_employeeActivate, "用户激活失败", response.body().asString()));
}
@Test(description = "企业后台工号已激活", priority = 2)
@Test(description = "企业后台工号已激活", priority = 3)
public void 企业后台工号已激活() {
//获取企业后台营业部id
Response listRes = network.getResponse(BasicConfig.CORP_simpleList);
......@@ -61,7 +76,7 @@ public class EnterpriseAgent implements Authorization {
}
@Test(description = "企业后台_已激活数量", priority = 3)
@Test(description = "企业后台_已激活数量", priority = 4)
public void 企业后台_已激活数量() {
superUserLogin();
Response response = network.getResponse(BasicConfig.CORP_employeeStat);
......@@ -69,7 +84,7 @@ public class EnterpriseAgent implements Authorization {
Assert.assertEquals(activateCount, 1, network.message(BasicConfig.CORP_employeeStat, "已激活数量统计错误", response.body().asString()));
}
@Test(description = "查看代理人端直播页", priority = 4)
@Test(description = "查看代理人端直播页", priority = 5)
public void 查看代理人端直播页() {
Map<String, Object> params = new HashMap<>();
params.put("pageIndex", 1);
......@@ -80,7 +95,7 @@ public class EnterpriseAgent implements Authorization {
}
@Test(description = "短链跳转直播小程序", priority = 5)
@Test(description = "短链跳转直播小程序", priority = 6)
public void 短链跳转直播小程序() {
Map<String, Object> params = new HashMap<>();
params.put("type", 1);
......@@ -89,7 +104,7 @@ public class EnterpriseAgent implements Authorization {
Assert.assertTrue(success, network.message(params, BasicConfig.HOME_liveShortLink, "跳转直播小程序失败", response.body().asString()));
}
@Test(description = "获取企业版公司信息", priority = 6)
@Test(description = "获取企业版公司信息", priority = 7)
public void 获取企业版公司信息() {
Map<String, Object> params = new HashMap<>();
params.put("corpCompanyId", "Kj20MjE1");
......@@ -98,7 +113,7 @@ public class EnterpriseAgent implements Authorization {
Assert.assertNotNull(data, network.message(params, BasicConfig.HOME_corpCompanyInfo, "获取企业版公司信息失败", response.body().asString()));
}
@Test(description = "获取用户权限", priority = 7)
@Test(description = "获取用户权限", priority = 8)
public void 获取用户权限() {
//代理人权限为集客助手+直播权限
Response response = network.getResponse(BasicConfig.HOME_employeeAuth);
......@@ -106,7 +121,7 @@ public class EnterpriseAgent implements Authorization {
Assert.assertEquals(authType, 3, network.message(BasicConfig.HOME_employeeAuth, "获取用户权限错误", response.body().asString()));
}
@Test(description = "编辑公司权限后获取用户权限", priority = 8)
@Test(description = "编辑公司权限后获取用户权限", priority = 9)
public void 编辑公司权限后获取用户权限() {
//编辑公司权限为集客助手
Map<String, Object> params = new HashMap<>();
......@@ -132,7 +147,7 @@ public class EnterpriseAgent implements Authorization {
}
@Test(description = "恢复公司权限", priority = 9)
@Test(description = "恢复公司权限", priority = 10)
public void 恢复公司权限() {
Map<String, Object> params = new HashMap<>();
params.put("authExpiryDate", "1669737600000");
......@@ -160,7 +175,7 @@ public class EnterpriseAgent implements Authorization {
Assert.assertTrue(data, network.message(params, BasicConfig.MANAGER_companySaveOrUpdate, "编辑企业信息正确", response.body().asString()));
}
@Test(description = "查询用户信息", priority = 10)
@Test(description = "查询用户信息", priority = 11)
public void 查询用户信息() {
Response response = network.getResponse(BasicConfig.HOME_employeeInfo);
Object data = response.jsonPath().getJsonObject("data");
......@@ -293,7 +308,7 @@ public class EnterpriseAgent implements Authorization {
params.clear();
params.put("deptId", testDeptId);//备用营业部
params.put("employeeName", "账号3");
params.put("jobNumber", "KJJ00000");
params.put("jobNumber", "KJJ1111");
params.put("employeePhone", "15634278281");
params.put("jobPost", "业务员3");
Response employeeRes = network.postResponse(params, BasicConfig.CORP_employeeSaveOrUpdate);
......@@ -322,7 +337,7 @@ public class EnterpriseAgent implements Authorization {
//账号3用于验证非西湖区营业部的成员不能收到通知
Map<String, Object> params = new HashMap<>();
params.put("corpCompanyId", "Kj20MjE1");
params.put("jobNumber", "KJJ00000");
params.put("jobNumber", "KJJ1111");
Response testRes = network.postResponse(params, BasicConfig.HOME_employeeActivate);
boolean testData = testRes.jsonPath().getBoolean("data");
Assert.assertTrue(testData, network.message(params, BasicConfig.HOME_employeeActivate, "用户激活失败", testRes.body().asString()));
......@@ -548,19 +563,6 @@ public class EnterpriseAgent implements Authorization {
}
@Test(description = "企业后台_新增账号", priority = 38)
public void 企业后台_新增账号() {
superUserLogin();
Map<String, Object> params = new HashMap<>();
params.put("deptId", deptId);//西湖区营业部
params.put("employeeName", "张三");
params.put("jobNumber", "KJJ000");
params.put("employeePhone", "15634278283");
params.put("jobPost", "业务员");
Response response = network.postResponse(params, BasicConfig.CORP_employeeSaveOrUpdate);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.CORP_employeeSaveOrUpdate, "新增成员失败", response.body().asString()));
}
}
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