Commit 92d0c3dd authored by Su-Yi's avatar Su-Yi

修改日志打印方式

parent d6d56c57
......@@ -33,7 +33,7 @@ public class Article {
public void 代理人_种草爆文列表页() throws IOException {
Response response = network.getResponse(ARTICLE_GETEXPLOSIONCONTENTLIST);
articleContentId = response.jsonPath().getString("data[0].contentId");
Assert.assertNotNull(articleContentId,network.message(ARTICLE_GETEXPLOSIONCONTENTLIST,"获取爆款素材文章失败"));
Assert.assertNotNull(articleContentId,network.message(ARTICLE_GETEXPLOSIONCONTENTLIST,"获取爆款素材文章失败",response.body().asString()));
}
//文章内容页
......@@ -44,13 +44,13 @@ public class Article {
params.put("contentId",articleContentId);
Response response = network.getResponse(params, GETSCID);
scid = response.jsonPath().getString("data");
Assert.assertNotNull(scid,network.message(params, GETSCID,"获取scId失败"));
Assert.assertNotNull(scid,network.message(params, GETSCID,"获取scId失败",response.body().asString()));
Map<String, Object> infoParams = new HashMap<String, Object>();
infoParams.put("scid",scid);
response = network.getResponse(infoParams,ARTICLE_H5INFO);
String id = response.jsonPath().getString("data.id");
Assert.assertEquals(articleContentId, id, network.message(infoParams,ARTICLE_H5INFO,"获取文章内容页失败"));
Assert.assertEquals(articleContentId, id, network.message(infoParams,ARTICLE_H5INFO,"获取文章内容页失败",response.body().asString()));
}
//名片是否展示
......@@ -62,20 +62,20 @@ public class Article {
sellerCardParams.put("configValue",false);
Response response = network.postResponse(sellerCardParams,SELLERCONFIG_EDITCONFIG);
boolean isChanged = response.jsonPath().getBoolean("data");
Assert.assertTrue(isChanged,network.message(sellerCardParams,SELLERCONFIG_EDITCONFIG,"关闭素材头部名片失败"));
Assert.assertTrue(isChanged,network.message(sellerCardParams,SELLERCONFIG_EDITCONFIG,"关闭素材头部名片失败",response.body().asString()));
sellerCardParams.put("configKey","card_show_on_bottom");//素材尾部名片
sellerCardParams.put("configValue",false);
response = network.postResponse(sellerCardParams,SELLERCONFIG_EDITCONFIG);
isChanged = response.jsonPath().getBoolean("data");
Assert.assertTrue(isChanged,network.message(sellerCardParams,SELLERCONFIG_EDITCONFIG,"关闭素材底部名片失败"));
Assert.assertTrue(isChanged,network.message(sellerCardParams,SELLERCONFIG_EDITCONFIG,"关闭素材底部名片失败",response.body().asString()));
//检查文章内名片展示
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
response = network.getResponse(params,SELLERCARD_GETSELLERCARDCONFIG);
int openCount = response.jsonPath().getInt("data.findAll {it.val == true}.size()");
Assert.assertEquals(openCount,0,network.message(params,SELLERCARD_GETSELLERCARDCONFIG,"代理人视角-名片关闭状态与设置中心不一致"));
Assert.assertEquals(openCount,0,network.message(params,SELLERCARD_GETSELLERCARDCONFIG,"代理人视角-名片关闭状态与设置中心不一致",response.body().asString()));
//开启名片展示
sellerCardParams.put("configKey","card_show_on_top");//素材尾部名片
......@@ -88,14 +88,14 @@ public class Article {
//再次检查文章内名片展示
response = network.getResponse(params,SELLERCARD_GETSELLERCARDCONFIG);
openCount = response.jsonPath().getInt("data.findAll {it.val == true}.size()");
Assert.assertEquals(openCount,2,network.message(params,SELLERCARD_GETSELLERCARDCONFIG,"代理人视角-名片开启状态与设置中心不一致"));
Assert.assertEquals(openCount,2,network.message(params,SELLERCARD_GETSELLERCARDCONFIG,"代理人视角-名片开启状态与设置中心不一致",response.body().asString()));
//名片样式
Map<String, Object> styleParams = new HashMap<String, Object>();
styleParams.put("id",scid);
response = network.getResponse(styleParams,SELLERCARD_GETSELLERCARDSTYLE);
String backgroundColor = response.jsonPath().getString("data.find {it.code == 'card_background_color'}.val");
Assert.assertEquals(backgroundColor,"1",network.message(styleParams,SELLERCARD_GETSELLERCARDSTYLE,"名片-背景色样式不对"));
Assert.assertEquals(backgroundColor,"1",network.message(styleParams,SELLERCARD_GETSELLERCARDSTYLE,"名片-背景色样式不对",response.body().asString()));
}
// 头部名片
......@@ -156,8 +156,8 @@ public class Article {
response = network.getResponse(infoParams,ARTICLE_GETEXPINFO);
String tags = response.jsonPath().getString("data.tags");
String recommendReason = response.jsonPath().getString("data.recommendReason");
Assert.assertNotNull(tags,network.message(infoParams,ARTICLE_GETEXPINFO,"获取文章标签有误"));
Assert.assertNotNull(recommendReason,network.message(infoParams,ARTICLE_GETEXPINFO,"获取文章推荐理由有误"));
Assert.assertNotNull(tags,network.message(infoParams,ARTICLE_GETEXPINFO,"获取文章标签有误",response.body().asString()));
Assert.assertNotNull(recommendReason,network.message(infoParams,ARTICLE_GETEXPINFO,"获取文章推荐理由有误",response.body().asString()));
}
// 获取互动区-专业解读
......@@ -170,7 +170,7 @@ public class Article {
params.put("pageSize",10);
Response response = network.getResponse(params,ARTICLE_ENHANCEDCOLUMN_GETCONTENTS);
boolean hasList = response.jsonPath().getInt("data.list.size()") > 0;
Assert.assertTrue(hasList, network.message(params,ARTICLE_ENHANCEDCOLUMN_GETCONTENTS,"获取专业解读列表有误"));
Assert.assertTrue(hasList, network.message(params,ARTICLE_ENHANCEDCOLUMN_GETCONTENTS,"获取专业解读列表有误",response.body().asString()));
}
// 获取互动区-互动问答
......@@ -183,9 +183,9 @@ public class Article {
params.put("pageSize",3);
Response response = network.getResponse(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS);
int count = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(count,3,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"获取个人专栏列表有误"));
Assert.assertEquals(count,3,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"获取个人专栏列表有误",response.body().asString()));
String answer = response.jsonPath().getString("data.list[0].answer");
Assert.assertNotNull(answer,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"获取问答内容有误"));
Assert.assertNotNull(answer,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"获取问答内容有误",response.body().asString()));
}
// 获取互动区-风险评测
......@@ -197,8 +197,8 @@ public class Article {
Response response = network.getResponse(params,ARTICLE_ISDISPLAYACTIVITY);
boolean isDisplay = response.jsonPath().getBoolean("data.isDisplay");
String riskScid = response.jsonPath().getString("data.scid");
Assert.assertTrue(isDisplay,network.message(params,ARTICLE_ISDISPLAYACTIVITY,"互动区-风险评测显示有误"));
Assert.assertNotNull(riskScid, network.message(params,ARTICLE_ISDISPLAYACTIVITY,"互动区-风险评测内容有误"));
Assert.assertTrue(isDisplay,network.message(params,ARTICLE_ISDISPLAYACTIVITY,"互动区-风险评测显示有误",response.body().asString()));
Assert.assertNotNull(riskScid, network.message(params,ARTICLE_ISDISPLAYACTIVITY,"互动区-风险评测内容有误",response.body().asString()));
}
// 获取代理人个人专栏
......@@ -209,7 +209,7 @@ public class Article {
params.put("scid",scid);
Response response = network.getResponse(params,ARTICLE_GETENHANCEDCOLUMNCONFIG);
boolean isOpen = response.jsonPath().getBoolean("data.find {it.code == 'personal_document_switch'}.val");
Assert.assertTrue(isOpen,network.message(params,ARTICLE_GETENHANCEDCOLUMNCONFIG,"获取代理人日常精准素材个人专栏开关有误"));
Assert.assertTrue(isOpen,network.message(params,ARTICLE_GETENHANCEDCOLUMNCONFIG,"获取代理人日常精准素材个人专栏开关有误",response.body().asString()));
//关闭 代理人个人专栏开关
Map<String, Object> configParams = new HashMap<String, Object>();
......@@ -220,7 +220,7 @@ public class Article {
//再获取代理人个人专栏
response = network.getResponse(params,ARTICLE_GETENHANCEDCOLUMNCONFIG);
isOpen = response.jsonPath().getBoolean("data.find {it.code == 'personal_document_switch'}.val");
Assert.assertFalse(isOpen,network.message(params,ARTICLE_GETENHANCEDCOLUMNCONFIG,"获取代理人日常精准素材个人专栏开关有误"));
Assert.assertFalse(isOpen,network.message(params,ARTICLE_GETENHANCEDCOLUMNCONFIG,"获取代理人日常精准素材个人专栏开关有误",response.body().asString()));
//再次开启 代理人个人专栏开关
configParams.put("configKey","personal_document_switch");
......@@ -236,7 +236,7 @@ public class Article {
params.put("t",System.currentTimeMillis());
Response response = network.getResponse(params, CHECKUNREAD);
String desc = response.jsonPath().getString("desc");
Assert.assertEquals(desc,"OK",network.message(params, CHECKUNREAD, "获取私信有误"));
Assert.assertEquals(desc,"OK",network.message(params, CHECKUNREAD, "获取私信有误",response.body().asString()));
}
// ******************************** 访客 ****************************
......@@ -251,7 +251,7 @@ public class Article {
params.put("visitPath",1); //访问路径来源 0未知,1个人,2朋友圈,3群
Response response = network.getResponse(params,CONTENT_READ);
visitId = response.jsonPath().getString("data.visitId");
Assert.assertNotNull(visitId,network.message(params,CONTENT_READ,"访客视角-获取访问记录失败"));
Assert.assertNotNull(visitId,network.message(params,CONTENT_READ,"访客视角-获取访问记录失败",response.body().asString()));
}
......@@ -263,7 +263,7 @@ public class Article {
infoParams.put("scid",scid);
Response response = network.getResponse(infoParams,ARTICLE_H5INFO);
String id = response.jsonPath().getString("data.id");
Assert.assertEquals(articleContentId, id, network.message(infoParams,ARTICLE_H5INFO,"访客视角-获取文章内容页失败"));
Assert.assertEquals(articleContentId, id, network.message(infoParams,ARTICLE_H5INFO,"访客视角-获取文章内容页失败",response.body().asString()));
}
//名片是否展示
......@@ -278,13 +278,13 @@ public class Article {
sellerCardParams.put("configValue",false);
Response response = network.postResponse(sellerCardParams,SELLERCONFIG_EDITCONFIG);
boolean isChanged = response.jsonPath().getBoolean("data");
Assert.assertTrue(isChanged,network.message(sellerCardParams,SELLERCONFIG_EDITCONFIG,"关闭素材头部名片失败"));
Assert.assertTrue(isChanged,network.message(sellerCardParams,SELLERCONFIG_EDITCONFIG,"关闭素材头部名片失败",response.body().asString()));
sellerCardParams.put("configKey","card_show_on_bottom");//素材尾部名片
sellerCardParams.put("configValue",false);
response = network.postResponse(sellerCardParams,SELLERCONFIG_EDITCONFIG);
isChanged = response.jsonPath().getBoolean("data");
Assert.assertTrue(isChanged,network.message(sellerCardParams,SELLERCONFIG_EDITCONFIG,"关闭素材底部名片失败"));
Assert.assertTrue(isChanged,network.message(sellerCardParams,SELLERCONFIG_EDITCONFIG,"关闭素材底部名片失败",response.body().asString()));
//tku 切换为访客的
network.agentCookies.put("tku",VISITOR_TKU);
......@@ -294,7 +294,7 @@ public class Article {
params.put("scid",scid);
response = network.getResponse(params,SELLERCARD_GETSELLERCARDCONFIG);
int openCount = response.jsonPath().getInt("data.findAll {it.val == true}.size()");
Assert.assertEquals(openCount,0,network.message(params,SELLERCARD_GETSELLERCARDCONFIG,"访客视角-名片关闭状态与设置中心不一致"));
Assert.assertEquals(openCount,0,network.message(params,SELLERCARD_GETSELLERCARDCONFIG,"访客视角-名片关闭状态与设置中心不一致",response.body().asString()));
//tku 切换为代理人的
network.agentCookies.put("tku",AGENT_TKU);
......@@ -313,14 +313,14 @@ public class Article {
//再次检查文章内名片展示
response = network.getResponse(params,SELLERCARD_GETSELLERCARDCONFIG);
openCount = response.jsonPath().getInt("data.findAll {it.val == true}.size()");
Assert.assertEquals(openCount,2,network.message(params,SELLERCARD_GETSELLERCARDCONFIG,"访客视角-名片开启状态与设置中心不一致"));
Assert.assertEquals(openCount,2,network.message(params,SELLERCARD_GETSELLERCARDCONFIG,"访客视角-名片开启状态与设置中心不一致",response.body().asString()));
//名片样式
Map<String, Object> styleParams = new HashMap<String, Object>();
styleParams.put("id",scid);
response = network.getResponse(styleParams,SELLERCARD_GETSELLERCARDSTYLE);
String backgroundColor = response.jsonPath().getString("data.find {it.code == 'card_background_color'}.val");
Assert.assertEquals(backgroundColor,"1",network.message(styleParams,SELLERCARD_GETSELLERCARDSTYLE,"访客视角-名片-背景色样式不对"));
Assert.assertEquals(backgroundColor,"1",network.message(styleParams,SELLERCARD_GETSELLERCARDSTYLE,"访客视角-名片-背景色样式不对",response.body().asString()));
}
// 头部名片
......@@ -337,7 +337,7 @@ public class Article {
response = network.getResponse(params,SELLERCARD_TOPOFCONTENT);
String scId = response.jsonPath().getString("data.scid");
String name = response.jsonPath().getString("data.sellerName");
Assert.assertEquals(name,sellerName,"访客-头部名片信息显示有误");
Assert.assertEquals(name,sellerName,network.message(SELLERCARD_TOPOFCONTENT,"访客-头部名片信息显示有误",response.body().asString()));
//获取名片的点赞
Map<String, Object> likeParams = new HashMap<String, Object>();
......@@ -345,13 +345,13 @@ public class Article {
response = network.getResponse(likeParams,HASALREADYLIKE);
boolean favourResult = response.jsonPath().getBoolean("data.favourResult");
int favourTimes =response.jsonPath().getInt("data.favourTimes");
Assert.assertTrue(favourResult,"访客-头部名片点赞数量显示有误");
Assert.assertTrue(favourResult,network.message(likeParams,HASALREADYLIKE,"访客-头部名片点赞数量显示有误",response.body().asString()));
// 点赞名片
likeParams.put("visitTableId",visitId);
response =network.postResponse(likeParams,INTERACTION_LIKE);
boolean isLike = (response.jsonPath().getInt("data.favourTimes") - favourTimes) > 0;
Assert.assertTrue(isLike,"访客-头部名片点赞失败");
Assert.assertTrue(isLike,network.message(likeParams,INTERACTION_LIKE,"访客-头部名片点赞失败",response.body().asString()));
}
// 底部名片
......@@ -368,7 +368,7 @@ public class Article {
params.put("timestamp", System.currentTimeMillis());
response = network.getResponse(params,SELLERCARD_TOPOFCONTENT);
String name = response.jsonPath().getString("data.sellerName");
Assert.assertEquals(name, sellerName,"访客-获取底部名片信息显示有误");
Assert.assertEquals(name, sellerName,network.message(params,SELLERCARD_TOPOFCONTENT,"访客-获取底部名片信息显示有误",response.body().asString()));
}
// 是否爆款素材
......@@ -379,7 +379,7 @@ public class Article {
params.put("id",articleContentId);
Response response = network.getResponse(params,ARTICLE_GETTAGTYPESBYCONTENTID);
boolean isContains = response.jsonPath().getBoolean("data.contains('grass_content')");
Assert.assertTrue(isContains,"访客-类型判断错误-类型应该存在种草素材");
Assert.assertTrue(isContains,network.message(params,ARTICLE_GETTAGTYPESBYCONTENTID,"访客-类型判断错误-类型应该存在种草素材",response.body().asString()));
//获得爆款素材详情
Map<String, Object> infoParams = new HashMap<String, Object>();
......@@ -387,8 +387,8 @@ public class Article {
response = network.getResponse(infoParams,ARTICLE_GETEXPINFO);
String tags = response.jsonPath().getString("data.tags");
String recommendReason = response.jsonPath().getString("data.recommendReason");
Assert.assertNotNull(tags,network.message(infoParams,ARTICLE_GETEXPINFO,"访客-获取文章标签有误"));
Assert.assertNotNull(recommendReason,network.message(infoParams,ARTICLE_GETEXPINFO,"访客-获取文章推荐理由有误"));
Assert.assertNotNull(tags,network.message(infoParams,ARTICLE_GETEXPINFO,"访客-获取文章标签有误",response.body().asString()));
Assert.assertNotNull(recommendReason,network.message(infoParams,ARTICLE_GETEXPINFO,"访客-获取文章推荐理由有误",response.body().asString()));
}
// 获取互动区-专业解读
......@@ -401,7 +401,7 @@ public class Article {
params.put("pageSize",10);
Response response = network.getResponse(params,ARTICLE_ENHANCEDCOLUMN_GETCONTENTS);
boolean hasList = response.jsonPath().getInt("data.list.size()") > 0;
Assert.assertTrue(hasList, network.message(params,ARTICLE_ENHANCEDCOLUMN_GETCONTENTS,"访客-获取专业解读列表有误"));
Assert.assertTrue(hasList, network.message(params,ARTICLE_ENHANCEDCOLUMN_GETCONTENTS,"访客-获取专业解读列表有误",response.body().asString()));
}
// 获取互动区-互动问答
......@@ -414,9 +414,9 @@ public class Article {
params.put("pageSize",3);
Response response = network.getResponse(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS);
int count = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(count,3,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"访客-获取个人专栏列表有误"));
Assert.assertEquals(count,3,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"访客-获取个人专栏列表有误",response.body().asString()));
String answer = response.jsonPath().getString("data.list[0].answer");
Assert.assertNotNull(answer,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"访客-获取问答内容有误"));
Assert.assertNotNull(answer,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"访客-获取问答内容有误",response.body().asString()));
}
// 获取互动区-风险评测
......@@ -428,8 +428,8 @@ public class Article {
Response response = network.getResponse(params,ARTICLE_ISDISPLAYACTIVITY);
boolean isDisplay = response.jsonPath().getBoolean("data.isDisplay");
String riskScid = response.jsonPath().getString("data.scid");
Assert.assertTrue(isDisplay,network.message(params,ARTICLE_ISDISPLAYACTIVITY,"访客-互动区-风险评测显示有误"));
Assert.assertNotNull(riskScid, network.message(params,ARTICLE_ISDISPLAYACTIVITY,"访客-互动区-风险评测内容有误"));
Assert.assertTrue(isDisplay,network.message(params,ARTICLE_ISDISPLAYACTIVITY,"访客-互动区-风险评测显示有误",response.body().asString()));
Assert.assertNotNull(riskScid, network.message(params,ARTICLE_ISDISPLAYACTIVITY,"访客-互动区-风险评测内容有误",response.body().asString()));
}
// 获取代理人个人专栏
......@@ -440,7 +440,7 @@ public class Article {
params.put("scid",scid);
Response response = network.getResponse(params,ARTICLE_GETENHANCEDCOLUMNCONFIG);
boolean isOpen = response.jsonPath().getBoolean("data.find {it.code == 'personal_document_switch'}.val");
Assert.assertTrue(isOpen,network.message(params,ARTICLE_GETENHANCEDCOLUMNCONFIG,"访客-获取代理人日常精准素材个人专栏开关有误"));
Assert.assertTrue(isOpen,network.message(params,ARTICLE_GETENHANCEDCOLUMNCONFIG,"访客-获取代理人日常精准素材个人专栏开关有误",response.body().asString()));
//tku 切换为代理人的
network.agentCookies.put("tku",AGENT_TKU);
......@@ -457,7 +457,7 @@ public class Article {
//再获取代理人个人专栏
response = network.getResponse(params,ARTICLE_GETENHANCEDCOLUMNCONFIG);
isOpen = response.jsonPath().getBoolean("data.find {it.code == 'personal_document_switch'}.val");
Assert.assertFalse(isOpen,network.message(params,ARTICLE_GETENHANCEDCOLUMNCONFIG,"访客-获取代理人日常精准素材个人专栏开关有误"));
Assert.assertFalse(isOpen,network.message(params,ARTICLE_GETENHANCEDCOLUMNCONFIG,"访客-获取代理人日常精准素材个人专栏开关有误",response.body().asString()));
//tku 切换为代理人的
network.agentCookies.put("tku",AGENT_TKU);
......@@ -479,7 +479,7 @@ public class Article {
params.put("t",System.currentTimeMillis());
Response response = network.getResponse(params, CHECKUNREAD);
String desc = response.jsonPath().getString("desc");
Assert.assertEquals(desc,"OK",network.message(params, CHECKUNREAD, "访客-获取私信有误"));
Assert.assertEquals(desc,"OK",network.message(params, CHECKUNREAD, "访客-获取私信有误",response.body().asString()));
}
@AfterClass
......
......@@ -39,8 +39,8 @@ public class Boss {
Response response = network.getResponse(BOSS_VERSIONINFO);
int userVersion = response.jsonPath().getInt("data.find {it.openType == 1}.userVersion");//判断是否为保险版:1是通用版 2是保险版
boolean isVip = response.jsonPath().getBoolean("data.find {it.openType == 1}.vip");//判断是否为会员
Assert.assertEquals(userVersion, 2,network.message(BOSS_VERSIONINFO,"获取版本有误 此版本为非保险版"));
Assert.assertTrue(isVip,network.message(BOSS_VERSIONINFO,"会员判断错误 为非会员"));
Assert.assertEquals(userVersion, 2,network.message(BOSS_VERSIONINFO,"获取版本有误 此版本为非保险版",response.body().asString()));
Assert.assertTrue(isVip,network.message(BOSS_VERSIONINFO,"会员判断错误 为非会员",response.body().asString()));
}
//获取info接口的代理人id
......@@ -49,8 +49,8 @@ public class Boss {
Response response = network.getResponse(BOSS_USERINFO);
sellerId = response.jsonPath().getString("data.sellerId");
sellername = response.jsonPath().getString("data.sellerName");
Assert.assertNotNull(sellerId,network.message(BOSS_USERINFO,"获取sellerid失败"));
Assert.assertNotNull(sellername,network.message(BOSS_USERINFO,"获取sellerName失败"));
Assert.assertNotNull(sellerId,network.message(BOSS_USERINFO,"获取sellerid失败",response.body().asString()));
Assert.assertNotNull(sellername,network.message(BOSS_USERINFO,"获取sellerName失败",response.body().asString()));
}
//代理人有无上下级判断;
......@@ -61,8 +61,8 @@ public class Boss {
Response response = network.getResponse(params,BOSS_ROLE);
boolean hasSubordinate = response.jsonPath().getBoolean("data.hasSubordinate");//判断是否有下级
boolean hasSuperior = response.jsonPath().getBoolean("data.hasSuperior");//判断是否有上级
Assert.assertFalse(hasSubordinate, network.message(params,BOSS_ROLE,"暂无下级"));
Assert.assertFalse(hasSuperior,network.message(params,BOSS_ROLE,"暂无上级"));
Assert.assertFalse(hasSubordinate, network.message(params,BOSS_ROLE,"暂无下级",response.body().asString()));
Assert.assertFalse(hasSuperior,network.message(params,BOSS_ROLE,"暂无上级",response.body().asString()));
}
......@@ -73,7 +73,7 @@ public class Boss {
params.put("inviteType",2);
Response response = network.getResponse(params,BOSS_CODE);
boolean invite = response.jsonPath().getBoolean("success");
Assert.assertTrue(invite,network.message(params,BOSS_CODE,"分享链接失败"));
Assert.assertTrue(invite,network.message(params,BOSS_CODE,"分享链接失败",response.body().asString()));
}
......@@ -86,7 +86,7 @@ public class Boss {
params.put("sellerId",usellerId);
Response response = network.getResponse(params,BOSS_IDENTITY);
int identity = response.jsonPath().getInt("data.identity"); //1团长、2成员、3没有团队
Assert.assertEquals(identity, 3, network.message(params,BOSS_IDENTITY,"被邀请人已有团队或已绑定上级,不能再接受邀请"));
Assert.assertEquals(identity, 3, network.message(params,BOSS_IDENTITY,"被邀请人已有团队或已绑定上级,不能再接受邀请",response.body().asString()));
}
//获取info接口的代理人id
......@@ -95,8 +95,8 @@ public class Boss {
Response response = network.getResponse(BOSS_USERINFO);
usellerId = response.jsonPath().getString("data.sellerId");
visitorame = response.jsonPath().getString("data.sellerName");
Assert.assertNotNull(usellerId,network.message(BOSS_USERINFO,"获取usellerid失败"));
Assert.assertNotNull(visitorame,network.message(BOSS_USERINFO,"获取sellerName失败"));
Assert.assertNotNull(usellerId,network.message(BOSS_USERINFO,"获取usellerid失败",response.body().asString()));
Assert.assertNotNull(visitorame,network.message(BOSS_USERINFO,"获取sellerName失败",response.body().asString()));
}
//邀请结果判断
......@@ -107,14 +107,14 @@ public class Boss {
params.put("inviteType",2);
Response response = network.getResponse(params,BOSS_BOUND);
boolean data = response.jsonPath().getBoolean("data"); //1 true:邀请成功;2 false:邀请失败
Assert.assertTrue(data, network.message(params,BOSS_BOUND,"接受邀请失败"));
Assert.assertTrue(data, network.message(params,BOSS_BOUND,"接受邀请失败",response.body().asString()));
//获取被邀请人上级昵称
Map<String, Object> inviteparams = new HashMap<String, Object>();
params.put("sellerId",usellerId);
Response responses = network.getResponse(inviteparams,BOSS_BOSS);
String name = responses.jsonPath().getString("data");
Assert.assertEquals(name,visitorame,network.message(params,BOSS_BOSS,"昵称不匹配"));
Assert.assertEquals(name,visitorame,network.message(params,BOSS_BOSS,"昵称不匹配",response.body().asString()));
}
//重新获取列表,代理人有无上下级判断;
......@@ -127,8 +127,8 @@ public class Boss {
Response response = network.getResponse(params,BOSS_ROLE);
boolean hasSubordinate = response.jsonPath().getBoolean("data.hasSubordinate");//判断是否有下级
boolean hasSuperior = response.jsonPath().getBoolean("data.hasSuperior");//判断是否有上级
Assert.assertTrue(hasSubordinate, network.message(params,BOSS_ROLE,"暂无下级"));
Assert.assertFalse(hasSuperior,network.message(params,BOSS_ROLE,"暂无上级"));
Assert.assertTrue(hasSubordinate, network.message(params,BOSS_ROLE,"暂无下级",response.body().asString()));
Assert.assertFalse(hasSuperior,network.message(params,BOSS_ROLE,"暂无上级",response.body().asString()));
}
......@@ -141,7 +141,7 @@ public class Boss {
Response response = network.getResponse(params,BOSS_BOSS);
String data = response.jsonPath().getString("data");
superiorname = response.jsonPath().getString("data");
Assert.assertEquals(data,superiorname,network.message(params,BOSS_BOSS,"昵称不匹配"));
Assert.assertEquals(data,superiorname,network.message(params,BOSS_BOSS,"昵称不匹配",response.body().asString()));
}
//获取代理人团队人数
......@@ -151,7 +151,7 @@ public class Boss {
params.put("sellerId",sellerId);
Response response = network.getResponse(params,BOSS_ROLE);
boolean teamNumber = response.jsonPath().getBoolean("data.teamNumber");//获取团队人数包含自己
Assert.assertNotNull(teamNumber,network.message(params,BOSS_ROLE,"获取团队人数失败"));
Assert.assertNotNull(teamNumber,network.message(params,BOSS_ROLE,"获取团队人数失败",response.body().asString()));
}
......@@ -160,7 +160,7 @@ public class Boss {
public void 获取成员sids() throws IOException{
Response response = network.getResponse(BOSS_MEMBER);
sids = response.jsonPath().getString("data.list[0].sellerId");
Assert.assertNotNull(sids,network.message(BOSS_MEMBER,"获取sids失败"));
Assert.assertNotNull(sids,network.message(BOSS_MEMBER,"获取sids失败",response.body().asString()));
}
//移除团队成员
......@@ -172,7 +172,7 @@ public class Boss {
Response response = network.postResponse(params,BOSS_REMOVE);
System.out.println(response.getBody().prettyPrint());
boolean data = response.jsonPath().getBoolean("data"); //true:删除成功;false:删除失败
Assert.assertEquals(data,true,network.message(params,BOSS_REMOVE, "移除失败"));
Assert.assertEquals(data,true,network.message(params,BOSS_REMOVE, "移除失败",response.body().asString()));
}
......@@ -184,7 +184,7 @@ public class Boss {
Response response = network.getResponse(params,BOSS_BOSS);
String data = response.jsonPath().getString("data");
superiorname = response.jsonPath().getString("data");
Assert.assertEquals(data,superiorname,network.message(params,BOSS_BOSS,"昵称不匹配"));
Assert.assertEquals(data,superiorname,network.message(params,BOSS_BOSS,"昵称不匹配",response.body().asString()));
}
......@@ -196,7 +196,7 @@ public class Boss {
params.put("inviteType",2);
Response response = network.getResponse(params,BOSS_CODE);
boolean invite = response.jsonPath().getBoolean("success");
Assert.assertTrue(invite,network.message(params,BOSS_CODE,"分享链接失败"));
Assert.assertTrue(invite,network.message(params,BOSS_CODE,"分享链接失败",response.body().asString()));
}
......
......@@ -36,22 +36,18 @@ public class CircleFriends {
Map<String, Object> params = new HashMap<String, Object>();
Response response = network.getResponse(FRIENDS_ISUSERFIRSTENTERANDCOLLECT);
String desc = response.jsonPath().getString("desc");
Assert.assertEquals(desc,"OK",network.message(FRIENDS_ISUSERFIRSTENTERANDCOLLECT,"是否首次进入和首次收藏发圈素材列表-接口有误"));
Assert.assertEquals(desc,"OK",network.message(FRIENDS_ISUSERFIRSTENTERANDCOLLECT,"是否首次进入和首次收藏发圈素材列表-接口有误",response.body().asString()));
}
// tab列表 后端根据tku自行判断
@Test(description="获取tab列表",priority = 2)
public void 获取tab列表() throws IOException {
Response response = network.getResponse(FRIENDS_GETMATERIALTAGS);
System.out.println("======tab列表=====");
response.body().prettyPrint();
int tabCount = response.jsonPath().getInt("data.size()");
int id = response.jsonPath().getInt("data.find {it.name == '保险'}.id"); //标签tab
firstTagId = response.jsonPath().getInt("data[0].id");//第一个标签的ID
Assert.assertEquals(tabCount,6,network.message(FRIENDS_GETMATERIALTAGS,"获取tab数量有误"));
Assert.assertEquals(id,595,network.message(FRIENDS_GETMATERIALTAGS,"获取tab中不包含保险"));
Assert.assertEquals(tabCount,6,network.message(FRIENDS_GETMATERIALTAGS,"获取tab数量有误",response.body().asString()));
Assert.assertEquals(id,595,network.message(FRIENDS_GETMATERIALTAGS,"获取tab中不包含保险",response.body().asString()));
}
@Test(description="获取推荐(未读)列表",priority = 3)
......@@ -59,14 +55,11 @@ public class CircleFriends {
Map<String, Object> params = new HashMap<String, Object>();
params.put("firstTagId",firstTagId);
Response response = network.getResponse(params,FRIENDS_GETUNREADTIMELINSLIST);
System.out.println("======推荐列表====="+params);
response.body().prettyPrint();
int count = response.jsonPath().getInt("data.size()");
contentId = response.jsonPath().getString("data[0].contentId"); //素材ID
tagId = response.jsonPath().getString("data[0].materialTag"); //素材频道ID
tagName = response.jsonPath().getString("data[0].tagName"); //素材频道名称
Assert.assertEquals(count,30,network.message(params,FRIENDS_GETUNREADTIMELINSLIST,"获取推荐列表有误"));
Assert.assertEquals(count,30,network.message(params,FRIENDS_GETUNREADTIMELINSLIST,"获取推荐列表有误",response.body().asString()));
}
@Test(description="获取全部列表",priority = 4)
......@@ -87,12 +80,8 @@ public class CircleFriends {
params.put("contentId",contentId);
params.put("firstTagId",firstTagId);
Response response = network.postResponse(params,FRIENDS_ASYNCMARKTIMELINEREAD);
System.out.println("====标记为已读===="+params);
response.body().prettyPrint();
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,FRIENDS_ASYNCMARKTIMELINEREAD,"标记已读-接口有误"));
Assert.assertTrue(data,network.message(params,FRIENDS_ASYNCMARKTIMELINEREAD,"标记已读-接口有误",response.body().asString()));
//延迟2秒,存入ES
Thread.sleep(2000);
......@@ -101,7 +90,7 @@ public class CircleFriends {
response = network.getResponse(params,FRIENDS_GETUNREADTIMELINSLIST);
List<String> contentList = response.jsonPath().getList("data.contentId");
boolean unRead = contentList.contains(contentId); //检查是否未读,false为已读,true为未读
Assert.assertFalse(unRead,network.message(params,FRIENDS_GETUNREADTIMELINSLIST,"已读后,未读接口没有过滤已读素材"));
Assert.assertFalse(unRead,network.message(params,FRIENDS_GETUNREADTIMELINSLIST,"已读后,未读接口没有过滤已读素材",response.body().asString()));
}
@Test(description="收藏素材",priority = 6)
......@@ -111,23 +100,20 @@ public class CircleFriends {
params.put("contentId",contentId);
params.put("operate",1);
Response response = network.getResponse(params,FRIENDS_ADDORCANCELCOLLECT);
System.out.println("====收藏素材===="+params);
response.body().prettyPrint();
boolean isAdd = response.jsonPath().getBoolean("data");
Assert.assertTrue(isAdd,network.message(params,FRIENDS_ADDORCANCELCOLLECT,"收藏素材失败"));
Assert.assertTrue(isAdd,network.message(params,FRIENDS_ADDORCANCELCOLLECT,"收藏素材失败",response.body().asString()));
// 查看收藏列表
params.put("pageSize",12);
response = network.getResponse(params,FRIENDS_QUERYLISTFORCOLLECT);
String collectContentId = response.jsonPath().getString("data[0].contentId");
Assert.assertEquals(collectContentId,contentId,network.message(params,FRIENDS_QUERYLISTFORCOLLECT,"收藏列表有误"));
Assert.assertEquals(collectContentId,contentId,network.message(params,FRIENDS_QUERYLISTFORCOLLECT,"收藏列表有误",response.body().asString()));
// 取消收藏
params.put("operate",2);
response = network.getResponse(params,FRIENDS_ADDORCANCELCOLLECT);
boolean isCancel = response.jsonPath().getBoolean("data");
Assert.assertTrue(isCancel,network.message(params,FRIENDS_ADDORCANCELCOLLECT,"取消收藏素材失败"));
Assert.assertTrue(isCancel,network.message(params,FRIENDS_ADDORCANCELCOLLECT,"取消收藏素材失败",response.body().asString()));
}
@Test(description="素材频道页",priority = 7)
......@@ -136,11 +122,8 @@ public class CircleFriends {
Map<String, Object> params = new HashMap<String, Object>();
params.put("tagId",tagId);
Response response = network.getResponse(params,FRIENDS_CHANNELDETAIL);
System.out.println("====频道页===="+params);
response.body().prettyPrint();
String name = response.jsonPath().getString("data.tagName");
Assert.assertEquals(name,tagName,network.message(params,FRIENDS_CHANNELDETAIL,"素材频道页-头部获取有误"));
Assert.assertEquals(name,tagName,network.message(params,FRIENDS_CHANNELDETAIL,"素材频道页-头部获取有误",response.body().asString()));
//频道页 列表
params.put("pageSize",10);
......@@ -148,8 +131,8 @@ public class CircleFriends {
response = network.getResponse(params,FRIENDS_GETCHANNELLIST);
String collectTagtId = response.jsonPath().getString("data[0].materialTag"); //素材ID
boolean hasList = response.jsonPath().getInt("data.size()") > 0;
Assert.assertEquals(collectTagtId,tagId,network.message(params,FRIENDS_GETCHANNELLIST, "素材列表获取有误"));
Assert.assertTrue(hasList,network.message(params,FRIENDS_GETCHANNELLIST,"素材频道列表-获取有误"));
Assert.assertEquals(collectTagtId,tagId,network.message(params,FRIENDS_GETCHANNELLIST, "素材列表获取有误",response.body().asString()));
Assert.assertTrue(hasList,network.message(params,FRIENDS_GETCHANNELLIST,"素材频道列表-获取有误",response.body().asString()));
}
@Test(description="从首页发圈列表页进入",priority = 8)
......@@ -157,7 +140,7 @@ public class CircleFriends {
// 获取首页发圈素材列表
Response response = network.getResponse(HOME_GETHOMETIMELINECONTENT);
String currentId = response.jsonPath().getString("data.materialVos[0].contentId");
Assert.assertNotNull(currentId,network.message(HOME_GETHOMETIMELINECONTENT,"获取首页发圈列表有误"));
Assert.assertNotNull(currentId,network.message(HOME_GETHOMETIMELINECONTENT,"获取首页发圈列表有误",response.body().asString()));
// 如果有推荐列表,进入发圈
if (currentId.length() > 0){
......@@ -165,7 +148,7 @@ public class CircleFriends {
params.put("currentId",currentId);
response = network.getResponse(params,FRIENDS_GETCURRENTINFO);
String topContentId = response.jsonPath().getString("data.contentId");
Assert.assertEquals(topContentId,currentId,network.message(params,FRIENDS_GETCURRENTINFO,"从首页进入发圈的头部素材有误"));
Assert.assertEquals(topContentId,currentId,network.message(params,FRIENDS_GETCURRENTINFO,"从首页进入发圈的头部素材有误",response.body().asString()));
}
}
......
......@@ -33,7 +33,7 @@ public class GreetingCard {
public void BANNER() throws IOException {
Response response = network.getResponse(GREETING_BANNER);
boolean hasList = response.jsonPath().getInt("data.size()") > 0;
Assert.assertTrue(hasList,network.message(GREETING_BANNER,"获取Banner列表失败"));
Assert.assertTrue(hasList,network.message(GREETING_BANNER,"获取Banner列表失败",response.body().asString()));
}
// 转发最多
......@@ -41,7 +41,7 @@ public class GreetingCard {
public void 大家都在发() throws IOException {
Response response = network.getResponse(GREETING_ALLFORWARD);
boolean hasList = response.jsonPath().getInt("data.size()") > 0;
Assert.assertTrue(hasList,network.message(GREETING_ALLFORWARD,"获取大家都在发列表失败"));
Assert.assertTrue(hasList,network.message(GREETING_ALLFORWARD,"获取大家都在发列表失败",response.body().asString()));
}
// 贺卡tab
......@@ -53,7 +53,7 @@ public class GreetingCard {
Response response = network.getResponse(params,GREETING_FINDBYTYPE);
int totalCount = response.jsonPath().getInt("data.list.size()");
tagId = response.jsonPath().getInt("data.list[-1].id");
Assert.assertEquals(totalCount,3,network.message(params,GREETING_FINDBYTYPE,"获取贺卡tab失败"));
Assert.assertEquals(totalCount,3,network.message(params,GREETING_FINDBYTYPE,"获取贺卡tab失败",response.body().asString()));
}
// 获取539的贺卡列表
......@@ -68,7 +68,7 @@ public class GreetingCard {
boolean hasList = response.jsonPath().getInt("data.list.size()") > 0;
contentId = response.jsonPath().getString("data.list[0].id");
greetingName = response.jsonPath().getString("data.list[0].title");
Assert.assertTrue(hasList,network.message(params,GREETING_PAGELIST,"获取贺卡tab失败"));
Assert.assertTrue(hasList,network.message(params,GREETING_PAGELIST,"获取贺卡tab失败",response.body().asString()));
}
// 贺卡详情页
......@@ -85,7 +85,7 @@ public class GreetingCard {
infoParams.put("scid",scid);
response = network.getResponse(infoParams,GREETING_H5INFO);
String name = response.jsonPath().getString("data.title");
Assert.assertEquals(name,greetingName, network.message(infoParams,GREETING_H5INFO,"获取贺卡信息失败"));
Assert.assertEquals(name,greetingName, network.message(infoParams,GREETING_H5INFO,"获取贺卡信息失败",response.body().asString()));
}
// 获取H5分享信息
......@@ -102,7 +102,7 @@ public class GreetingCard {
response = network.getResponse(shareParams,GREETING_H5SHARE);
shareId = response.jsonPath().getString("data.id");
String title = response.jsonPath().getString("data.title");
Assert.assertEquals(title,greetingName,network.message(shareParams,GREETING_H5SHARE,"获取H5分享信息失败"));
Assert.assertEquals(title,greetingName,network.message(shareParams,GREETING_H5SHARE,"获取H5分享信息失败",response.body().asString()));
}
// 我送出的贺卡列表
......@@ -113,7 +113,7 @@ public class GreetingCard {
params.put("pageSize", 10);
Response response = network.getResponse(params,GREETING_CONFLIST);
boolean hasList = response.jsonPath().getInt("data.list.size()") > 0;
Assert.assertFalse(hasList,network.message(params,GREETING_CONFLIST,"获取我的贺卡初始列表数量有误"));
Assert.assertFalse(hasList,network.message(params,GREETING_CONFLIST,"获取我的贺卡初始列表数量有误",response.body().asString()));
}
......
......@@ -28,7 +28,7 @@ public class Novice {
public void 会员判断() throws IOException{
Response response = network.getResponse(ISVIPSUBSCRIBE);
boolean isVip = response.jsonPath().getBoolean("data.vip");
Assert.assertTrue(true, network.message(ISVIPSUBSCRIBE,"新手任务-会员判断错误"));
Assert.assertTrue(true, network.message(ISVIPSUBSCRIBE,"新手任务-会员判断错误",response.body().asString()));
}
//用户信息
......@@ -36,7 +36,7 @@ public class Novice {
public void 用户信息()throws IOException{
Response response = network.getResponse(USER_INFO);
String wxName = response.jsonPath().getString("data.wxName");
Assert.assertEquals(wxName,"Su Yi",network.message(USER_INFO,"新手任务-获取用户信息失败"));
Assert.assertEquals(wxName,"Su Yi",network.message(USER_INFO,"新手任务-获取用户信息失败",response.body().asString()));
}
//新手任务列表
......@@ -45,7 +45,7 @@ public class Novice {
Response response = network.getResponse(NOVICE_LIST);
System.out.println(response.getBody().prettyPrint());
int length = response.jsonPath().getInt("data.size()");
Assert.assertEquals(length,12,network.message(NOVICE_LIST,"新手任务-任务列表数量不对"));
Assert.assertEquals(length,12,network.message(NOVICE_LIST,"新手任务-任务列表数量不对",response.body().asString()));
}
// 关注公众号 需要微信回调,无法实现
......@@ -71,7 +71,7 @@ public class Novice {
Response response = network.getResponse(NOVICE_LIST);
//获取任务名为"转发文章"的任务状态 code: 0未完成 1可领奖励 2已完成
int code = response.jsonPath().getInt("data.find {it.taskName == '转发文章'}.taskStatus.code");
Assert.assertEquals(code,0,network.message(NOVICE_LIST,"转发文章-任务初始状态 获取失败"));
Assert.assertEquals(code,0,network.message(NOVICE_LIST,"转发文章-任务初始状态 获取失败",response.body().asString()));
//转发文章到朋友圈
Map<String, Object> params = new HashMap<String, Object>();
......@@ -79,13 +79,13 @@ public class Novice {
params.put("forwardType",1);// 1:个人/微信群 2:朋友圈
response = network.getResponse(params,FORWARD);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, FORWARD,"转发文章-转发到朋友圈 失败"));
Assert.assertTrue(data, network.message(params, FORWARD,"转发文章-转发到朋友圈 失败",response.body().asString()));
//重新获取任务名为"转发文章"的任务状态,验证任务是否生效
response = network.getResponse(NOVICE_LIST);
//获取任务名为"转发文章"的任务状态 code: 0未完成 1可领奖励 2已完成
code = response.jsonPath().getInt("data.find {it.taskName == '转发文章'}.taskStatus.code");
Assert.assertEquals(code,1,network.message(NOVICE_LIST,"转发文章-新手任务完成状态 获取失败"));
Assert.assertEquals(code,1,network.message(NOVICE_LIST,"转发文章-新手任务完成状态 获取失败",response.body().asString()));
}
// 转发动画
......@@ -95,7 +95,7 @@ public class Novice {
Response response = network.getResponse(NOVICE_LIST);
//获取任务名为"转发动画"的任务状态 code: 0未完成 1可领奖励 2已完成
int code = response.jsonPath().getInt("data.find {it.taskName == '转发动画'}.taskStatus.code");
Assert.assertEquals(code,0, network.message(NOVICE_LIST,"转发动画-任务初始状态 获取失败"));
Assert.assertEquals(code,0, network.message(NOVICE_LIST,"转发动画-任务初始状态 获取失败",response.body().asString()));
//转发动画到朋友圈
Map<String, Object> params = new HashMap<String, Object>();
......@@ -103,13 +103,13 @@ public class Novice {
params.put("forwardType",2);// 1:个人/微信群 2:朋友圈
response = network.getResponse(params,FORWARD);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, FORWARD,"转发动画-转发到朋友圈 失败"));
Assert.assertTrue(data, network.message(params, FORWARD,"转发动画-转发到朋友圈 失败",response.body().asString()));
//重新获取任务名为"转发动画"的任务状态,验证任务是否生效
response = network.getResponse(NOVICE_LIST);
//获取任务名为"转发动画"的任务状态 code: 0未完成 1可领奖励 2已完成
code = response.jsonPath().getInt("data.find {it.taskName == '转发动画'}.taskStatus.code");
Assert.assertEquals(code,1,network.message(NOVICE_LIST,"转发动画-新手任务完成状态 获取失败"));
Assert.assertEquals(code,1,network.message(NOVICE_LIST,"转发动画-新手任务完成状态 获取失败",response.body().asString()));
}
// 转发游戏
......@@ -119,7 +119,7 @@ public class Novice {
Response response = network.getResponse(NOVICE_LIST);
//获取任务名为"转发游戏"的任务状态 code: 0未完成 1可领奖励 2已完成
int code = response.jsonPath().getInt("data.find {it.taskName == '转发游戏(内测中)'}.taskStatus.code");
Assert.assertEquals(code,0,network.message(NOVICE_LIST,"转发游戏-任务初始状态 获取失败"));
Assert.assertEquals(code,0,network.message(NOVICE_LIST,"转发游戏-任务初始状态 获取失败",response.body().asString()));
//转发游戏到朋友圈
Map<String, Object> params = new HashMap<String, Object>();
......@@ -127,13 +127,13 @@ public class Novice {
params.put("forwardType",2);// 1:个人/微信群 2:朋友圈
response = network.getResponse(params,FORWARD);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,FORWARD,"转发游戏-转发到朋友圈 失败"));
Assert.assertTrue(data,network.message(params,FORWARD,"转发游戏-转发到朋友圈 失败",response.body().asString()));
//重新获取任务名为"转发游戏"的任务状态,验证任务是否生效
response = network.getResponse(NOVICE_LIST);
//获取任务名为"转发游戏"的任务状态 code: 0未完成 1可领奖励 2已完成
code = response.jsonPath().getInt("data.find {it.taskName == '转发游戏(内测中)'}.taskStatus.code");
Assert.assertEquals(code,1,network.message(NOVICE_LIST,"转发游戏-新手任务完成状态 获取失败"));
Assert.assertEquals(code,1,network.message(NOVICE_LIST,"转发游戏-新手任务完成状态 获取失败",response.body().asString()));
}
//上传文章
......@@ -144,7 +144,7 @@ public class Novice {
//获取任务名为"上传文章"的任务状态 code: 0未完成 1可领奖励 2已完成
int code = response.jsonPath().getInt("data.find {it.taskName == '上传文章'}.taskStatus.code");
Assert.assertEquals(code,0,network.message(NOVICE_LIST,"上传文章-任务初始状态 获取失败"));
Assert.assertEquals(code,0,network.message(NOVICE_LIST,"上传文章-任务初始状态 获取失败",response.body().asString()));
//上传文章并发到朋友圈 (文章已经在上传case执行过,所以找到那篇文章进行转发就好)
Map<String, Object> params = new HashMap<String, Object>();
......@@ -157,7 +157,7 @@ public class Novice {
response = network.getResponse(params,UPLOAD_LIST);
String contentType = response.jsonPath().getString("data[0].contentType");
String contentId = response.jsonPath().getString("data[0].id");//获取文章的contentd
Assert.assertEquals(contentType, "article", network.message(params, UPLOAD_LIST,"上传文章-获取我的上传-文章列表数量有误"));
Assert.assertEquals(contentType, "article", network.message(params, UPLOAD_LIST,"上传文章-获取我的上传-文章列表数量有误",response.body().asString()));
......@@ -168,13 +168,13 @@ public class Novice {
shareParams.put("forwardType",2);
response = network.getResponse(shareParams,FORWARD);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(shareParams, FORWARD,"上传文章-发到朋友圈 失败"));
Assert.assertTrue(data,network.message(shareParams, FORWARD,"上传文章-发到朋友圈 失败",response.body().asString()));
//重新获取任务名为"上传文章"的任务状态,验证任务是否生效
response = network.getResponse(NOVICE_LIST);
//获取任务名为"上传文章"的任务状态 code: 0未完成 1可领奖励 2已完成
code = response.jsonPath().getInt("data.find {it.taskName == '上传文章'}.taskStatus.code");
Assert.assertEquals(code,1,network.message(NOVICE_LIST,"上传文章-完成新手任务 失败"));
Assert.assertEquals(code,1,network.message(NOVICE_LIST,"上传文章-完成新手任务 失败",response.body().asString()));
}
// 收到好友转发访问 该接口已废弃
......@@ -217,7 +217,7 @@ public class Novice {
//获取任务名为"查看访问客户"的任务状态 code: 0未完成 1可领奖励 2已完成
int code = response.jsonPath().getInt("data.find {it.taskName == '查看访问客户'}.taskStatus.code");
Assert.assertEquals(code,0,network.message(NOVICE_LIST,"获取新手任务初始状态-查看访问客户 失败"));
Assert.assertEquals(code,0,network.message(NOVICE_LIST,"获取新手任务初始状态-查看访问客户 失败",response.body().asString()));
//好友转发一篇我的素材
network.agentCookies.put("tku",VISITOR_TKU); //tku 切换为访客的
......@@ -226,7 +226,7 @@ public class Novice {
params.put("forwardType",2);// 1:个人/微信群 2:朋友圈
response = network.getResponse(params,FORWARD);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(params,FORWARD,"查看访问客户-好友转发到朋友圈 失败"));
Assert.assertTrue(data,network.message(params,FORWARD,"查看访问客户-好友转发到朋友圈 失败",response.body().asString()));
network.agentCookies.put("tku",AGENT_TKU); //tku 切换为代理人的
//进入谁看过我,查看访客列表
......@@ -236,7 +236,7 @@ public class Novice {
response = network.getResponse(whoSawMeParams, WHOSAWME_CUSTCLUELISTV2);
boolean hasnext = response.jsonPath().getBoolean("data.hasNext");
int length = response.jsonPath().getInt("data.list.size()");
Assert.assertNotEquals(0,network.message(whoSawMeParams, WHOSAWME_CUSTCLUELISTV2,"获取谁看过我列表成功"));
Assert.assertNotEquals(0,network.message(whoSawMeParams, WHOSAWME_CUSTCLUELISTV2,"获取谁看过我列表成功",response.body().asString()));
//点击查看,进入线索详情页
Map<String, Object> noviceParams = new HashMap<String, Object>();
......@@ -248,7 +248,7 @@ public class Novice {
response = network.getResponse(NOVICE_LIST);
//获取任务名为"查看访问客户"的任务状态 code: 0未完成 1可领奖励 2已完成
code = response.jsonPath().getInt("data.find {it.taskName == '查看访问客户'}.taskStatus.code");
Assert.assertEquals(code,1, network.message(NOVICE_LIST,"查看访问客户-新手任务完成状态 获取失败"));
Assert.assertEquals(code,1, network.message(NOVICE_LIST,"查看访问客户-新手任务完成状态 获取失败",response.body().asString()));
}
//完善名片 名片改动,此处始终会处于未完成状态,待产品优化
......@@ -259,7 +259,7 @@ public class Novice {
//获取任务名为"完善名片"的任务状态 code: 0未完成 1可领奖励 2已完成
int code = response.jsonPath().getInt("data.find {it.taskName == '完善名片'}.taskStatus.code");
Assert.assertEquals(code,0, network.message(NOVICE_LIST,"获取新手任务初始状态-完善名片 失败"));
Assert.assertEquals(code,0, network.message(NOVICE_LIST,"获取新手任务初始状态-完善名片 失败",response.body().asString()));
//完善名片
......@@ -274,7 +274,7 @@ public class Novice {
params.put("contentId",contentId);
Response response = network.getResponse(params, GETSCID);
String scId = response.jsonPath().getString("data");
Assert.assertNotNull(scId,network.message(params, GETSCID,"获取scId失败"));
Assert.assertNotNull(scId,network.message(params, GETSCID,"获取scId失败",response.body().asString()));
return scId;
}
......
......@@ -31,27 +31,27 @@ public class Pay {
@Test (description = "默认付费_付费页",priority = 1) //priorty 方法执行优先级
public void 默认付费_付费页() throws IOException {
//付款中间页判断
Response skipTypeResponse = network.getResponse(PAY_GETMIDDLEDETAIL);
int skipType = skipTypeResponse.jsonPath().getInt("data.skipType");
Assert.assertEquals(skipType,2,network.message(PAY_GETMIDDLEDETAIL,"付款中间页:不是2020新版"));
Response response = network.getResponse(PAY_GETMIDDLEDETAIL);
int skipType = response.jsonPath().getInt("data.skipType");
Assert.assertEquals(skipType,2,network.message(PAY_GETMIDDLEDETAIL,"付款中间页:不是2020新版",response.body().asString()));
//会销资格判断
Response SiteSaleValidresponse = network.getResponse(PAY_HASSITESALEVALID);
boolean siteSaleValid = SiteSaleValidresponse.jsonPath().getBoolean("data");
Assert.assertEquals(siteSaleValid,false,network.message(PAY_HASSITESALEVALID,"会销资格判断:判断错误,有会销资格"));
response = network.getResponse(PAY_HASSITESALEVALID);
boolean siteSaleValid = response.jsonPath().getBoolean("data");
Assert.assertEquals(siteSaleValid,false,network.message(PAY_HASSITESALEVALID,"会销资格判断:判断错误,有会销资格",response.body().asString()));
//会员类型版本判断
Map<String, Object> params = new HashMap<String, Object>();
params.put("t",System.currentTimeMillis());
Response userVersionResponse = network.getResponse(params, VERSION_INFO);
int userVersion = userVersionResponse.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型 1为通用版 2为保险版
Assert.assertEquals(userVersion,2,network.message(params, VERSION_INFO,"会员类型版本判断:判断错误,此版本为通用版"));
response = network.getResponse(params, VERSION_INFO);
int userVersion = response.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型 1为通用版 2为保险版
Assert.assertEquals(userVersion,2,network.message(params, VERSION_INFO,"会员类型版本判断:判断错误,此版本为通用版",response.body().asString()));
//获取当前用户可用优惠码
Response promoCodeResponse = network.getResponse(params,PAY_GETPROMOCODE);
String promoCode = promoCodeResponse.jsonPath().getString("data");
Assert.assertEquals(promoCode,null, network.message(params,PAY_GETPROMOCODE,"是否优惠判断:判断错误,当前有优惠"));
response = network.getResponse(params,PAY_GETPROMOCODE);
String promoCode = response.jsonPath().getString("data");
Assert.assertEquals(promoCode,null, network.message(params,PAY_GETPROMOCODE,"是否优惠判断:判断错误,当前有优惠",response.body().asString()));
//获取付费价格
// Response actualPayMoneyResponse = network.getResponse(PAY_COMBOLIST);
......@@ -69,10 +69,9 @@ public class Pay {
payParams.put("paySource","2");
payParams.put("sellerFrom","");
Response orderAppId = network.postResponse(payParams,PAY_ORDERCREATE);
String appId = orderAppId.jsonPath().getString("data.appId");
Assert.assertEquals(appId,"wxcb8c36279dd7dff2",network.message(payParams, PAY_ORDERCREATE,"拉起支付:拉起微信支付失败")); //判断返回的微信调起参数中appId是否正确
orderAppId.body().prettyPrint();
Response response = network.postResponse(payParams,PAY_ORDERCREATE);
String appId = response.jsonPath().getString("data.appId");
Assert.assertEquals(appId,"wxcb8c36279dd7dff2",network.message(payParams, PAY_ORDERCREATE,"拉起支付:拉起微信支付失败",response.body().asString())); //判断返回的微信调起参数中appId是否正确
}
@Test (description = "默认付费_取消支付",priority = 3)
......@@ -84,15 +83,15 @@ public class Pay {
payParams.put("oaId","1");
payParams.put("paySource","2");
payParams.put("sellerFrom","");
Response orderAppId = network.postResponse(payParams,PAY_ORDERCREATE);
String tradeNo = orderAppId.jsonPath().getString("data.tradeNo");
Response response = network.postResponse(payParams,PAY_ORDERCREATE);
String tradeNo = response.jsonPath().getString("data.tradeNo");
//会员类型版本判断
Map<String, Object> cancelParams = new HashMap<String, Object>();
cancelParams.put("tradeNo",tradeNo);
Response resultResponse = network.getResponse(cancelParams,PAY_ORDERCANCEL);
String result = resultResponse.jsonPath().getString("desc");
Assert.assertEquals(result,"OK",network.message(cancelParams, PAY_ORDERCANCEL,"取消支付:取消支付失败")); //判断返回的微信调起参数中appId是否正确
response = network.getResponse(cancelParams,PAY_ORDERCANCEL);
String result = response.jsonPath().getString("desc");
Assert.assertEquals(result,"OK",network.message(cancelParams, PAY_ORDERCANCEL,"取消支付:取消支付失败",response.body().asString())); //判断返回的微信调起参数中appId是否正确
}
// @Test (description = "默认付费_成功支付",priority = 4)
......@@ -105,23 +104,23 @@ public class Pay {
//会员类型版本判断
Map<String, Object> params = new HashMap<String, Object>();
params.put("t",System.currentTimeMillis());
Response userVersionResponse = network.getResponse(params,VERSION_INFO);
int userVersion = userVersionResponse.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型
Response response = network.getResponse(params,VERSION_INFO);
int userVersion = response.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型
int changeVersion = userVersion == 1 ? 2 : 1; // 判断当前开启的版本,如果当前版本是1,则改为2,反之;
//切换版本
Map<String, Object> versionParams = new HashMap<String, Object>();
versionParams.put("targetVersion",changeVersion);
Response resultResponse = network.postResponse(versionParams,PAY_VERSIONEXCHANGE);
String result = resultResponse.jsonPath().getString("desc");
Assert.assertEquals(result,"OK",network.message(versionParams,PAY_VERSIONEXCHANGE,"会员类型切换:切换失败")); //判断返回的微信调起参数中appId是否正确
response = network.postResponse(versionParams,PAY_VERSIONEXCHANGE);
String result = response.jsonPath().getString("desc");
Assert.assertEquals(result,"OK",network.message(versionParams,PAY_VERSIONEXCHANGE,"会员类型切换:切换失败",response.body().asString())); //判断返回的微信调起参数中appId是否正确
//会员类型再次判断
params.put("t",System.currentTimeMillis());
userVersionResponse = network.getResponse(params,VERSION_INFO);
userVersion = userVersionResponse.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型
Assert.assertEquals(userVersion,changeVersion,network.message(params, VERSION_INFO,"会员类型版本判断:判断错误,此版本为尊享版"));
response = network.getResponse(params,VERSION_INFO);
userVersion = response.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型
Assert.assertEquals(userVersion,changeVersion,network.message(params, VERSION_INFO,"会员类型版本判断:判断错误,此版本为尊享版",response.body().asString()));
}
/*// 支付成功回调
......
......@@ -31,14 +31,14 @@ public class SellerCard {
Response response = network.getResponse(params, VERSION_INFO);
int userVersion = response.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型
Assert.assertEquals(userVersion, 2, network.message(params, VERSION_INFO,"会员类型版本判断:判断错误,此版本为通用版"));
Assert.assertEquals(userVersion, 2, network.message(params, VERSION_INFO,"会员类型版本判断:判断错误,此版本为通用版",response.body().asString()));
}
@Test(description = "是否关注红号", priority = 2) //priorty 方法执行优先级
public void 是否关注红号() throws IOException {
Response response = network.getResponse(ISVIPSUBSCRIBE);
boolean vipSubscribe = response.jsonPath().getBoolean("data.vipSubscribe");
Assert.assertFalse(false, network.message(ISVIPSUBSCRIBE,"vip号是否关注判断错误"));
Assert.assertFalse(false, network.message(ISVIPSUBSCRIBE,"vip号是否关注判断错误",response.body().asString()));
}
......@@ -50,7 +50,7 @@ public class SellerCard {
sellerId = response.jsonPath().getString("data.sellerId");
String sellerName = response.jsonPath().getString("data.sellerName");
Assert.assertEquals(sellerName, WECHAT_NAME, network.message(SELLERCARD_TOPOFDETAIL,"获取用户失败"));
Assert.assertEquals(sellerName, WECHAT_NAME, network.message(SELLERCARD_TOPOFDETAIL,"获取用户失败",response.body().asString()));
//修改用户信息
Map<String, Object> params = new HashMap<String, Object>();
......@@ -62,7 +62,7 @@ public class SellerCard {
params.put("avatarStyle", 3);
Response editRsponse = network.postResponse(params, SELLERCARD_EDITBASEINFO);
boolean isChanged = editRsponse.jsonPath().getBoolean("success");
Assert.assertTrue(isChanged, network.message(params, SELLERCARD_EDITBASEINFO,"修改用户信息无效"));
Assert.assertTrue(isChanged, network.message(params, SELLERCARD_EDITBASEINFO,"修改用户信息无效",response.body().asString()));
//重新获取用户信息
response = network.getResponse(SELLERCARD_TOPOFDETAIL);
......@@ -71,10 +71,10 @@ public class SellerCard {
String wechatNumber = response.jsonPath().getString("data.wechatNumber");
String address = response.jsonPath().getString("data.address");
int avatarStyle = response.jsonPath().getInt("data.avatarStyle");
Assert.assertEquals(sellerName, "测试123", network.message(SELLERCARD_TOPOFDETAIL,"修改后的姓名不正确"));
Assert.assertEquals(phoneNumber, "13012341234", network.message(SELLERCARD_TOPOFDETAIL,"修改后的手机号不正确"));
Assert.assertEquals(wechatNumber, "wx123456", network.message(SELLERCARD_TOPOFDETAIL,"修改后的微信号不正确"));
Assert.assertEquals(address, "杭州数娱大厦(文一西路98号)", network.message(SELLERCARD_TOPOFDETAIL,"修改后的地址不正确"));
Assert.assertEquals(sellerName, "测试123", network.message(SELLERCARD_TOPOFDETAIL,"修改后的姓名不正确",response.body().asString()));
Assert.assertEquals(phoneNumber, "13012341234", network.message(SELLERCARD_TOPOFDETAIL,"修改后的手机号不正确",response.body().asString()));
Assert.assertEquals(wechatNumber, "wx123456", network.message(SELLERCARD_TOPOFDETAIL,"修改后的微信号不正确",response.body().asString()));
Assert.assertEquals(address, "杭州数娱大厦(文一西路98号)", network.message(SELLERCARD_TOPOFDETAIL,"修改后的地址不正确",response.body().asString()));
}
@Test(description = "专业介绍", priority = 4)
......@@ -83,7 +83,7 @@ public class SellerCard {
params.put("scid", scid);
Response response = network.getResponse(params, SELLERCARD_PERSONALPROFILE);
int exprLength = response.jsonPath().getInt("data.exprLength"); //工作年限
Assert.assertEquals(exprLength, 0, network.message(params, SELLERCARD_PERSONALPROFILE,"个人介绍-获取工作年限不匹配"));
Assert.assertEquals(exprLength, 0, network.message(params, SELLERCARD_PERSONALPROFILE,"个人介绍-获取工作年限不匹配",response.body().asString()));
//修改工作年限和个人介绍
......@@ -92,7 +92,7 @@ public class SellerCard {
baseParams.put("personalIntro", "我在行业内整挺好!");
Response baseResponse = network.postResponse(baseParams, SELLERCARD_EDITBASEINFO);
boolean isChanged = baseResponse.jsonPath().getBoolean("success");
Assert.assertTrue(isChanged, network.message(baseParams, SELLERCARD_EDITBASEINFO,"修改工作年限和个人介绍无效"));
Assert.assertTrue(isChanged, network.message(baseParams, SELLERCARD_EDITBASEINFO,"修改工作年限和个人介绍无效",response.body().asString()));
//修改擅长专业
Map<String, Object> personalParams = new HashMap<String, Object>();
......@@ -100,16 +100,16 @@ public class SellerCard {
personalParams.put("goodAtDefault", "16");
Response personalResponse = network.postResponse(personalParams, SELLERCARD_EDITMAJORGOODAUTH);
isChanged = personalResponse.jsonPath().getBoolean("success");
Assert.assertTrue(isChanged, network.message(personalParams, SELLERCARD_EDITBASEINFO,"修改擅长专业无效"));
Assert.assertTrue(isChanged, network.message(personalParams, SELLERCARD_EDITBASEINFO,"修改擅长专业无效",response.body().asString()));
//查看修改后的专业介绍
response = network.getResponse(params, SELLERCARD_PERSONALPROFILE);
String intro = response.jsonPath().getString("data.personalIntro"); //个人介绍
exprLength = response.jsonPath().getInt("data.exprLength"); //工作年限
boolean isChooseGoodAtDefault = response.jsonPath().getBoolean("data.goodAtMajor.find {it.code == '16'}.choose");
Assert.assertEquals(intro, "我在行业内整挺好!", network.message(params, SELLERCARD_PERSONALPROFILE,"修改个人介绍失败"));
Assert.assertEquals(exprLength, 2, network.message(params, SELLERCARD_PERSONALPROFILE,"修改工作年限失败"));
Assert.assertTrue(isChooseGoodAtDefault, network.message(params, SELLERCARD_PERSONALPROFILE,"选择默认擅长专业失效"));
Assert.assertEquals(intro, "我在行业内整挺好!", network.message(params, SELLERCARD_PERSONALPROFILE,"修改个人介绍失败",response.body().asString()));
Assert.assertEquals(exprLength, 2, network.message(params, SELLERCARD_PERSONALPROFILE,"修改工作年限失败",response.body().asString()));
Assert.assertTrue(isChooseGoodAtDefault, network.message(params, SELLERCARD_PERSONALPROFILE,"选择默认擅长专业失效",response.body().asString()));
}
@Test(description = "客户评价", priority = 5) //priorty 方法执行优先级
......@@ -123,12 +123,12 @@ public class SellerCard {
Response response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW);
boolean hasAppraise = response.jsonPath().getInt("data.appraiseList.totalCount") > 0;
Assert.assertTrue(hasAppraise, network.message(params, SELLERCARD_APPRAISELISTNEW,"获取用户评价失败"));
Assert.assertTrue(hasAppraise, network.message(params, SELLERCARD_APPRAISELISTNEW,"获取用户评价失败",response.body().asString()));
params.put("isPersonal", true);
response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW);
hasAppraise = response.jsonPath().getInt("data.appraiseList.totalCount") == 0;
Assert.assertTrue(hasAppraise, network.message(params, SELLERCARD_APPRAISELISTNEW,"获取专业评价失败"));
Assert.assertTrue(hasAppraise, network.message(params, SELLERCARD_APPRAISELISTNEW,"获取专业评价失败",response.body().asString()));
}
@Test(description = "互动问答", priority = 6) //priorty 方法执行优先级
......@@ -137,7 +137,7 @@ public class SellerCard {
params.put("scid", scid);
Response response = network.getResponse(params, SELLERCARD_GETQUESTIONS);
int qurstionsCount = response.jsonPath().getInt("data.questionList.size()");
Assert.assertEquals(qurstionsCount, 2, network.message(params, SELLERCARD_GETQUESTIONS,"获取用户评价失败"));
Assert.assertEquals(qurstionsCount, 2, network.message(params, SELLERCARD_GETQUESTIONS,"获取用户评价失败",response.body().asString()));
}
@Test(description = "风险评测", priority = 7) //priorty 方法执行优先级
......@@ -146,7 +146,7 @@ public class SellerCard {
params.put("scid", scid);
Response response = network.getResponse(params, SELLERCARD_ISDISPLAYACTIVITY);
String contentId = response.jsonPath().getString("data.contentId");//写死风险评测id
Assert.assertEquals(contentId, "Kj21Mzc0NzE", network.message(params, SELLERCARD_ISDISPLAYACTIVITY,"风险评测-获取失败"));
Assert.assertEquals(contentId, "Kj21Mzc0NzE", network.message(params, SELLERCARD_ISDISPLAYACTIVITY,"风险评测-获取失败",response.body().asString()));
}
//
......@@ -157,14 +157,14 @@ public class SellerCard {
params.put("pageSize", 200);
Response response = network.getResponse(params, SELLERCARD_COMPANYLIST);
String companyId = response.jsonPath().getString("data.list.find {it.companyName == '太平洋保险'}.id");
Assert.assertNotNull(companyId, network.message(params, SELLERCARD_COMPANYLIST,"公司列表-获取失败"));
Assert.assertNotNull(companyId, network.message(params, SELLERCARD_COMPANYLIST,"公司列表-获取失败",response.body().asString()));
Map<String, Object> editParams = new HashMap<String, Object>();
editParams.put("companyId", companyId);
response = network.postResponse(editParams, SELLERCARD_EDITBASEINFO);
boolean isChanged = response.jsonPath().getBoolean("success");
Assert.assertTrue(isChanged, network.message(editParams, SELLERCARD_EDITBASEINFO,"选择公司失效"));
Assert.assertTrue(isChanged, network.message(editParams, SELLERCARD_EDITBASEINFO,"选择公司失效",response.body().asString()));
}
@Test(description = "服务案例", priority = 9) //priorty 方法执行优先级
......@@ -174,7 +174,7 @@ public class SellerCard {
params.put("pageSize",4);
Response response = network.getResponse(params, SELLERCARD_SELLERCARDCASENEW);
int count = response.jsonPath().getInt("data.cases.size()");
Assert.assertEquals(count,3, network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-获取失败"));
Assert.assertEquals(count,3, network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-获取失败",response.body().asString()));
}
@Test(description = "精选产品", priority = 10) //priorty 方法执行优先级
......@@ -185,7 +185,7 @@ public class SellerCard {
params.put("isMore",false);
Response response = network.getResponse(params, SELLERCARD_PRODUCTLIST);
int count = response.jsonPath().getInt("data.productList.size()");
Assert.assertEquals(count,3,network.message(params, SELLERCARD_PRODUCTLIST,"精选产品-获取失败"));
Assert.assertEquals(count,3,network.message(params, SELLERCARD_PRODUCTLIST,"精选产品-获取失败",response.body().asString()));
}
@AfterClass
......
......@@ -24,7 +24,7 @@ public class Upload {
public void 会员判断() throws IOException{
Response response = network.getResponse(ISVIPSUBSCRIBE);
boolean isVip = response.jsonPath().getBoolean("data.vip");
Assert.assertTrue(true, network.message(ISVIPSUBSCRIBE,"会员判断错误"));
Assert.assertTrue(true, network.message(ISVIPSUBSCRIBE,"会员判断错误",response.body().asString()));
}
@Test(description = "上传_文章链接",priority = 2)
......@@ -38,7 +38,7 @@ public class Upload {
params.put("type",1);
Response response = network.postResponse(params,UPLOAD);
String taskId = response.jsonPath().getString("data.taskId");
Assert.assertNotNull(taskId ,network.message(params,UPLOAD,"上传文章链接-接口调用失败"));
Assert.assertNotNull(taskId ,network.message(params,UPLOAD,"上传文章链接-接口调用失败",response.body().asString()));
//查询上传状态 轮询30次,直至taskStatus变为2
Map<String, Object> taskParams = new HashMap<String, Object>();
......@@ -48,7 +48,7 @@ public class Upload {
String contentId = response.jsonPath().getString("data.contentId");//内容ID
String contentImageUrl = response.jsonPath().getString("data.contentImageUrl");
String contentType = response.jsonPath().getString("data.contentType");
Assert.assertEquals(contentType,"article", network.message(taskParams, UPLOAD_TASKSTATUS,"上传文章链接-查询调用失败"));
Assert.assertEquals(contentType,"article", network.message(taskParams, UPLOAD_TASKSTATUS,"上传文章链接-查询调用失败",response.body().asString()));
}
@Test(description="上传_视频链接",priority = 3)
......@@ -62,7 +62,7 @@ public class Upload {
params.put("type",3);
Response response = network.postResponse(params,UPLOAD);
String taskId = response.jsonPath().getString("data.taskId");
Assert.assertNotNull(taskId ,network.message(params, UPLOAD,"上传视频链接-接口调用失败"));
Assert.assertNotNull(taskId ,network.message(params, UPLOAD,"上传视频链接-接口调用失败",response.body().asString()));
//查询上传状态 轮询30次,直至taskStatus变为2
Map<String, Object> taskParams = new HashMap<String, Object>();
......@@ -72,7 +72,7 @@ public class Upload {
String contentId = response.jsonPath().getString("data.contentId");//内容ID
String contentImageUrl = response.jsonPath().getString("data.contentImageUrl");
String responseTaskId = response.jsonPath().getString("data.taskId");
Assert.assertEquals(responseTaskId,taskId,network.message(taskParams, UPLOAD_TASKSTATUS,"上传视频链接-查询调用失败"));
Assert.assertEquals(responseTaskId,taskId,network.message(taskParams, UPLOAD_TASKSTATUS,"上传视频链接-查询调用失败",response.body().asString()));
}
@Test(description = "上传_其他链接",priority = 4)
......@@ -86,7 +86,7 @@ public class Upload {
params.put("url",network_link);
Response response = network.postResponse(params, UPLOAD);
String taskId = response.jsonPath().getString("data.taskId");//上传任务ID
Assert.assertNotNull(taskId,network.message(params, UPLOAD,"上传其他链接-接口调用失败"));
Assert.assertNotNull(taskId,network.message(params, UPLOAD,"上传其他链接-接口调用失败",response.body().asString()));
//查询上传状态 轮询30次,直至taskStatus变为2
Map<String, Object> taskParams = new HashMap<String, Object>();
......@@ -96,14 +96,14 @@ public class Upload {
String contentId = response.jsonPath().getString("data.contentId");//内容ID
String contentImageUrl = response.jsonPath().getString("data.contentImageUrl");
String contentType = response.jsonPath().getString("data.contentType");
Assert.assertEquals(contentType,"network_link",network.message(taskParams, UPLOAD_TASKSTATUS,"上传其他链接-查询调用失败"));
Assert.assertEquals(contentType,"network_link",network.message(taskParams, UPLOAD_TASKSTATUS,"上传其他链接-查询调用失败",response.body().asString()));
//获取 其他链接上传成功后的中间页详情
Map<String, Object> detailParams = new HashMap<String, Object>();
detailParams.put("contentId",contentId);
response = network.getResponse(detailParams, UPLOAD_CONTENTDETAIL);
String sourceUrl = response.jsonPath().get("data.sourceUrl");
Assert.assertEquals(sourceUrl, network_link,network.message(detailParams, UPLOAD_CONTENTDETAIL,"上传其他链接-中间页获取失败"));
Assert.assertEquals(sourceUrl, network_link,network.message(detailParams, UPLOAD_CONTENTDETAIL,"上传其他链接-中间页获取失败",response.body().asString()));
//上传和分享
Map<String, Object> updateParams = new HashMap<String, Object>();
......@@ -111,7 +111,7 @@ public class Upload {
updateParams.put("contentImageUrl",contentImageUrl);
response = network.postResponse(updateParams, UPLOAD_UPDATEANDSHARE);
String shareLink = response.jsonPath().getString("data.shareLink");
Assert.assertEquals(shareLink, network_link,network.message(updateParams, UPLOAD_UPDATEANDSHARE,"传其他链接-上传和分享调用失败"));
Assert.assertEquals(shareLink, network_link,network.message(updateParams, UPLOAD_UPDATEANDSHARE,"传其他链接-上传和分享调用失败",response.body().asString()));
}
@Test(description = "上传_本地视频",priority = 5)
......@@ -121,7 +121,7 @@ public class Upload {
Response response = network.postFileResponse(videoFile, UPLOAD_UPLOADVEDIO);
String videoUrl = response.jsonPath().getString("data.videoUrl");
String firstFrameUrl = response.jsonPath().getString("data.firstFrameUrl");
Assert.assertNotNull(videoUrl, network.message(UPLOAD_UPLOADVEDIO,"上传本地视频-上传oss失败"));
Assert.assertNotNull(videoUrl, network.message(UPLOAD_UPLOADVEDIO,"上传本地视频-上传oss失败",response.body().asString()));
//2.开始上传视频
// Map<String, Object> params = new HashMap<String, Object>();
......@@ -139,15 +139,15 @@ public class Upload {
Response response = network.getResponse(UPLOAD_HOT);
String contentType = response.jsonPath().getString("data[0].contentType");//列表的素材类型
boolean isList = response.jsonPath().getInt("data.size()") > 0;//列表的长度
Assert.assertEquals(contentType, "article", network.message(UPLOAD_HOT,"获取大家都在转-文章列表内容有误"));
Assert.assertTrue( isList, network.message(UPLOAD_HOT,"获取大家都在转-文章列表数量有误"));
Assert.assertEquals(contentType, "article", network.message(UPLOAD_HOT,"获取大家都在转-文章列表内容有误",response.body().asString()));
Assert.assertTrue( isList, network.message(UPLOAD_HOT,"获取大家都在转-文章列表数量有误",response.body().asString()));
//获取视频的榜单
response = network.getResponse(UPLOAD_VIDEOHOT);
contentType = response.jsonPath().getString("data[0].contentType");
isList = response.jsonPath().getInt("data.size()") > 0;
Assert.assertEquals(contentType, "video", network.message(UPLOAD_VIDEOHOT,"获取大家都在转-视频列表内容有误"));
Assert.assertTrue(isList, network.message(UPLOAD_VIDEOHOT,"获取大家都在转-视频列表数量有误"));
Assert.assertEquals(contentType, "video", network.message(UPLOAD_VIDEOHOT,"获取大家都在转-视频列表内容有误",response.body().asString()));
Assert.assertTrue(isList, network.message(UPLOAD_VIDEOHOT,"获取大家都在转-视频列表数量有误",response.body().asString()));
}
//我的上传:
......@@ -163,16 +163,16 @@ public class Upload {
Response response = network.getResponse(params,UPLOAD_LIST);
int length = response.jsonPath().getInt("data.size()");
String contentType = response.jsonPath().getString("data[0].contentType");
Assert.assertEquals(length, 1, network.message(params, UPLOAD_LIST,"获取我的上传-文章列表内容有误"));
Assert.assertEquals(contentType, "article", network.message(params, UPLOAD_LIST,"获取我的上传-文章列表数量有误"));
Assert.assertEquals(length, 1, network.message(params, UPLOAD_LIST,"获取我的上传-文章列表内容有误",response.body().asString()));
Assert.assertEquals(contentType, "article", network.message(params, UPLOAD_LIST,"获取我的上传-文章列表数量有误",response.body().asString()));
//获取视频的列表
params.put("type","video");
response = network.getResponse(params, UPLOAD_LIST);
length = response.jsonPath().getInt("data.size()");
contentType = response.jsonPath().getString("data[0].contentType");
Assert.assertEquals(length, 1, network.message(params, UPLOAD_LIST,"获取我的上传-视频列表内容有误"));//因为有一篇抖音,一篇本地,所以数量是2
Assert.assertEquals(contentType, "video", network.message(params, UPLOAD_LIST,"获取我的上传-视频列表数量有误"));
Assert.assertEquals(length, 1, network.message(params, UPLOAD_LIST,"获取我的上传-视频列表内容有误",response.body().asString()));//因为有一篇抖音,一篇本地,所以数量是2
Assert.assertEquals(contentType, "video", network.message(params, UPLOAD_LIST,"获取我的上传-视频列表数量有误",response.body().asString()));
//获取其他的列表
params.put("type","network_link");
......@@ -181,20 +181,20 @@ public class Upload {
length = response.jsonPath().getInt("data.size()");
contentType = response.jsonPath().getString("data[0].contentType");
Assert.assertEquals(length, 1, network.message(params, UPLOAD_LIST,"获取我的上传-其他列表失败"));
Assert.assertEquals(contentType, "network_link", network.message(params, UPLOAD_LIST,"获取我的上传-其他列表数量有误"));
Assert.assertEquals(length, 1, network.message(params, UPLOAD_LIST,"获取我的上传-其他列表失败",response.body().asString()));
Assert.assertEquals(contentType, "network_link", network.message(params, UPLOAD_LIST,"获取我的上传-其他列表数量有误",response.body().asString()));
//删除其他列表的素材
Map<String, Object> unbindParams = new HashMap<String, Object>();
unbindParams.put("id",network_linkId);
response = network.getResponse(unbindParams,UPLOAD_UNBIND);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(unbindParams, UPLOAD_UNBIND,"删除我的上传-其他列表的素材失败"));
Assert.assertTrue(data,network.message(unbindParams, UPLOAD_UNBIND,"删除我的上传-其他列表的素材失败",response.body().asString()));
//再次获取其他的列表, 检查删除是否生效
response = network.getResponse(params, UPLOAD_LIST);
length = response.jsonPath().getInt("data.size()");
Assert.assertEquals(length, 0, network.message(params, UPLOAD_LIST,"获取我的上传-其他列表数量有误"));
Assert.assertEquals(length, 0, network.message(params, UPLOAD_LIST,"获取我的上传-其他列表数量有误",response.body().asString()));
}
@AfterClass
......
......@@ -6,7 +6,7 @@ public class BasicConfig {
// *************** 配置信息,每次重新配置以下信息就ok ***************
// 是否推送
public static final boolean isPushReport = true; //true
public static final boolean isPushReport = false; //true
// 用户微信昵称
public static final String WECHAT_NAME = "小疙瘩人寿"; //true
// 用户tku
......
......@@ -125,16 +125,18 @@ public class NetworkUtil {
}
//带参的接口信息
public String message(Map<String, Object> params, String path, String errorMessage){
public String message(Map<String, Object> params, String path, String errorMessage, String responseBody){
return "\n" + "path: " + path +
"\n" + "params: " + params +
"\n" + "message: " + errorMessage;
"\n" + "message: " + errorMessage +
"\n" + "response:" + responseBody;
}
//不带参的接口信息
public String message(String path, String errorMessage){
public String message(String path, String errorMessage, String responseBody){
return "\n" + "path: " + path +
"\n" + "message: " + errorMessage;
"\n" + "message: " + errorMessage +
"\n" + "response:" + responseBody;
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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