Commit 889a80d8 authored by 龚小红's avatar 龚小红

优化公司专区代码

parent 85678d97
...@@ -48,7 +48,7 @@ public class HomePage implements Authorization { ...@@ -48,7 +48,7 @@ public class HomePage implements Authorization {
public long adviceId1; //用户话术ID public long adviceId1; //用户话术ID
public long adviceId2; //代理人话术ID public long adviceId2; //代理人话术ID
public long listSimpleId; //赠险列表id public long listSimpleId; //赠险列表id
public String companyContentId; //公司专区文章Id public String companyContentId = "Kj21NzUxOTE";; //公司专区文章Id
public String companyScId; //公司专区scid public String companyScId; //公司专区scid
private long forwardTime; //转发时间 private long forwardTime; //转发时间
private String clueId; //线索ID private String clueId; //线索ID
...@@ -409,8 +409,8 @@ public class HomePage implements Authorization { ...@@ -409,8 +409,8 @@ public class HomePage implements Authorization {
//管理后台新增公司专区内容 //管理后台新增公司专区内容
@Test(description = "管理后台_新增内容",priority = 23) @Test(description = "公司专区新增文章",priority = 23)
public void 新增内容(){ public void 公司专区新增文章(){
//根据文章内容id匹配 //根据文章内容id匹配
Map<String,Object> params = new HashMap<>(); Map<String,Object> params = new HashMap<>();
params.put("id",9398); params.put("id",9398);
...@@ -474,7 +474,7 @@ public class HomePage implements Authorization { ...@@ -474,7 +474,7 @@ public class HomePage implements Authorization {
params.put("pageNo",1); params.put("pageNo",1);
params.put("pageSize",20); params.put("pageSize",20);
Response listRes = network.getResponse(params,MANAGER_exclusiveItemPage); Response listRes = network.getResponse(params,MANAGER_exclusiveItemPage);
Object id = listRes.jsonPath().getJsonObject("data.list.get(2).id"); String id = listRes.jsonPath().getString("data.list.find {it.itemId == '9398'}.id");
System.out.println(id); System.out.println(id);
String desc = listRes.jsonPath().getString("desc"); String desc = listRes.jsonPath().getString("desc");
Assert.assertEquals(desc,"OK",network.message(params,MANAGER_exclusiveItemPage,"获取id失败",listRes.body().asString())); Assert.assertEquals(desc,"OK",network.message(params,MANAGER_exclusiveItemPage,"获取id失败",listRes.body().asString()));
...@@ -574,8 +574,6 @@ public class HomePage implements Authorization { ...@@ -574,8 +574,6 @@ public class HomePage implements Authorization {
params.put("source",1); params.put("source",1);
Response listRes = network.getResponse(params,HOME_companyGetContentList); Response listRes = network.getResponse(params,HOME_companyGetContentList);
companyCount = listRes.jsonPath().getInt("data.totalCount"); companyCount = listRes.jsonPath().getInt("data.totalCount");
companyContentId = listRes.jsonPath().getString("data.list[1].contentId");
System.out.println(companyContentId);
Assert.assertTrue(companyCount>0,network.message(params,HOME_companyGetContentList,"获取公司专区内容列表数据错误",listRes.body().asString())); Assert.assertTrue(companyCount>0,network.message(params,HOME_companyGetContentList,"获取公司专区内容列表数据错误",listRes.body().asString()));
} }
@Test(description = "获取文章配置的公司专区互动方案",priority = 31) @Test(description = "获取文章配置的公司专区互动方案",priority = 31)
...@@ -738,15 +736,19 @@ public class HomePage implements Authorization { ...@@ -738,15 +736,19 @@ public class HomePage implements Authorization {
@Test(description = "管理后台_删除公司专区内容",priority = 42) @Test(description = "管理后台_删除公司专区内容",priority = 42)
public void 管理后台_删除公司专区内容(){ public void 管理后台_删除公司专区内容(){
ThreadSleepUtils.sleep(2000); ThreadSleepUtils.sleep(2000);
Response response = network.getResponse(Daily_getTagList);
Object tagId = response.jsonPath().getJsonObject("data.get(1).id");
//获取删除的内容的id //获取删除的内容的id
Map<String,Object> params = new HashMap<>(); Map<String,Object> params = new HashMap<>();
params.put("exclusiveAreaId",21); params.put("exclusiveAreaId",21);
params.put("title",""); params.put("title","");
params.put("state",0); params.put("state",0);
params.put("firstTagId",tagId);
params.put("pageNo",1); params.put("pageNo",1);
params.put("pageSize",20); params.put("pageSize",20);
Response listRes = network.getResponse(params,MANAGER_exclusiveItemPage); Response listRes = network.getResponse(params,MANAGER_exclusiveItemPage);
Object id = listRes.jsonPath().getJsonObject("data.list.get(3).id"); Object id = listRes.jsonPath().getJsonObject("data.list.find {it.itemId == '9398'}.id");
String desc = listRes.jsonPath().getString("desc"); String desc = listRes.jsonPath().getString("desc");
Assert.assertEquals(desc,"OK",network.message(params,MANAGER_exclusiveItemPage,"获取id失败",listRes.body().asString())); Assert.assertEquals(desc,"OK",network.message(params,MANAGER_exclusiveItemPage,"获取id失败",listRes.body().asString()));
companyCount = listRes.jsonPath().getInt("data.list.size()"); companyCount = listRes.jsonPath().getInt("data.list.size()");
...@@ -761,8 +763,6 @@ public class HomePage implements Authorization { ...@@ -761,8 +763,6 @@ public class HomePage implements Authorization {
sleep(5000); sleep(5000);
//验证删除是否成功 //验证删除是否成功
Response response = network.getResponse(Daily_getTagList);
Object tagId = response.jsonPath().getJsonObject("data.get(1).id");
Map<String,Object> paramsList = new HashMap<>(); Map<String,Object> paramsList = new HashMap<>();
paramsList.put("firstTagId",tagId); paramsList.put("firstTagId",tagId);
paramsList.put("pageSize",20); paramsList.put("pageSize",20);
...@@ -770,7 +770,7 @@ public class HomePage implements Authorization { ...@@ -770,7 +770,7 @@ public class HomePage implements Authorization {
paramsList.put("source",1); paramsList.put("source",1);
Response dataRes = network.getResponse(paramsList,HOME_companyGetContentList); Response dataRes = network.getResponse(paramsList,HOME_companyGetContentList);
int totalCount = dataRes.jsonPath().getInt("data.totalCount"); int totalCount = dataRes.jsonPath().getInt("data.totalCount");
int totalCountNew = companyCount-3;//因为其中还包含2个视频,一个删除的文章,所以减去3 int totalCountNew = companyCount-1;//
Assert.assertEquals(totalCount,totalCountNew,network.message(paramsList,HOME_companyGetContentList,"获取公司专区内容列表数据错误",dataRes.body().asString())); Assert.assertEquals(totalCount,totalCountNew,network.message(paramsList,HOME_companyGetContentList,"获取公司专区内容列表数据错误",dataRes.body().asString()));
} }
...@@ -778,14 +778,17 @@ public class HomePage implements Authorization { ...@@ -778,14 +778,17 @@ public class HomePage implements Authorization {
@Test(description = "管理后台_删除公司专区视频",priority = 43) @Test(description = "管理后台_删除公司专区视频",priority = 43)
public void 管理后台_删除公司专区视频(){ public void 管理后台_删除公司专区视频(){
//获取删除的视频的id //获取删除的视频的id
Response response = network.getResponse(Daily_getTagList);
Object tagId = response.jsonPath().getJsonObject("data.get(0).id");
Map<String,Object> params = new HashMap<>(); Map<String,Object> params = new HashMap<>();
params.put("exclusiveAreaId",21); params.put("exclusiveAreaId",21);
params.put("title",""); params.put("title","");
params.put("state",0); params.put("state",0);
params.put("firstTagId",tagId);
params.put("pageNo",1); params.put("pageNo",1);
params.put("pageSize",20); params.put("pageSize",20);
Response listRes = network.getResponse(params,MANAGER_exclusiveItemPage); Response listRes = network.getResponse(params,MANAGER_exclusiveItemPage);
Object id = listRes.jsonPath().getJsonObject("data.list.get(0).id"); Object id = listRes.jsonPath().getJsonObject("data.list.find {it.itemId == '248119'}.id");
String desc = listRes.jsonPath().getString("desc"); String desc = listRes.jsonPath().getString("desc");
Assert.assertEquals(desc,"OK",network.message(params,MANAGER_exclusiveItemPage,"获取id失败",listRes.body().asString())); Assert.assertEquals(desc,"OK",network.message(params,MANAGER_exclusiveItemPage,"获取id失败",listRes.body().asString()));
companyCount = listRes.jsonPath().getInt("data.list.size()"); companyCount = listRes.jsonPath().getInt("data.list.size()");
...@@ -799,8 +802,6 @@ public class HomePage implements Authorization { ...@@ -799,8 +802,6 @@ public class HomePage implements Authorization {
sleep(5000); sleep(5000);
//验证删除是否成功 //验证删除是否成功
Response response = network.getResponse(Daily_getTagList);
Object tagId = response.jsonPath().getJsonObject("data.get(0).id");
Map<String,Object> paramsList = new HashMap<>(); Map<String,Object> paramsList = new HashMap<>();
paramsList.put("firstTagId",tagId); paramsList.put("firstTagId",tagId);
paramsList.put("pageSize",20); paramsList.put("pageSize",20);
...@@ -808,7 +809,7 @@ public class HomePage implements Authorization { ...@@ -808,7 +809,7 @@ public class HomePage implements Authorization {
paramsList.put("source",1); paramsList.put("source",1);
Response dataRes = network.getResponse(paramsList,HOME_companyGetContentList); Response dataRes = network.getResponse(paramsList,HOME_companyGetContentList);
int totalCountNew = dataRes.jsonPath().getInt("data.totalCount"); int totalCountNew = dataRes.jsonPath().getInt("data.totalCount");
Assert.assertEquals(totalCountNew,companyCount-2,network.message(paramsList,HOME_companyGetContentList,"获取公司专区内容列表数据错误",dataRes.body().asString())); Assert.assertEquals(totalCountNew,companyCount-1,network.message(paramsList,HOME_companyGetContentList,"获取公司专区内容列表数据错误",dataRes.body().asString()));
} }
......
...@@ -434,7 +434,7 @@ public class PersonalCenter implements Authorization{ ...@@ -434,7 +434,7 @@ public class PersonalCenter implements Authorization{
Assert.assertTrue(success,network.message(params,SELLERCARD_getIncreaseStaffConfig ,"接口返回失败",response.body().asString())); Assert.assertTrue(success,network.message(params,SELLERCARD_getIncreaseStaffConfig ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(result,network.message(params,SELLERCARD_getIncreaseStaffConfig ,"配置列表为空",response.body().asString())); Assert.assertNotNull(result,network.message(params,SELLERCARD_getIncreaseStaffConfig ,"配置列表为空",response.body().asString()));
size = response.jsonPath().getInt("data.find {it.val == true}.size()"); size = response.jsonPath().getInt("data.findAll {it.val == true}.size()");
Assert.assertTrue(size==3,network.message(SELLERCARD_getIncreaseStaffConfig,"关闭后再开启失败",response.body().asString())); Assert.assertTrue(size==3,network.message(SELLERCARD_getIncreaseStaffConfig,"关闭后再开启失败",response.body().asString()));
} }
} }
...@@ -136,7 +136,7 @@ public class ForwardAndRead implements Authorization { ...@@ -136,7 +136,7 @@ public class ForwardAndRead implements Authorization {
// 获取新用户 // 获取新用户
@Test(description = "新用户访问", priority = 7) @Test(description = "新用户访问", priority = 7)
public void 新用户访问() throws IOException{ public void 新用户访问() throws IOException{
sleep(5000); sleep(2000);
newUser1(); newUser1();
response = network.getResponse(BasicConfig.USER_INFO); response = network.getResponse(BasicConfig.USER_INFO);
System.out.println(response.body().asString()); System.out.println(response.body().asString());
......
...@@ -109,7 +109,6 @@ public class BasicConfig { ...@@ -109,7 +109,6 @@ public class BasicConfig {
// *************** 客集集域名 *************** // *************** 客集集域名 ***************
public static final String HOST = "https://kjj.m.duibatest.com.cn"; public static final String HOST = "https://kjj.m.duibatest.com.cn";
public static final String ACTIVITY_HOST = "https://kjj-activity.duibatest.com.cn"; public static final String ACTIVITY_HOST = "https://kjj-activity.duibatest.com.cn";
public static final String ACTIVITY1_HOST = "https://kjj-activity-1.duibatest.com.cn";
public static final String SSO_HOST = "https://sso.duibatest.com.cn"; public static final String SSO_HOST = "https://sso.duibatest.com.cn";
public static final String MANAGER_HOST = "https://kjj-mng.duibatest.com.cn"; public static final String MANAGER_HOST = "https://kjj-mng.duibatest.com.cn";
public static final String MOBILE_HOST = "https://live.duibatest.com.cn"; public static final String MOBILE_HOST = "https://live.duibatest.com.cn";
......
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