Commit 375af4e7 authored by 张艳玲's avatar 张艳玲

Merge branch '2021071502' into 'master'

2021071502

See merge request test-group/kejiji!67
parents 1ad5c133 b1e2bf56
package com.kjj.bean.card;
import lombok.Data;
@Data
public class GoodMajor {
String code;
String desc;
boolean choose;
String type;
}
package com.kjj.bean.card;
import lombok.Data;
@Data
public class WechatCard {
String avatar;
String address;
String addressLocation;
int avatarStyle;
int companyId;
String jobPost;
String phoneNumber;
String sellerName;
String wechatNumber;
}
......@@ -36,6 +36,7 @@ public interface Authorization {
default void userTku() {
AGENT_TKU = BaseUtils.createTku();
VISITOR_TKU = BaseUtils.getTku(VISITOR_USERID);
network.agentCookies.put("tku", VISITOR_TKU);
System.out.println("访客tku:" + VISITOR_TKU);
}
......
package com.kjj.cases.basics.card;
import static com.kjj.config.BasicConfig.*;
import static com.kjj.utils.ThreadSleepUtils.sleep;
import com.kjj.cases.admin.Authorization;
import com.kjj.utils.NetworkUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.*;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class ArticalPersonCard implements Authorization {
private static final NetworkUtils network = NetworkUtils.getInstance();
public String sid; // 加密的销售ID
public String articleContentId; // 文章的contentId
public String scid; // getScid后的文章scid
public String scId; // 底部名片获取的scid
public int userId; // 代理人用户ID
public String visitId; // 访问记录ID
@BeforeClass
public void setUp() {
agentAuth();
}
//文章内容页
@Test(description="代理人_获取用户信息",priority = 1)
public void 代理人_获取用户信息() {
Response response = network.getResponse(USER_INFO);
userId = response.jsonPath().getInt("data.userId");
Assert.assertNotNull(response.jsonPath().getJsonObject("data"),network.message(USER_INFO,"获取用户信息失败",response.body().asString()));
}
//文章内容页
@Test(description="代理人_种草爆文列表页",priority = 2)
public void 代理人_种草爆文列表页() {
Response response = network.getResponse(ARTICLE_GETEXPLOSIONCONTENTLIST);
articleContentId = response.jsonPath().getString("data[0].contentId");
Assert.assertNotNull(articleContentId,network.message(ARTICLE_GETEXPLOSIONCONTENTLIST,"获取爆款素材文章失败",response.body().asString()));
}
//文章内容页
@Test(description="代理人_文章内容页",priority = 3)
public void 代理人_文章内容页() {
//根据ContentId获取Scid
Map<String, Object> params = new HashMap<String, Object>();
params.put("contentId",articleContentId);
Response response = network.getResponse(params, GETSCID);
System.out.println(response.body().asString());
scid = response.jsonPath().getString("data");
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,"获取文章内容页失败",response.body().asString()));
}
@Test(description="代理人_获取名片配置",priority = 4)
public void 代理人_获取名片配置(){
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params,SELLERCARD_GETSELLERCARDCONFIG);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
System.out.println(response.body().asString());
Assert.assertTrue(success,network.message(params,SELLERCARD_GETSELLERCARDCONFIG ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_GETSELLERCARDCONFIG ,"配置列表为空",response.body().asString()));
}
@Test(description="代理人_获取名片风格配置",priority = 5)
public void 代理人_获取名片风格配置(){
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params,SELLERCARD_GETSELLERCARDSTYLE);
System.out.println(response.body().asString());
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(SELLERCARD_GETSELLERCARDSTYLE ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(SELLERCARD_GETSELLERCARDSTYLE ,"配置列表为空",response.body().asString()));
}
@Test(description="代理人_获取互动区设置",priority = 6)
public void 代理人_获取互动区设置(){
Map<String, Object> params = new HashMap<String, Object>();
params.put("sid",sid);
Response response = network.getResponse(params,SELLERCARD_GETINTERACTIONCONFIG);
System.out.println(response.body().asString());
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_GETINTERACTIONCONFIG ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_GETINTERACTIONCONFIG ,"配置列表为空",response.body().asString()));
}
// 头部名片
@Test(description="代理人_头部名片详情",priority = 7)
public void 代理人_头部名片详情(){
//获取加密的销售ID
sleep(1000);
Response response = network.getResponse(USER_INFO);
sid = response.jsonPath().getString("data.encodeSellerId");
String sellerName = response.jsonPath().getString("data.sellerName");
//获取名片的姓名、公司等
Map<String, Object> params = new HashMap<String, Object>();
params.put("sid",sid);
params.put("timestamp",System.currentTimeMillis());
response = network.getResponse(params,SELLERCARD_TOPOFCONTENT);
String name = response.jsonPath().getString("data.sellerName");
Assert.assertEquals(name,sellerName,network.message(params,SELLERCARD_TOPOFCONTENT ,",名片信息错误",response.body().asString()));
}
// 底部名片
@Test(description="代理人_底部名片详情",priority = 8)
public void 代理人_底部名片详情() {
//获取加密的销售ID
Response response = network.getResponse(USER_INFO);
String sellerName = response.jsonPath().getString("data.sellerName");
//获取名片的姓名、公司等
Map<String, Object> params = new HashMap<String, Object>();
params.put("sid",sid);
response = network.getResponse(params,SELLERCARD_BOTTOMOFCONTENT);
scId = response.jsonPath().getString("data.scid");
String name = response.jsonPath().getString("data.sellerName");
Assert.assertEquals(name,sellerName,network.message(params,SELLERCARD_BOTTOMOFCONTENT ,",名片信息错误",response.body().asString()));
}
@Test(description="代理人_修改名片配置",priority = 9)
public void 代理人_修改名片配置(){
//修改名片背景
Map<String, Object> params = new HashMap<String, Object>();
params.put("configKey","card_background_color");
params.put("configValue","3");
Response response = network.postResponse(params,SELLERCONFIG_EDITCONFIG);
System.out.println(response.body().asString());
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(SELLERCONFIG_EDITCONFIG ,"接口返回失败",response.body().asString()));
Assert.assertTrue(data,network.message(SELLERCONFIG_EDITCONFIG ,"修改配置失败",response.body().asString()));
//修改展示配置
//关闭名片展示
params.put("configKey","card_share_document");//文章观点
params.put("configValue",false);
response = network.postResponse(params,SELLERCONFIG_EDITCONFIG);
params.put("configKey","card_visit_avatar");//访客头像
params.put("configValue",false);
response = network.postResponse(params,SELLERCONFIG_EDITCONFIG);
params.put("configKey","show_view_business_card");//查看名片
params.put("configValue",false);
response = network.postResponse(params,SELLERCONFIG_EDITCONFIG);
//查看是否修改成功
params.clear();
params.put("id",scid);
response = network.getResponse(params,SELLERCARD_GETSELLERCARDSTYLE);
System.out.println(params);
System.out.println(SELLERCARD_GETSELLERCARDSTYLE);
System.out.println(response.body().asString());
success = response.jsonPath().getBoolean("success");
Object list = response.jsonPath().getJsonObject("data");
String card_background_color = response.jsonPath().getString("data.find {it.code == 'card_background_color'}.val");
boolean card_share_document = response.jsonPath().getBoolean("data.find {it.code == 'card_share_document'}.val");
boolean card_visit_avatar = response.jsonPath().getBoolean("data.find {it.code == 'card_visit_avatar'}.val");
boolean show_view_business_card = response.jsonPath().getBoolean("data.find {it.code == 'show_view_business_card'}.val");
Assert.assertTrue(success,network.message(params,SELLERCARD_GETSELLERCARDSTYLE ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(list,network.message(params,SELLERCARD_GETSELLERCARDSTYLE ,"配置列表为空",response.body().asString()));
Assert.assertEquals(card_background_color,"3",network.message(params,SELLERCARD_GETSELLERCARDSTYLE ,"背景颜色更新失败",response.body().asString()));
Assert.assertFalse(card_share_document,network.message(params,SELLERCARD_GETSELLERCARDSTYLE ,"文章观点更新失败",response.body().asString()));
Assert.assertFalse(card_visit_avatar,network.message(params,SELLERCARD_GETSELLERCARDSTYLE ,"访客头像更新失败",response.body().asString()));
Assert.assertFalse(show_view_business_card,network.message(params,SELLERCARD_GETSELLERCARDSTYLE ,"查看名片更新失败",response.body().asString()));
//还原
params.clear();
params.put("configKey","card_background_color");//名片背景
params.put("configValue","1");
response = network.postResponse(params,SELLERCONFIG_EDITCONFIG);
params.put("configKey","card_share_document");//文章观点
params.put("configValue",false);
response = network.postResponse(params,SELLERCONFIG_EDITCONFIG);
params.put("configKey","card_visit_avatar");//访客头像
params.put("configValue",false);
response = network.postResponse(params,SELLERCONFIG_EDITCONFIG);
params.put("configKey","show_view_business_card");//名片展示
params.put("configValue",false);
response = network.postResponse(params,SELLERCONFIG_EDITCONFIG);
}
// ******************************** 访客 ****************************
@Test(description="访客_记录查看素材",priority = 10)
public void 访客_记录查看素材(){
//切换为访客
userTku();
sleep(1000);
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);//代理人的scid
params.put("cancelPush",false);
params.put("fromUserId",userId); // 代理人的用户id
params.put("visitPath",1); //访问路径来源 0未知,1个人,2朋友圈,3群
Response response = network.getResponse(params,CONTENT_READ);
System.out.println(params);
System.out.println(response.body().asString());
visitId = response.jsonPath().getString("data.visitId");
Assert.assertNotNull(visitId,network.message(params,CONTENT_READ,"访客视角-获取访问记录失败",response.body().asString()));
}
@Test(description="访客_点赞",priority = 11)
public void 访客_点赞(){
//统计点赞数量
Map<String, Object> params = new HashMap<String, Object>();
params.put("scId",scId);
Response response = network.getResponse(params,HASALREADYLIKE);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
int favourTimes = response.jsonPath().getInt("data.favourTimes");
System.out.println(params);
System.out.println(response.body().asString());
Assert.assertTrue(success,network.message(params,HASALREADYLIKE ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,HASALREADYLIKE ,"返回数据为空 ",response.body().asString()));
//点赞
params.clear();
params.put("scId",scId);
params.put("visitTableId",visitId);
response = network.postResponse(params,INTERACTION_LIKE);
success = response.jsonPath().getBoolean("success");
data = response.jsonPath().getJsonObject("data");
System.out.println(params);
System.out.println(response.body().asString());
int likeFavourTimes = response.jsonPath().getInt("data.favourTimes");
boolean favourResult = response.jsonPath().getBoolean("data.favourResult");
Assert.assertTrue(success,network.message(params,INTERACTION_LIKE ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,INTERACTION_LIKE ,"返回数据为空 ",response.body().asString()));
Assert.assertTrue(likeFavourTimes != 0,network.message(params,INTERACTION_LIKE ,"接口返回失败",response.body().asString()));
if(favourTimes == 10){//最多只允许点赞10次
Assert.assertTrue(likeFavourTimes == favourTimes,network.message(params,INTERACTION_LIKE ,"接口返回失败",response.body().asString()));
Assert.assertFalse(favourResult,network.message(params,INTERACTION_LIKE ,"接口返回失败",response.body().asString()));
}else {
Assert.assertTrue(likeFavourTimes == favourTimes+1,network.message(params,INTERACTION_LIKE ,"接口返回失败",response.body().asString()));
Assert.assertTrue(favourResult,network.message(params,INTERACTION_LIKE ,"接口返回失败",response.body().asString()));
}
//查看是否点赞成功
params.clear();
params.put("scId",scId);
response = network.getResponse(params,HASALREADYLIKE);
int favourTimesNew = response.jsonPath().getInt("data.favourTimes");
favourResult = response.jsonPath().getBoolean("data.favourResult");
System.out.println(params);
System.out.println(response.body().asString());
Assert.assertTrue(favourResult,network.message(params,HASALREADYLIKE ,"接口返回失败",response.body().asString()));
if(favourTimes == 10){//最多只允许点赞10次
Assert.assertEquals(favourTimesNew,favourTimes,network.message(params,HASALREADYLIKE ,"点赞后数量错误",response.body().asString()));
}else {
Assert.assertEquals(favourTimesNew,favourTimes+1,network.message(params,HASALREADYLIKE ,"点赞后数量错误",response.body().asString()));
}
}
@Test(description="访客_换成我的名片",priority = 12)
public void 访客_换成我的名片(){
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params,SELLERCARD_GETSELLERPROMOTEINFO);
System.out.println(response.body().asString());
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(params,SELLERCARD_GETSELLERPROMOTEINFO,"获取专业解读列表有误",response.body().asString()));
Assert.assertNotNull(data, network.message(params,SELLERCARD_GETSELLERPROMOTEINFO,"获取专业解读列表有误",response.body().asString()));
}
// 获取互动区-专业解读
@Test(description="代理人_互动区-专业解读",priority = 13)
public void 代理人_互动区_专业解读(){
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
params.put("pageIndex",1);
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,"获取专业解读列表有误",response.body().asString()));
}
// 获取互动区-互动问答
@Test(description="代理人_互动区-互动问答",priority = 14)
public void 代理人_互动区_互动问答(){
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
params.put("pageIndex",1);
params.put("pageSize",2);
Response response = network.getResponse(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS);
boolean hasList = response.jsonPath().getInt("data.list.size()") > 0;
Assert.assertTrue(hasList,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,"获取问答内容有误",response.body().asString()));
}
// 获取互动区-风险评测
@Test(description="代理人_互动区-风险评测",priority = 15)
public void 代理人_互动区_风险评测(){
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
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,"互动区-风险评测显示有误",response.body().asString()));
Assert.assertNotNull(riskScid, network.message(params,ARTICLE_ISDISPLAYACTIVITY,"互动区-风险评测内容有误",response.body().asString()));
}
// 获取代理人个人专栏
@Test(description="访客_查询是否存在未读消息",priority = 16)
public void 访客_查询是否存在未读消息() throws IOException {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
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, "访客-获取私信有误",response.body().asString()));
}
@AfterClass
public static void tearDown(){
network.agentCookies.put("tku",AGENT_TKU); //tku 切换为访客的
apiCount += 16;
}
}
package com.kjj.cases.basics.card;
import com.kjj.bean.card.GoodMajor;
import com.kjj.bean.card.WechatCard;
import com.kjj.cases.admin.Authorization;
import com.kjj.utils.JsonUtil;
import com.kjj.utils.NetworkUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.kjj.config.BasicConfig.*;
import static com.kjj.utils.ThreadSleepUtils.sleep;
public class PersonCard implements Authorization {
private static final NetworkUtils network = NetworkUtils.getInstance();
public String scid;
public String visitor_scid;
public String sellerCaseId;
public String personalProductId;
public String appraiseId;
long userId;
String questionId;
@BeforeClass
public void setUp() {
agentTku();
}
@Test(description = "获取用户信息",priority = 1)
public void 获取用户信息(){
Response response = network.getResponse(USER_INFO);
boolean success = response.jsonPath().getBoolean("success");
userId = response.jsonPath().getLong("data.userId");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(USER_INFO,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(USER_INFO,"返回数据为空",response.body().asString()));
Assert.assertEquals(userId,5495,network.message(USER_INFO,"用户不是吉吉",response.body().asString()));
}
@Test(description = "获取用户版本",priority = 2)
public void 获取用户版本(){
HashMap<String,Object> params = new HashMap<String,Object>();
params.put("t",System.currentTimeMillis());
Response response = network.getResponse(params,VERSION_INFO);
boolean success = response.jsonPath().getBoolean("success");
int userVersion = response.jsonPath().getInt("data.find {it.openType == 1}.userVersion");
Object data = response.jsonPath().getJsonObject("data");
boolean vip = response.jsonPath().getBoolean("data.find {it.openType == 1}.vip");
Assert.assertTrue(success,network.message(params,VERSION_INFO,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(params,VERSION_INFO,"返回数据为空",response.body().asString()));
Assert.assertTrue(vip,network.message(params,VERSION_INFO,"开启但不是VIP",response.body().asString()));
Assert.assertEquals(userVersion,2,network.message(params,VERSION_INFO,"用户不是保险专业版",response.body().asString()));
}
@Test(description = "获取名片顶部信息",priority = 3)
public void 获取名片顶部信息(){
Response response = network.getResponse(SELLERCARD_TOPOFDETAIL);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
WechatCard card = JsonUtil.parseResponseToBean(response,WechatCard.class);
System.out.println(response.body().asString());
scid = response.jsonPath().getString("data.scid");
Assert.assertTrue(success,network.message(SELLERCARD_TOPOFDETAIL,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(SELLERCARD_TOPOFDETAIL,"返回数据为空",response.body().asString()));
Assert.assertEquals(card.getSellerName(),"吉吉",network.message(SELLERCARD_TOPOFDETAIL,"名片信息错误",response.body().asString()));
Assert.assertEquals(card.getJobPost(),"嘿嘿嘿",network.message(SELLERCARD_TOPOFDETAIL,"名片信息错误",response.body().asString()));
Assert.assertEquals(card.getPhoneNumber(),"13012341234",network.message(SELLERCARD_TOPOFDETAIL,"名片信息错误",response.body().asString()));
Assert.assertEquals(card.getWechatNumber(),"wx123456",network.message(SELLERCARD_TOPOFDETAIL,"名片信息错误",response.body().asString()));
Assert.assertEquals(card.getAddress(),"杭州数娱大厦(文一西路98号)",network.message(SELLERCARD_TOPOFDETAIL,"名片信息错误",response.body().asString()));
}
@Test(description = "保存名片基本信息",priority = 4)
public void 保存名片基本信息(){
HashMap<String,Object> params = new HashMap<String,Object>();
//修改用户信息
params.put("sellerName", "自动化测试");
params.put("phoneNumber", "13043214321");
params.put("wechatNumber", "wx654321");
params.put("jobPost", "啦啦啦");
params.put("address", "重庆市轨道集团建设大楼");
params.put("addressLocation", "106.544362,29.559164");
params.put("avatarStyle", 1);
Response response = network.postResponse(params,SELLERCARD_EDITBASEINFO);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITBASEINFO,"接口返回失败状态",response.body().asString()));
//查看修改是否成功
response = network.getResponse(SELLERCARD_TOPOFDETAIL);
success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
WechatCard card = JsonUtil.parseResponseToBean(response,WechatCard.class);
Assert.assertTrue(success,network.message(params,SELLERCARD_TOPOFDETAIL,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_TOPOFDETAIL,"返回数据为空",response.body().asString()));
Assert.assertEquals(card.getSellerName(),"自动化测试",network.message(params,SELLERCARD_TOPOFDETAIL,"名字修改失败",response.body().asString()));
Assert.assertEquals(card.getJobPost(),"啦啦啦",network.message(params,SELLERCARD_TOPOFDETAIL,"职业修改失败",response.body().asString()));
Assert.assertEquals(card.getPhoneNumber(),"13043214321",network.message(params,SELLERCARD_TOPOFDETAIL,"电话修改失败",response.body().asString()));
Assert.assertEquals(card.getWechatNumber(),"wx654321",network.message(params,SELLERCARD_TOPOFDETAIL,"微信号修改失败",response.body().asString()));
Assert.assertEquals(card.getAddress(),"重庆市轨道集团建设大楼",network.message(params,SELLERCARD_TOPOFDETAIL,"地址修改失败",response.body().asString()));
Assert.assertEquals(card.getAddressLocation(),"106.544362,29.559164",network.message(params,SELLERCARD_TOPOFDETAIL,"地址经纬度修改失败",response.body().asString()));
Assert.assertEquals(card.getAvatarStyle(),1,network.message(params,SELLERCARD_TOPOFDETAIL,"专业风格修改失败",response.body().asString()));
//还原用户信息
params.clear();
params.put("sellerName", "吉吉");
params.put("phoneNumber", "13012341234");
params.put("wechatNumber", "wx123456");
params.put("jobPost", "嘿嘿嘿");
params.put("address", "杭州数娱大厦(文一西路98号)");
params.put("addressLocation", "120.112204,30.287785");
params.put("avatarStyle", 3);
response = network.postResponse(params,SELLERCARD_EDITBASEINFO);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITBASEINFO,"接口返回失败状态",response.body().asString()));
}
@Test(description = "获取用户个人介绍",priority = 5)
public void 获取用户个人介绍(){
Response response = network.getResponse(SELLERCARD_PERSONALPROFILE);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
String personalIntro = response.jsonPath().getString("data.personalIntro");
int exprLength = response.jsonPath().getInt("data.exprLength");
Object majors = response.jsonPath().getBoolean("data.goodAtMajor");
Assert.assertTrue(success,network.message(SELLERCARD_PERSONALPROFILE,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(SELLERCARD_PERSONALPROFILE,"返回数据为空",response.body().asString()));
Assert.assertEquals(personalIntro,"我在行业内整挺好!",network.message(SELLERCARD_PERSONALPROFILE,"个人介绍信息错误",response.body().asString()));
Assert.assertEquals(exprLength,2,network.message(SELLERCARD_PERSONALPROFILE,"年限信息错误",response.body().asString()));
Assert.assertNotNull(majors,network.message(SELLERCARD_PERSONALPROFILE,"专业标签返回数据为空",response.body().asString()));
}
@Test(description = "获取个人介绍模板",priority = 6)
public void 获取用户个人介绍模板(){
HashMap<String,Object> params = new HashMap<String,Object>();
params.put("pageIndex", 1);
params.put("pageSize", 30);
Response response = network.getResponse(params,SELLERCARD_GETPERSONINTROTEMPLATE);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
int totalCount = response.jsonPath().getInt("data.totalCount");
Assert.assertTrue(success,network.message(params,SELLERCARD_GETPERSONINTROTEMPLATE,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_GETPERSONINTROTEMPLATE,"返回数据为空",response.body().asString()));
Assert.assertTrue(totalCount>1,network.message(params,SELLERCARD_GETPERSONINTROTEMPLATE,"模板列表为空",response.body().asString()));
}
@Test(description = "修改个人介绍模块",priority = 7)
public void 修改个人介绍模块(){
HashMap<String,Object> params = new HashMap<String,Object>();
//修改个人介绍和年限
params.put("personalIntro", "本人有多年的保险销售和管理经验!");
params.put("exprLength", "4");
Response response = network.postResponse(params,SELLERCARD_EDITBASEINFO);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITBASEINFO,"接口返回失败状态",response.body().asString()));
//修改专业标签
params.clear();
params.put("goodAtDefault","1,2");
params.put("goodAtCustom","");
response = network.postResponse(params,SELLERCARD_EDITMAJORGOODAUTH);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITMAJORGOODAUTH,"接口返回失败状态",response.body().asString()));
//查看修改是否成功
response = network.getResponse(SELLERCARD_PERSONALPROFILE);
success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
String personalIntro = response.jsonPath().getString("data.personalIntro");
int exprLength = response.jsonPath().getInt("data.exprLength");
List<GoodMajor> majors = JsonUtil.parseResponsePathToListBean(response, "data.goodAtMajor",GoodMajor.class);
Assert.assertTrue(success,network.message(params,SELLERCARD_PERSONALPROFILE,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_PERSONALPROFILE,"返回数据为空",response.body().asString()));
Assert.assertEquals(personalIntro,"本人有多年的保险销售和管理经验!",network.message(params,SELLERCARD_PERSONALPROFILE,"个人介绍信息错误",response.body().asString()));
Assert.assertEquals(exprLength,4,network.message(params,SELLERCARD_PERSONALPROFILE,"年限信息错误",response.body().asString()));
Assert.assertTrue(majors.get(0).isChoose(),network.message(params,SELLERCARD_PERSONALPROFILE,"专业标签更新错误",response.body().asString()));
Assert.assertTrue(majors.get(1).isChoose(),network.message(params,SELLERCARD_PERSONALPROFILE,"专业标签更新失败",response.body().asString()));
//还原个人介绍模块
//还原个人介绍和年限
params.clear();
params.put("personalIntro", "我在行业内整挺好!");
params.put("exprLength", "2");
response = network.postResponse(params,SELLERCARD_EDITBASEINFO);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITBASEINFO,"接口返回失败状态",response.body().asString()));
//还原专业标签
params.clear();
params.put("goodAtDefault","1");
params.put("goodAtCustom","");
response = network.postResponse(params,SELLERCARD_EDITMAJORGOODAUTH);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITMAJORGOODAUTH,"接口返回失败状态",response.body().asString()));
}
@Test(description = "更新代理人精彩点滴照片",priority = 8)
public void 更新代理人精彩点滴照片(){
HashMap<String,Object> params = new HashMap<String,Object>();
params.put("url", "//yun.kjjcrm.com/kjy/image/20210706/03fef13271844ac6b3dcd2663e70ff9c.jpg,//yun.kjjcrm.com/kjy/image/20210706/21565ef0951744298f268b72fff44d14.jpg");
Response response = network.postResponse(params,SELLERCARD_UPDATESPLENDINGIMAGE);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_UPDATESPLENDINGIMAGE,"接口返回失败状态",response.body().asString()));
}
@Test(description = "获取代理人精彩点滴照片",priority = 9)
public void 获取代理人精彩点滴照片(){
HashMap<String,Object> params = new HashMap<String,Object>();
params.put("pageIndex", "1");
params.put("pageSize", "100");
Response response = network.getResponse(params,SELLERCARD_GETSPLENDINGIMAGE);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
int totalCount = response.jsonPath().getInt("data.totalCount");
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(success,network.message(params,SELLERCARD_GETSPLENDINGIMAGE,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_GETSPLENDINGIMAGE,"返回数据为空",response.body().asString()));
Assert.assertEquals(totalCount,2,network.message(params,SELLERCARD_GETSPLENDINGIMAGE,"更新失败",response.body().asString()));
Assert.assertEquals(size,2,network.message(params,SELLERCARD_GETSPLENDINGIMAGE,"更新失败",response.body().asString()));
//还原
params.clear();
params.put("url", "//yun.kjjcrm.com/kjy/image/20210706/03fef13271844ac6b3dcd2663e70ff9c.jpg");
response = network.postResponse(params,SELLERCARD_UPDATESPLENDINGIMAGE);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_UPDATESPLENDINGIMAGE,"接口返回失败状态",response.body().asString()));
}
@Test(description = "根据page获取当前页面的Tips", priority = 10) //priorty 方法执行优先级
public void 根据page获取当前页面的Tips() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("page","seller_card");
params.put("timestamp",System.currentTimeMillis());
Response response = network.getResponse(params, GREETING_GETTIPSBYPAGE);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,GREETING_GETTIPSBYPAGE,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(params,GREETING_GETTIPSBYPAGE,"返回数据为空",response.body().asString()));
}
@Test(description = "获取客户投保案例模块", priority = 11) //priorty 方法执行优先级
public void 获取客户投保案例模块() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
params.put("pageSize",4);
params.put("isMore",false);
Response response = network.getResponse(params, SELLERCARD_SELLERCARDCASENEW);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
int count = response.jsonPath().getInt("data.sellerCases.size()");
Assert.assertTrue(success,network.message(params,SELLERCARD_SELLERCARDCASENEW,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_SELLERCARDCASENEW,"返回数据为空",response.body().asString()));
Assert.assertEquals(count,3, network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-获取失败",response.body().asString()));
}
@Test(description = "添加个人案例", priority = 12) //priorty 方法执行优先级
public void 添加个人案例() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("caseIntro","案例描述A");
params.put("casePics","//yun.kjjcrm.com/kjy/image/20210706/5abb605cb2444dff8213bcdfcfa04ca4.jpg");
params.put("customerName","客户A");
params.put("isShow",true);
params.put("product","金牌产品A");
Response response = network.postResponse(params, SELLERCARD_EDITDELLERCASE);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_PERSONALPROFILE,"接口返回失败状态",response.body().asString()));
//查看是否添加成功
params.clear();
params.put("scid",scid);
params.put("pageSize",10);
params.put("isMore",true);
response = network.getResponse(params, SELLERCARD_SELLERCARDCASENEW);
int count = response.jsonPath().getInt("data.sellerCases.size()");
String caseIntro = response.jsonPath().getString("data.sellerCases.get(0).caseIntro");
String customerName = response.jsonPath().getString("data.sellerCases.get(0).customerName");
String product = response.jsonPath().getString("data.sellerCases.get(0).product");
sellerCaseId = response.jsonPath().getString("data.sellerCases.get(0).id");
boolean isShow = response.jsonPath().getBoolean("data.sellerCases.get(0).isShow");
Assert.assertEquals(count,4, network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-获取案例数量错误",response.body().asString()));
Assert.assertEquals(caseIntro,"案例描述A", network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-描述错误",response.body().asString()));
Assert.assertEquals(customerName,"客户A", network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-客户错误",response.body().asString()));
Assert.assertEquals(product,"金牌产品A", network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-产品错误",response.body().asString()));
Assert.assertTrue(isShow, network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-展示状态错误",response.body().asString()));
}
@Test(description = "修改个人案例", priority = 13) //priorty 方法执行优先级
public void 修改个人案例() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("id",sellerCaseId);
params.put("caseIntro","案例描述A进行了更新");
Response response = network.postResponse(params, SELLERCARD_EDITDELLERCASE);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITDELLERCASE,"接口返回失败状态",response.body().asString()));
//查看是否添加成功
params.clear();
params.put("scid",scid);
params.put("pageSize",10);
params.put("isMore",true);
response = network.getResponse(params, SELLERCARD_SELLERCARDCASENEW);
int count = response.jsonPath().getInt("data.sellerCases.size()");
String caseIntro = response.jsonPath().getString("data.sellerCases.get(0).caseIntro");
Assert.assertEquals(count,4, network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-获取案例数量错误",response.body().asString()));
Assert.assertEquals(caseIntro,"案例描述A进行了更新", network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-描述错误",response.body().asString()));
}
@Test(description = "修改个人案例展示状态", priority = 14) //priorty 方法执行优先级
public void 修改个人案例展示状态() {
//取消展示
Map<String, Object> params = new HashMap<String, Object>();
params.put("caseId",null);
params.put("isShow",false);
params.put("sellerCaseId",sellerCaseId);
Response response = network.postResponse(params, SELLERCARD_UPDATESHOWSTATUSFORCASE);
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_UPDATESHOWSTATUSFORCASE,"接口返回失败状态",response.body().asString()));
Assert.assertTrue(data,network.message(params,SELLERCARD_UPDATESHOWSTATUSFORCASE,"更新失败",response.body().asString()));
//查看状态是否更新成功
params.clear();
params.put("scid",scid);
params.put("pageSize",10);
params.put("isMore",true);
response = network.getResponse(params, SELLERCARD_SELLERCARDCASENEW);
String path = "data.sellerCases.find {it.id == \""+sellerCaseId+"\"}.isShow";
boolean isShow = response.jsonPath().getBoolean(path);
Assert.assertFalse(isShow, network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-展示状态错误",response.body().asString()));
//展示
params.clear();
params.put("caseId",null);
params.put("isShow",true);
params.put("sellerCaseId",sellerCaseId);
response = network.postResponse(params, SELLERCARD_UPDATESHOWSTATUSFORCASE);
success = response.jsonPath().getBoolean("success");
data = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_PERSONALPROFILE,"接口返回失败状态",response.body().asString()));
Assert.assertTrue(data,network.message(params,SELLERCARD_PERSONALPROFILE,"更新失败",response.body().asString()));
//查看状态是否更新成功
params.clear();
params.put("scid",scid);
params.put("pageSize",10);
params.put("isMore",true);
response = network.getResponse(params, SELLERCARD_SELLERCARDCASENEW);
isShow = response.jsonPath().getBoolean(path);
Assert.assertTrue(isShow, network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-展示状态错误",response.body().asString()));
}
@Test(description = "访客查看某条个人案例", priority = 15) //priorty 方法执行优先级
public void 查看某条个人案例() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("id",sellerCaseId);
Response response = network.getResponse(params, SELLERCARD_GETSELLERCASEINFO);
String path = "data.caseIntro";
boolean success = response.jsonPath().getBoolean("success");
String caseIntro = response.jsonPath().getString(path);
Assert.assertTrue(success,network.message(params,SELLERCARD_GETSELLERCASEINFO,"接口返回失败状态",response.body().asString()));
Assert.assertEquals(caseIntro,"案例描述A进行了更新", network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-描述错误",response.body().asString()));
}
@Test(description = "删除个人案例", priority = 16) //priorty 方法执行优先级
public void 删除个人案例() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("id",sellerCaseId);
Response response = network.postResponse(params, SELLERCARD_DELETESELLERCASE);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_PERSONALPROFILE,"接口返回失败状态",response.body().asString()));
//查看是否删除成功
params.clear();
params.put("scid",scid);
params.put("pageSize",10);
params.put("isMore",false);
response = network.getResponse(params, SELLERCARD_SELLERCARDCASENEW);
int count = response.jsonPath().getInt("data.sellerCases.size()");
Assert.assertEquals(count,3, network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-获取失败",response.body().asString()));
}
@Test(description = "查看精选产品", priority = 17) //priorty 方法执行优先级
public void 查看精选产品() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
params.put("pageSize",10);
params.put("isMore",true);
Response response = network.getResponse(params, SELLERCARD_PRODUCTLIST);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
int count = response.jsonPath().getInt("data.productList.size()");
Assert.assertTrue(success,network.message(params,SELLERCARD_PRODUCTLIST,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_PRODUCTLIST,"返回数据为空",response.body().asString()));
Assert.assertEquals(count,3, network.message(params, SELLERCARD_PRODUCTLIST,"服务案例-获取失败",response.body().asString()));
}
@Test(description = "添加精选产品", priority = 18) //priorty 方法执行优先级
public void 添加精选产品() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("productName","这是性价比非常高、投入少、保额高的产品");
params.put("externalLink","http://www.baidu.com");
params.put("productFeature","这是产品描述");
params.put("productImg","//yun.kjjcrm.com/kjy/image/20210709/a349c64087224a47a8ba0b8bc49f3498.jpg");
Response response = network.postResponse(params, SELLERCARD_ADDORUPDATEPRODUCT);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_ADDORUPDATEPRODUCT,"接口返回失败状态",response.body().asString()));
//查看是否添加成功
params.clear();
params.put("scid",scid);
params.put("pageSize",30);
params.put("isMore",true);
response = network.getResponse(params, SELLERCARD_PRODUCTLIST);
int count = response.jsonPath().getInt("data.productList.size()");
String productName = response.jsonPath().getString("data.productList.get(0).productName");
String externalLink = response.jsonPath().getString("data.productList.get(0).externalLink");
String productFeature = response.jsonPath().getString("data.productList.get(0).productFeature");
String productImg = response.jsonPath().getString("data.productList.get(0).productImg");
personalProductId = response.jsonPath().getString("data.productList.get(0).personalProductId");
boolean isShow = response.jsonPath().getBoolean("data.productList.get(0).isShow");
Assert.assertEquals(count,4, network.message(params, SELLERCARD_PRODUCTLIST,"服务案例-获取失败",response.body().asString()));
Assert.assertEquals(productName,"这是性价比非常高、投入少、保额高的产品", network.message(params, SELLERCARD_PRODUCTLIST,"服务案例-描述错误",response.body().asString()));
Assert.assertEquals(externalLink,"http://www.baidu.com", network.message(params, SELLERCARD_PRODUCTLIST,"服务案例-客户错误",response.body().asString()));
Assert.assertEquals(productFeature,"这是产品描述", network.message(params, SELLERCARD_PRODUCTLIST,"服务案例-产品错误",response.body().asString()));
Assert.assertEquals(productImg,"//yun.kjjcrm.com/kjy/image/20210709/a349c64087224a47a8ba0b8bc49f3498.jpg", network.message(params, SELLERCARD_PRODUCTLIST,"服务案例-产品错误",response.body().asString()));
Assert.assertTrue(isShow, network.message(params, SELLERCARD_PRODUCTLIST,"服务案例-展示状态错误",response.body().asString()));
}
@Test(description = "修改精选产品", priority = 19) //priorty 方法执行优先级
public void 修改精选产品() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("productName","这是性价比非常高、投入少、保额高的产品");
params.put("externalLink","http://www.baidu.com");
params.put("productImg","//yun.kjjcrm.com/kjy/image/20210709/a349c64087224a47a8ba0b8bc49f3498.jpg");
params.put("personalProductId",personalProductId);
params.put("productFeature","这是产品描述进行了更新");
Response response = network.postResponse(params, SELLERCARD_ADDORUPDATEPRODUCT);
boolean success = response.jsonPath().getBoolean("success");
String data = response.jsonPath().getString("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_ADDORUPDATEPRODUCT,"添加失败",response.body().asString()));
Assert.assertEquals(data,personalProductId,network.message(params,SELLERCARD_ADDORUPDATEPRODUCT,"添加失败",response.body().asString()));
//查看是否添加成功
params.clear();
params.put("scid",scid);
params.put("pageSize",30);
params.put("isMore",true);
response = network.getResponse(params, SELLERCARD_PRODUCTLIST);
int count = response.jsonPath().getInt("data.productList.size()");
String productFeature = response.jsonPath().getString("data.productList.get(0).productFeature");
personalProductId = response.jsonPath().getString("data.productList.get(0).personalProductId");
Assert.assertEquals(count,4, network.message(params, SELLERCARD_PRODUCTLIST,"服务案例-获取失败",response.body().asString()));
Assert.assertEquals(productFeature,"这是产品描述进行了更新", network.message(params, SELLERCARD_PRODUCTLIST,"服务案例-产品错误",response.body().asString()));
}
@Test(description = "修改产品展示状态", priority =20) //priorty 方法执行优先级
public void 修改产品展示状态() {
//取消展示
Map<String, Object> params = new HashMap<String, Object>();
params.put("id",null);
params.put("isShow",false);
params.put("personalProductId",personalProductId);
Response response = network.postResponse(params, SELLERCARD_UPDATESHOWSTATUSFORPRODUCT);
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_UPDATESHOWSTATUSFORPRODUCT,"接口返回失败状态",response.body().asString()));
Assert.assertTrue(data,network.message(params,SELLERCARD_UPDATESHOWSTATUSFORPRODUCT,"更新失败",response.body().asString()));
//查看状态是否更新成功
params.clear();
params.put("scid",scid);
params.put("pageSize",30);
params.put("isMore",true);
response = network.getResponse(params, SELLERCARD_PRODUCTLIST);
System.out.println(response.body().asString());
String path = "data.productList.find {it.personalProductId == \""+personalProductId+"\"}.isShow";
boolean isShow = response.jsonPath().getBoolean(path);
Assert.assertFalse(isShow, network.message(params, SELLERCARD_PRODUCTLIST,"服务案例-展示状态错误",response.body().asString()));
//展示
params.clear();
params.put("id",null);
params.put("isShow",true);
params.put("personalProductId",personalProductId);
response = network.postResponse(params, SELLERCARD_UPDATESHOWSTATUSFORPRODUCT);
success = response.jsonPath().getBoolean("success");
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_UPDATESHOWSTATUSFORPRODUCT,"接口返回失败状态",response.body().asString()));
Assert.assertTrue(data,network.message(params,SELLERCARD_UPDATESHOWSTATUSFORPRODUCT,"更新失败",response.body().asString()));
//查看状态是否更新成功
params.clear();
params.put("scid",scid);
params.put("pageSize",30);
params.put("isMore",true);
response = network.getResponse(params, SELLERCARD_PRODUCTLIST);
isShow = response.jsonPath().getBoolean(path);
Assert.assertTrue(isShow, network.message(params, SELLERCARD_PRODUCTLIST,"服务案例-展示状态错误",response.body().asString()));
}
@Test(description = "删除精选产品", priority = 21) //priorty 方法执行优先级
public void 删除精选产品() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
params.put("personalProductId",personalProductId);
Response response = network.postResponse(params, SELLERCARD_DELETEPRODUCT);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_DELETEPRODUCT,"接口返回失败",response.body().asString()));
//查看是否删除成功
params.clear();
params.put("scid",scid);
params.put("pageSize",30);
params.put("isMore",false);
response = network.getResponse(params, SELLERCARD_PRODUCTLIST);
int count = response.jsonPath().getInt("data.productList.size()");
Assert.assertEquals(count,3, network.message(params, SELLERCARD_PRODUCTLIST,"服务案例-获取失败",response.body().asString()));
}
@Test(description = "查看客户评价", priority = 22) //priorty 方法执行优先级
public void 查看客户评价() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
params.put("pageIndex",1);
params.put("pageSize",3);
params.put("appraiseState",1);
params.put("isPersonal",false);
Response response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW );
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_APPRAISELISTNEW ,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_APPRAISELISTNEW ,"返回数据为空",response.body().asString()));
}
@Test(description = "发表个人评价", priority = 23) //priorty 方法执行优先级
public void 发表个人评价() {
userTku();
sleep(1000);
Response response = network.getResponse(SELLERCARD_TOPOFDETAIL);
visitor_scid = response.jsonPath().getString("data.scid");
Map<String, Object> params = new HashMap<String, Object>();
params.put("anonymity",0);
params.put("content","非常值得信赖的代理人呀");
params.put("id",null);
params.put("scid",scid);
params.put("star",5);
response = network.postResponse(params, SELLERCARD_SAVECARDAPPRAISE);
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_SAVECARDAPPRAISE,"接口返回失败状态",response.body().asString()));
Assert.assertTrue(data,network.message(params,SELLERCARD_SAVECARDAPPRAISE ,"发表评价失败",response.body().asString()));
//查看是否添加成功
params.clear();
params.put("scid",scid);
params.put("pageIndex",1);
params.put("pageSize",30);
params.put("appraiseState",1);
params.put("isPersonal",true);
response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW );
success = response.jsonPath().getBoolean("success");
String content = response.jsonPath().getString("data.ownAppraise.content");
String visitorName = response.jsonPath().getString("data.ownAppraise.visitorName");
int star = response.jsonPath().getInt("data.ownAppraise.star");
int appraiseState = response.jsonPath().getInt("data.ownAppraise.appraiseState");
appraiseId = response.jsonPath().getString("data.ownAppraise.id");
Assert.assertTrue(success,network.message(params,SELLERCARD_APPRAISELISTNEW ,"接口返回失败",response.body().asString()));
Assert.assertEquals(content,"非常值得信赖的代理人呀",network.message(params,SELLERCARD_APPRAISELISTNEW ,"更新失败",response.body().asString()));
Assert.assertEquals(visitorName,"Su Yi",network.message(params,SELLERCARD_APPRAISELISTNEW ,"更新失败",response.body().asString()));
Assert.assertEquals(appraiseState,0,network.message(params,SELLERCARD_APPRAISELISTNEW ,"更新失败",response.body().asString()));
Assert.assertEquals(star,5,network.message(params,SELLERCARD_APPRAISELISTNEW ,"更新失败",response.body().asString()));
}
@Test(description = "修改个人评价展示状态", priority = 24) //priorty 方法执行优先级
public void 修改个人评价展示状态() {
agentTku();
//展示
sleep(1000);
Map<String, Object> params = new HashMap<String, Object>();
params.put("appraiseState",1);
params.put("id",appraiseId);
params.put("isPersonal",true);
Response response = network.postResponse(params, SELLERCARD_EDITCARDAPPRAISE);
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITCARDAPPRAISE,"接口返回失败状态",response.body().asString()));
Assert.assertTrue(data,network.message(params,SELLERCARD_EDITCARDAPPRAISE ,"删除失败",response.body().asString()));
//查看是否修改成功
params.clear();
params.put("scid",scid);
params.put("pageIndex",1);
params.put("pageSize",30);
params.put("appraiseState",1);
params.put("isPersonal",true);
response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW );
success = response.jsonPath().getBoolean("success");
String path = "data.appraiseList.list.find {it.id == \""+appraiseId+"\"}.appraiseState";
int appraiseState = response.jsonPath().getInt(path);
Assert.assertTrue(success,network.message(params,SELLERCARD_APPRAISELISTNEW ,"接口返回失败状态",response.body().asString()));
Assert.assertEquals(appraiseState,1,network.message(params,SELLERCARD_APPRAISELISTNEW ,"返回数据为空",response.body().asString()));
//取消展示
params.clear();
params.put("appraiseState",0);
params.put("id",appraiseId);
params.put("isPersonal",true);
response = network.postResponse(params, SELLERCARD_EDITCARDAPPRAISE);
success = response.jsonPath().getBoolean("success");
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITCARDAPPRAISE,"接口返回失败状态",response.body().asString()));
Assert.assertTrue(data,network.message(params,SELLERCARD_EDITCARDAPPRAISE ,"删除失败",response.body().asString()));
//查看是否修改成功
params.clear();
params.put("scid",scid);
params.put("pageIndex",1);
params.put("pageSize",30);
params.put("appraiseState",0);
params.put("isPersonal",true);
response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW );
success = response.jsonPath().getBoolean("success");
appraiseState = response.jsonPath().getJsonObject(path);
Assert.assertTrue(success,network.message(params,SELLERCARD_APPRAISELISTNEW ,"接口返回失败状态",response.body().asString()));
Assert.assertEquals(appraiseState,0,network.message(params,SELLERCARD_APPRAISELISTNEW ,"删除失败",response.body().asString()));
}
@Test(description = "删除个人评价", priority = 25) //priorty 方法执行优先级
public void 删除个人评价() {
userTku();
sleep(1000);
Map<String, Object> params = new HashMap<String, Object>();
params.put("id",appraiseId);
Response response = network.postResponse(params, SELLERCARD_DELCARDAPPRAISE);
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_DELCARDAPPRAISE,"接口返回失败",response.body().asString()));
Assert.assertTrue(data,network.message(params,SELLERCARD_DELCARDAPPRAISE ,"删除失败",response.body().asString()));
//查看是否删除成功
params.clear();
params.put("scid",scid);
params.put("pageIndex",1);
params.put("pageSize",30);
params.put("appraiseState",1);
params.put("isPersonal",true);
response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW );
success = response.jsonPath().getBoolean("success");
Object ownAppraise = response.jsonPath().getJsonObject("data.ownAppraise");
Assert.assertTrue(success,network.message(params,SELLERCARD_APPRAISELISTNEW ,"接口返回失败",response.body().asString()));
Assert.assertNull(ownAppraise,network.message(params,SELLERCARD_APPRAISELISTNEW ,"删除失败",response.body().asString()));
}
@Test(description = "查看公司信息", priority = 26) //priorty 方法执行优先级
public void 查看公司信息() {
agentTku();
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params, SELLERCARD_COMPANYINFO);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_COMPANYINFO,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_COMPANYINFO ,"公司信息为空",response.body().asString()));
}
@Test(description = "分享名片", priority = 27) //priorty 方法执行优先级
public void 分享名片() {
Map<String, Object> params = new HashMap<String, Object>();
String scene = scid + ","+userId +",s=1";
params.put("needAvatarCover",true);
params.put("pageType",1);
params.put("scene",scene);
params.put("visitorId",userId);
Response response = network.postResponse(params, SELLERCARD_AYSNCGETMPORCODE);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_AYSNCGETMPORCODE,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_AYSNCGETMPORCODE ,"公司信息为空",response.body().asString()));
}
@Test(description = "查看赠险列表", priority = 28) //priorty 方法执行优先级
public void 查看赠险列表() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params,SELLERCARD_INSURANCELISTV2);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_INSURANCELISTV2 ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_INSURANCELISTV2 ,"赠险列表为空",response.body().asString()));
}
@Test(description = "获取代理人专栏配置", priority = 29) //priorty 方法执行优先级
public void 获取代理人专栏配置() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params,SELLERCARD_GETENHANCEDCOLUMNCONFIG);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_GETENHANCEDCOLUMNCONFIG ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_GETENHANCEDCOLUMNCONFIG ,"配置为空",response.body().asString()));
}
@Test(description = "关闭代理人名片专栏配置", priority = 30) //priorty 方法执行优先级
public void 关闭代理人专栏配置() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("configKey","personal_document_switch");
params.put("configValue",false);
Response response = network.postResponse(params,SELLERCONFIG_EDITCONFIG);
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,SELLERCONFIG_EDITCONFIG ,"接口返回失败",response.body().asString()));
Assert.assertTrue(data,network.message(params,SELLERCONFIG_EDITCONFIG ,"关闭配置失败",response.body().asString()));
//查看是否关闭成功
params.clear();
params.put("scid",scid);
response = network.getResponse(params,SELLERCARD_GETENHANCEDCOLUMNCONFIG);
success = response.jsonPath().getBoolean("success");
boolean val = response.jsonPath().getBoolean("data.find{it.code=='personal_document_switch'}.val");
Assert.assertTrue(success,network.message(params,SELLERCARD_GETENHANCEDCOLUMNCONFIG ,"接口返回失败",response.body().asString()));
Assert.assertFalse(val,network.message(params,SELLERCARD_GETENHANCEDCOLUMNCONFIG ,"关闭人专栏配置失败",response.body().asString()));
//还原
params.put("configKey","personal_document_switch");
params.put("configValue",true);
response = network.postResponse(params,SELLERCONFIG_EDITCONFIG);
success = response.jsonPath().getBoolean("success");
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,SELLERCONFIG_EDITCONFIG ,"接口返回失败",response.body().asString()));
Assert.assertTrue(data,network.message(params,SELLERCONFIG_EDITCONFIG ,"开启个人专栏配置失败",response.body().asString()));
}
@Test(description = "获取问答列表", priority = 31) //priorty 方法执行优先级
public void 获取问答列表() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params,SELLERCARD_GETQUESTIONS);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
questionId = response.jsonPath().getJsonObject("data.questionList.get(0).id");
Assert.assertTrue(success,network.message(params,SELLERCARD_GETQUESTIONS ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_GETQUESTIONS ,"配置为空",response.body().asString()));
}
@Test(description = "查询问答详情", priority = 32) //priorty 方法执行优先级
public void 查询问答详情() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("qId",questionId);
params.put("scid",scid);
Response response = network.getResponse(params,SELLERCARD_GETQUESTIONDETAIL);
boolean success = response.jsonPath().getBoolean("success");
Object questionAnswerVo = response.jsonPath().getJsonObject("data.questionAnswerVo");
Assert.assertTrue(success,network.message(params,SELLERCARD_GETQUESTIONDETAIL ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(questionAnswerVo,network.message(params,SELLERCARD_GETQUESTIONDETAIL ,"配置为空",response.body().asString()));
}
@Test(description = "扫描二维码", priority = 33) //priorty 方法执行优先级
public void 扫描二维码() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("qId",questionId);
params.put("scId",scid);
params.put("clueTypeName","FAQ_VISIT_DETAIL");
params.put("locationSource",2);
params.put("sourceId",scid);
params.put("sourceType",1);
Response response = network.postResponse(params,SELLERCARD_SENDPUSHFORSCAN);
boolean success = response.jsonPath().getBoolean("success");
String data = response.jsonPath().getString("data.");
Assert.assertTrue(success,network.message(params,SELLERCARD_SENDPUSHFORSCAN ,"接口返回失败",response.body().asString()));
Assert.assertEquals(data,"success",network.message(params,SELLERCARD_SENDPUSHFORSCAN ,"data返回错误",response.body().asString()));
}
@Test(description = "查询虚拟用户咨询列表", priority = 34) //priorty 方法执行优先级
public void 查询虚拟用户咨询列表() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("size",6);
Response response = network.getResponse(params,SELLERCARD_REWARDUSERS);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
System.out.println(response.body().asString());
Assert.assertTrue(success,network.message(params,SELLERCARD_REWARDUSERS ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_REWARDUSERS ,"配置为空",response.body().asString()));
}
@Test(description = "获取问答底部福利测评专栏", priority = 35) //priorty 方法执行优先级
public void 获取问答底部福利测评专栏() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params,SELLERCARD_RECOMMENDLISTV3);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
System.out.println(response.body().asString());
Assert.assertTrue(success,network.message(params,SELLERCARD_RECOMMENDLISTV3 ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_RECOMMENDLISTV3 ,"配置为空",response.body().asString()));
}
@Test(description = "选择公司", priority = 36) //priorty 方法执行优先级
public void 选择公司() {
//查看公司列表
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageIndex", 1);
params.put("pageSize", 200);
Response response = network.getResponse(params, SELLERCARD_COMPANYLIST);
boolean success = response.jsonPath().getBoolean("success");
int companyId = response.jsonPath().getInt("data.list.find {it.companyName == '杭州兑吧网络科技有限公司'}.id");
Assert.assertTrue(success,network.message(params,SELLERCARD_COMPANYLIST ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(companyId, network.message(params, SELLERCARD_COMPANYLIST,"公司列表-获取失败",response.body().asString()));
//选择某公司
params.clear();
params.put("companyId", companyId);
response = network.postResponse(params, SELLERCARD_EDITBASEINFO);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params, SELLERCARD_EDITBASEINFO,"选择公司失败",response.body().asString()));
//查看是否更新公司成功
response = network.getResponse(SELLERCARD_TOPOFDETAIL);
success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
WechatCard card = JsonUtil.parseResponseToBean(response,WechatCard.class);
Assert.assertTrue(success,network.message(params,SELLERCARD_TOPOFDETAIL,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_TOPOFDETAIL,"返回数据为空",response.body().asString()));
Assert.assertEquals(card.getCompanyId(),companyId,network.message(params,SELLERCARD_TOPOFDETAIL,"名字修改失败",response.body().asString()));
//还原
params.clear();
params.put("companyId", 1);
response = network.postResponse(params, SELLERCARD_EDITBASEINFO);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params, SELLERCARD_EDITBASEINFO,"选择公司失败",response.body().asString()));
}
@Test(description = "获取代理人名片详情", priority = 37) //priorty 方法执行优先级
public void 获取代理人名片详情() {
sleep(1000);
Response response = network.getResponse(SELLERCARD_READDETAIL);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
System.out.println(response.body().asString());
Assert.assertTrue(success,network.message(SELLERCARD_READDETAIL ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(SELLERCARD_READDETAIL ,"返回数据为空",response.body().asString()));
}
@Test(description = "查看风险测评", priority = 38) //priorty 方法执行优先级
public void 查看风险测评(){
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid", scid);
Response response = network.getResponse(params, SELLERCARD_ISDISPLAYACTIVITY);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,SELLERCARD_ISDISPLAYACTIVITY ,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,SELLERCARD_ISDISPLAYACTIVITY ,"返回数据为空",response.body().asString()));
}
@Test(description = "直接获取用户信息", priority = 39) //priorty 方法执行优先级
public void 直接获取用户信息(){
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid", scid);
Response response = network.getResponse(params, SELLERCARD_DIRECT);
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
System.out.println(response.body().asString());
Assert.assertTrue(success,network.message(params,SELLERCARD_DIRECT ,"接口返回失败",response.body().asString()));
Assert.assertTrue(data,network.message(params,SELLERCARD_DIRECT ,"返回数据为空",response.body().asString()));
}
@Test(description = "查看直播权限", priority = 40) //priorty 方法执行优先级
public void 查看直播权限() {
Response response = network.getResponse(SELLERCARD_HASLIVEAUTH);
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(SELLERCARD_HASLIVEAUTH ,"接口返回失败",response.body().asString()));
Assert.assertFalse(data,network.message(SELLERCARD_HASLIVEAUTH ,"权限直播错误",response.body().asString()));
}
@Test(description = "查看新手引导", priority = 41) //priorty 方法执行优先级
public void 查看新手引导() {
Response response = network.getResponse(SELLERCARD_CARDGUIDE);
boolean success = response.jsonPath().getBoolean("success");
int guideType = response.jsonPath().getInt("data.guideType");
Assert.assertTrue(success,network.message(SELLERCARD_CARDGUIDE ,"接口返回失败",response.body().asString()));
Assert.assertEquals(guideType,0,network.message(SELLERCARD_CARDGUIDE ,"引导类型错误",response.body().asString()));
}
@AfterClass
public static void tearDown(){
apiCount += 41;
}
}
......@@ -146,7 +146,7 @@ public class Treasure implements Authorization {
Assert.assertNotNull(data, network.message(simpleParam, BasicConfig.MOBILE_simple, "未登录查询分享人头像昵称失败", response.body().asString()));
}
@Test(description = "已登录查询分享人头像昵称", priority = 10)
@Test(description = "已登录查询助力信息", priority = 10)
public void 已登录查询分享人头像昵称() {
visitorAuth2();
Map<String, Object> infoParam = new HashMap<>();
......
......@@ -612,7 +612,33 @@ public class BasicConfig {
public static final String SELLERCARD_GETSELLERCARDSTYLE = HOST + "/kjy/mp/sellerConfig/getSellerCardStyle";
public static final String SELLERCARD_TOPOFCONTENT = HOST + "/kjy/mp/sellerCardV5/topOfContent";
public static final String SELLERCARD_BOTTOMOFCONTENT = HOST + "/kjy/mp/sellerCardV5/bottomOfContent";
public static final String SELLERCARD_GETPERSONINTROTEMPLATE = HOST + "/kjy/mp/sellerCardV5/getPersonalIntroTemplate";
public static final String SELLERCARD_UPDATESPLENDINGIMAGE = HOST + "/kjy/mp/sellerCard/updateSplendidImage";
public static final String SELLERCARD_GETSPLENDINGIMAGE = HOST + "/kjy/mp/sellerCard/getSellerSplendidImage";
public static final String SELLERCARD_EDITDELLERCASE = HOST + "/kjy/mp/sellerCard/editSellerCase";
public static final String SELLERCARD_UPDATESHOWSTATUSFORCASE = HOST + "/kjy/mp/sellerCardV5/updateShowStatusForCase";
public static final String SELLERCARD_DELETESELLERCASE = HOST + "/kjy/mp/sellerCard/deleteSellerCase";
public static final String SELLERCARD_ADDORUPDATEPRODUCT = HOST + "/kjy/mp/sellerCardV5/addOrUpdateProduct";
public static final String SELLERCARD_UPDATESHOWSTATUSFORPRODUCT = HOST + "/kjy/mp/sellerCardV5/updateShowStatusForProduct";
public static final String SELLERCARD_DELETEPRODUCT = HOST + "/kjy/mp/sellerCardV5/deleteProduct";
public static final String SELLERCARD_GETSELLERCASEINFO = HOST + "/kjy/mp/sellerCardV5/getSellerCaseInfo";
public static final String SELLERCARD_SAVECARDAPPRAISE = HOST + "/kjy/mp/sellerCard/saveCardAppraise";
public static final String SELLERCARD_DELCARDAPPRAISE = HOST + "/kjy/mp/sellerCard/delCardAppraise";
public static final String SELLERCARD_EDITCARDAPPRAISE = HOST + "/kjy/mp/sellerCard/editCardAppraise";
public static final String SELLERCARD_COMPANYINFO = HOST + "/kjy/mp/sellerCard/company/info";
public static final String SELLERCARD_AYSNCGETMPORCODE = HOST + "/kjy/mp/sellerCard/asyncGetMpQrCode";
public static final String SELLERCARD_HASLIVEAUTH = HOST + "/kjy/mp/liveAgent/hasLiveAuth";
public static final String SELLERCARD_CARDGUIDE= HOST + "/kjy/mp/rookieGuide/cardGuide";
public static final String SELLERCARD_INSURANCELISTV2= HOST + "/kjy/mp/welfare/insuranceListV2";
public static final String SELLERCARD_GETENHANCEDCOLUMNCONFIG = HOST + "/kjy/mp/sellerConfig/getEnhancedColumnConfig";
public static final String SELLERCARD_GETQUESTIONDETAIL = HOST + "/kjy/mp/explosioncontent/qa/getQuestionDetail";
public static final String SELLERCARD_SENDPUSHFORSCAN = HOST + "/kjy/mp/explosioncontent/qa/sendPushForScan";
public static final String SELLERCARD_REWARDUSERS = HOST + "/kjy/mp/seller/novice/rewardUsers";
public static final String SELLERCARD_RECOMMENDLISTV3 = HOST + "/kjy/mp/welfare/recommendListV3";
public static final String SELLERCARD_READDETAIL = HOST + "/kjy/mp/sellerCard/readDetail";
public static final String SELLERCARD_GETINTERACTIONCONFIG = HOST + "/kjy/mp/sellerConfig/getInteractionConfig";
public static final String SELLERCARD_GETSELLERPROMOTEINFO = HOST + "/kjy/mp/seller/getSellerPromoteInfo";
public static final String SELLERCARD_DIRECT = HOST + "/kjy/mp/user/direct";
// *************** 上传 ***************
......
......@@ -73,4 +73,9 @@ public class JsonUtil {
return JSON.parseArray(str, tClass);
}
public static <T> List<T> parseResponsePathToListBean(Response response, String path,Class<T> tClass){
Object data = response.jsonPath().getJsonObject(path);
String str = new JsonBuilder(data).toString();
return JSON.parseArray(str, tClass);
}
}
......@@ -16,21 +16,11 @@
<class name="com.kjj.cases.basics.Pay"/>
</classes>
</test>
<test preserve-order="true" name="名片">
<classes>
<class name="com.kjj.cases.basics.SellerCard"/>
</classes>
</test>
<test preserve-order="true" name="上传">
<classes>
<class name="com.kjj.cases.basics.Upload"/>
</classes>
</test>
<test preserve-order="true" name="文章">
<classes>
<class name="com.kjj.cases.basics.Article"/>
</classes>
</test>
<test preserve-order="true" name="发圈">
<classes>
<class name="com.kjj.cases.basics.CircleFriends"/>
......@@ -51,6 +41,16 @@
<class name="com.kjj.cases.basics.GreetingCard"/>
</classes>
</test>
<test preserve-order="true" name="我的名片">
<classes>
<class name="com.kjj.cases.basics.card.PersonCard"/>
</classes>
</test>
<test preserve-order="true" name="文章中个人名片">
<classes>
<class name="com.kjj.cases.basics.card.ArticalPersonCard"/>
</classes>
</test>
<test preserve-order="true" name = "种草素材">
<classes>
<class name="com.kjj.cases.assistant.RecommendMaterial"/>
......
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