Commit 5ae0afcc authored by 龚小红's avatar 龚小红

修改部分接口规范名,修改了我的名片-选择公司,增加了营销工具首页、贺卡首页的接口测试用例

parent d7339e21
package com.kjj.cases.basics.card;
package com.kjj.cases.assistant.card;
import static com.kjj.config.BasicConfig.*;
import static com.kjj.utils.ThreadSleepUtils.sleep;
......@@ -101,7 +101,7 @@ public class ArticalPersonCard implements Authorization {
@Test(description="代理人_头部名片详情",priority = 7)
public void 代理人_头部名片详情(){
//获取加密的销售ID
sleep(1000);
sleep(5000);
Response response = network.getResponse(USER_INFO);
sid = response.jsonPath().getString("data.encodeSellerId");
String sellerName = response.jsonPath().getString("data.sellerName");
......@@ -201,7 +201,7 @@ public class ArticalPersonCard implements Authorization {
//切换为访客
userTku();
sleep(1000);
sleep(2000);
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);//代理人的scid
params.put("cancelPush",false);
......
package com.kjj.cases.basics.card;
package com.kjj.cases.assistant.card;
import com.kjj.bean.card.GoodMajor;
import com.kjj.bean.card.WechatCard;
......@@ -61,19 +61,19 @@ public class PersonCard implements Authorization {
@Test(description = "获取名片顶部信息",priority = 3)
public void 获取名片顶部信息(){
Response response = network.getResponse(SELLERCARD_TOPOFDETAIL);
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()));
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)
......@@ -87,24 +87,24 @@ public class PersonCard implements Authorization {
params.put("address", "重庆市轨道集团建设大楼");
params.put("addressLocation", "106.544362,29.559164");
params.put("avatarStyle", 1);
Response response = network.postResponse(params,SELLERCARD_EDITBASEINFO);
Response response = network.postResponse(params, SELLERCARD_editBaseInfo);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITBASEINFO,"接口返回失败状态",response.body().asString()));
Assert.assertTrue(success,network.message(params, SELLERCARD_editBaseInfo,"接口返回失败状态",response.body().asString()));
//查看修改是否成功
response = network.getResponse(SELLERCARD_TOPOFDETAIL);
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()));
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();
......@@ -115,24 +115,24 @@ public class PersonCard implements Authorization {
params.put("address", "杭州数娱大厦(文一西路98号)");
params.put("addressLocation", "120.112204,30.287785");
params.put("avatarStyle", 3);
response = network.postResponse(params,SELLERCARD_EDITBASEINFO);
response = network.postResponse(params, SELLERCARD_editBaseInfo);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITBASEINFO,"接口返回失败状态",response.body().asString()));
Assert.assertTrue(success,network.message(params, SELLERCARD_editBaseInfo,"接口返回失败状态",response.body().asString()));
}
@Test(description = "获取用户个人介绍",priority = 5)
public void 获取用户个人介绍(){
Response response = network.getResponse(SELLERCARD_PERSONALPROFILE);
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()));
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 获取用户个人介绍模板(){
......@@ -154,48 +154,48 @@ public class PersonCard implements Authorization {
//修改个人介绍和年限
params.put("personalIntro", "本人有多年的保险销售和管理经验!");
params.put("exprLength", "4");
Response response = network.postResponse(params,SELLERCARD_EDITBASEINFO);
Response response = network.postResponse(params, SELLERCARD_editBaseInfo);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITBASEINFO,"接口返回失败状态",response.body().asString()));
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);
response = network.postResponse(params, SELLERCARD_editMajorGoodAuth);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITMAJORGOODAUTH,"接口返回失败状态",response.body().asString()));
Assert.assertTrue(success,network.message(params, SELLERCARD_editMajorGoodAuth,"接口返回失败状态",response.body().asString()));
//查看修改是否成功
response = network.getResponse(SELLERCARD_PERSONALPROFILE);
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()));
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);
response = network.postResponse(params, SELLERCARD_editBaseInfo);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITBASEINFO,"接口返回失败状态",response.body().asString()));
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);
response = network.postResponse(params, SELLERCARD_editMajorGoodAuth);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_EDITMAJORGOODAUTH,"接口返回失败状态",response.body().asString()));
Assert.assertTrue(success,network.message(params, SELLERCARD_editMajorGoodAuth,"接口返回失败状态",response.body().asString()));
}
@Test(description = "更新代理人精彩点滴照片",priority = 8)
......@@ -235,26 +235,26 @@ public class PersonCard implements Authorization {
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);
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()));
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("pageSize",10);
params.put("isMore",false);
Response response = network.getResponse(params, SELLERCARD_SELLERCARDCASENEW);
Response response = network.getResponse(params, SELLERCARD_sellerCardCasesList);
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()));
Assert.assertTrue(success,network.message(params, SELLERCARD_sellerCardCasesList,"接口返回失败状态",response.body().asString()));
Assert.assertNotNull(data,network.message(params, SELLERCARD_sellerCardCasesList,"返回数据为空",response.body().asString()));
Assert.assertEquals(count,1, network.message(params, SELLERCARD_sellerCardCasesList,"服务案例-获取失败",response.body().asString()));
}
@Test(description = "添加个人案例", priority = 12) //priorty 方法执行优先级
......@@ -267,25 +267,25 @@ public class PersonCard implements Authorization {
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()));
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);
response = network.getResponse(params, SELLERCARD_sellerCardCasesList);
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()));
Assert.assertEquals(count,2, network.message(params, SELLERCARD_sellerCardCasesList,"服务案例-获取案例数量错误",response.body().asString()));
Assert.assertEquals(caseIntro,"案例描述A", network.message(params, SELLERCARD_sellerCardCasesList,"服务案例-描述错误",response.body().asString()));
Assert.assertEquals(customerName,"客户A", network.message(params, SELLERCARD_sellerCardCasesList,"服务案例-客户错误",response.body().asString()));
Assert.assertEquals(product,"金牌产品A", network.message(params, SELLERCARD_sellerCardCasesList,"服务案例-产品错误",response.body().asString()));
Assert.assertTrue(isShow, network.message(params, SELLERCARD_sellerCardCasesList,"服务案例-展示状态错误",response.body().asString()));
}
@Test(description = "修改个人案例", priority = 13) //priorty 方法执行优先级
......@@ -297,16 +297,16 @@ public class PersonCard implements Authorization {
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);
response = network.getResponse(params, SELLERCARD_sellerCardCasesList);
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()));
Assert.assertEquals(count,2, network.message(params, SELLERCARD_sellerCardCasesList,"服务案例-获取案例数量错误",response.body().asString()));
Assert.assertEquals(caseIntro,"案例描述A进行了更新", network.message(params, SELLERCARD_sellerCardCasesList,"服务案例-描述错误",response.body().asString()));
}
@Test(description = "修改个人案例展示状态", priority = 14) //priorty 方法执行优先级
......@@ -328,10 +328,10 @@ public class PersonCard implements Authorization {
params.put("scid",scid);
params.put("pageSize",10);
params.put("isMore",true);
response = network.getResponse(params, SELLERCARD_SELLERCARDCASENEW);
response = network.getResponse(params, SELLERCARD_sellerCardCasesList);
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()));
Assert.assertFalse(isShow, network.message(params, SELLERCARD_sellerCardCasesList,"服务案例-展示状态错误",response.body().asString()));
//展示
params.clear();
......@@ -341,8 +341,8 @@ public class PersonCard implements Authorization {
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()));
Assert.assertTrue(success,network.message(params, SELLERCARD_personalProfile,"接口返回失败状态",response.body().asString()));
Assert.assertTrue(data,network.message(params, SELLERCARD_personalProfile,"更新失败",response.body().asString()));
//查看状态是否更新成功
......@@ -350,9 +350,9 @@ public class PersonCard implements Authorization {
params.put("scid",scid);
params.put("pageSize",10);
params.put("isMore",true);
response = network.getResponse(params, SELLERCARD_SELLERCARDCASENEW);
response = network.getResponse(params, SELLERCARD_sellerCardCasesList);
isShow = response.jsonPath().getBoolean(path);
Assert.assertTrue(isShow, network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-展示状态错误",response.body().asString()));
Assert.assertTrue(isShow, network.message(params, SELLERCARD_sellerCardCasesList,"服务案例-展示状态错误",response.body().asString()));
}
@Test(description = "访客查看某条个人案例", priority = 15) //priorty 方法执行优先级
......@@ -364,7 +364,7 @@ public class PersonCard implements Authorization {
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()));
Assert.assertEquals(caseIntro,"案例描述A进行了更新", network.message(params, SELLERCARD_sellerCardCasesList,"服务案例-描述错误",response.body().asString()));
}
@Test(description = "删除个人案例", priority = 16) //priorty 方法执行优先级
......@@ -373,16 +373,16 @@ public class PersonCard implements Authorization {
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()));
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);
response = network.getResponse(params, SELLERCARD_sellerCardCasesList);
int count = response.jsonPath().getInt("data.sellerCases.size()");
Assert.assertEquals(count,3, network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-获取失败",response.body().asString()));
Assert.assertEquals(count,1, network.message(params, SELLERCARD_sellerCardCasesList,"服务案例-获取失败",response.body().asString()));
}
@Test(description = "查看精选产品", priority = 17) //priorty 方法执行优先级
......@@ -391,13 +391,13 @@ public class PersonCard implements Authorization {
params.put("scid",scid);
params.put("pageSize",10);
params.put("isMore",true);
Response response = network.getResponse(params, SELLERCARD_PRODUCTLIST);
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()));
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,2, network.message(params, SELLERCARD_productList,"服务案例-获取失败",response.body().asString()));
}
@Test(description = "添加精选产品", priority = 18) //priorty 方法执行优先级
......@@ -416,7 +416,7 @@ public class PersonCard implements Authorization {
params.put("scid",scid);
params.put("pageSize",30);
params.put("isMore",true);
response = network.getResponse(params, SELLERCARD_PRODUCTLIST);
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");
......@@ -424,12 +424,12 @@ public class PersonCard implements Authorization {
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()));
Assert.assertEquals(count,3, 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 方法执行优先级
......@@ -446,17 +446,17 @@ public class PersonCard implements Authorization {
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);
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()));
Assert.assertEquals(count,3, network.message(params, SELLERCARD_productList,"服务案例-获取失败",response.body().asString()));
Assert.assertEquals(productFeature,"这是产品描述进行了更新", network.message(params, SELLERCARD_productList,"服务案例-产品错误",response.body().asString()));
}
@Test(description = "修改产品展示状态", priority =20) //priorty 方法执行优先级
......@@ -478,11 +478,11 @@ public class PersonCard implements Authorization {
params.put("scid",scid);
params.put("pageSize",30);
params.put("isMore",true);
response = network.getResponse(params, SELLERCARD_PRODUCTLIST);
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()));
Assert.assertFalse(isShow, network.message(params, SELLERCARD_productList,"服务案例-展示状态错误",response.body().asString()));
//展示
params.clear();
......@@ -500,9 +500,9 @@ public class PersonCard implements Authorization {
params.put("scid",scid);
params.put("pageSize",30);
params.put("isMore",true);
response = network.getResponse(params, SELLERCARD_PRODUCTLIST);
response = network.getResponse(params, SELLERCARD_productList);
isShow = response.jsonPath().getBoolean(path);
Assert.assertTrue(isShow, network.message(params, SELLERCARD_PRODUCTLIST,"服务案例-展示状态错误",response.body().asString()));
Assert.assertTrue(isShow, network.message(params, SELLERCARD_productList,"服务案例-展示状态错误",response.body().asString()));
}
@Test(description = "删除精选产品", priority = 21) //priorty 方法执行优先级
......@@ -519,9 +519,9 @@ public class PersonCard implements Authorization {
params.put("scid",scid);
params.put("pageSize",30);
params.put("isMore",false);
response = network.getResponse(params, SELLERCARD_PRODUCTLIST);
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()));
Assert.assertEquals(count,2, network.message(params, SELLERCARD_productList,"服务案例-获取失败",response.body().asString()));
}
@Test(description = "查看客户评价", priority = 22) //priorty 方法执行优先级
public void 查看客户评价() {
......@@ -531,11 +531,11 @@ public class PersonCard implements Authorization {
params.put("pageSize",3);
params.put("appraiseState",1);
params.put("isPersonal",false);
Response response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW );
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()));
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 方法执行优先级
......@@ -543,7 +543,7 @@ public class PersonCard implements Authorization {
userTku();
sleep(1000);
Response response = network.getResponse(SELLERCARD_TOPOFDETAIL);
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);
......@@ -565,18 +565,18 @@ public class PersonCard implements Authorization {
params.put("pageSize",30);
params.put("appraiseState",1);
params.put("isPersonal",true);
response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW );
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()));
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 方法执行优先级
......@@ -602,12 +602,12 @@ public class PersonCard implements Authorization {
params.put("pageSize",30);
params.put("appraiseState",1);
params.put("isPersonal",true);
response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW );
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()));
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();
......@@ -627,11 +627,11 @@ public class PersonCard implements Authorization {
params.put("pageSize",30);
params.put("appraiseState",0);
params.put("isPersonal",true);
response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW );
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()));
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 方法执行优先级
......@@ -654,11 +654,11 @@ public class PersonCard implements Authorization {
params.put("pageSize",30);
params.put("appraiseState",1);
params.put("isPersonal",true);
response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW );
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()));
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 方法执行优先级
......@@ -744,12 +744,12 @@ public class PersonCard implements Authorization {
public void 获取问答列表() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params,SELLERCARD_GETQUESTIONS);
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()));
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 方法执行优先级
......@@ -810,34 +810,34 @@ public class PersonCard implements Authorization {
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageIndex", 1);
params.put("pageSize", 200);
Response response = network.getResponse(params, SELLERCARD_COMPANYLIST);
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()));
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);
response = network.postResponse(params, SELLERCARD_editBaseInfo);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params, SELLERCARD_EDITBASEINFO,"选择公司失败",response.body().asString()));
Assert.assertTrue(success, network.message(params, SELLERCARD_editBaseInfo,"选择公司失败",response.body().asString()));
//查看是否更新公司成功
response = network.getResponse(SELLERCARD_TOPOFDETAIL);
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()));
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);
params.put("companyId", 6);
response = network.postResponse(params, SELLERCARD_editBaseInfo);
success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params, SELLERCARD_EDITBASEINFO,"选择公司失败",response.body().asString()));
Assert.assertTrue(success, network.message(params, SELLERCARD_editBaseInfo,"选择公司失败",response.body().asString()));
}
@Test(description = "获取代理人名片详情", priority = 37) //priorty 方法执行优先级
......@@ -855,11 +855,11 @@ public class PersonCard implements Authorization {
public void 查看风险测评(){
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid", scid);
Response response = network.getResponse(params, SELLERCARD_ISDISPLAYACTIVITY);
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()));
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 方法执行优先级
......@@ -880,7 +880,7 @@ public class PersonCard implements Authorization {
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()));
Assert.assertTrue(data,network.message(SELLERCARD_HASLIVEAUTH ,"权限直播错误",response.body().asString()));
}
@Test(description = "查看新手引导", priority = 41) //priorty 方法执行优先级
......
package com.kjj.cases.assistant.markettools;
import com.kjj.cases.admin.Authorization;
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.Map;
import static com.kjj.config.BasicConfig.*;
public class greetingCrad implements Authorization{
private static final NetworkUtils network = NetworkUtils.getInstance();
public String sid; // 加密的销售ID
public String greetingCardId; // 文章的contentId
public String scid; // getScid后的文章scid
public String scId; // 底部名片获取的scid
public int userId; // 代理人用户ID
public String visitId; // 访问记录ID
@BeforeClass
public void setUp(){
agentTku();
}
@Test(description = "营销工具聚合页内容",priority = 1)
public void 营销工具聚合页内容(){
Response response = network.getResponse(GREETING_getMarketingToolArea);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(GREETING_getMarketingToolArea,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(GREETING_getMarketingToolArea,"返回数据为空",response.body().asString()));
int greetingList = response.jsonPath().getInt("data.greetingList.size()");
int invitationList = response.jsonPath().getInt("data.greetingList.size()");
int templateList = response.jsonPath().getInt("data.greetingList.size()");
Assert.assertTrue(greetingList>0,network.message(GREETING_getMarketingToolArea,"贺卡列表为空",response.body().asString()));
Assert.assertTrue(invitationList>0,network.message(GREETING_getMarketingToolArea,"邀请函列表为空",response.body().asString()));
Assert.assertTrue(templateList>0,network.message(GREETING_getMarketingToolArea,"抽奖列表为空",response.body().asString()));
}
@Test(description = "获取趣味测试列表",priority = 2)
public void 获取趣味测试列表(){
HashMap<String,Object> params = new HashMap<String,Object>();
params.put("pageSize", 5);
Response response = network.getResponse(params,GREETING_answerPageList);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,GREETING_answerPageList,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,GREETING_answerPageList,"返回数据为空",response.body().asString()));
int answerPageList = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(answerPageList>0,network.message(params,GREETING_answerPageList,"趣味测试列表为空",response.body().asString()));
}
@Test(description = "获取代理人vip信息",priority = 3)
public void 获取代理人vip信息(){
Response response = network.getResponse(GREETING_getSellerVipInfo);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(GREETING_getSellerVipInfo,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(GREETING_getSellerVipInfo,"返回数据为空",response.body().asString()));
boolean isVip = response.jsonPath().getBoolean("data.isVip");
Assert.assertTrue(isVip,network.message(GREETING_getSellerVipInfo,"代理人不是vip用户",response.body().asString()));
}
@Test(description = "检查访客登录信息",priority = 4)
public void 检查访客登录信息(){
Response response = network.getResponse(GREETING_checkVisitor);
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(GREETING_checkVisitor,"接口返回失败",response.body().asString()));
Assert.assertTrue(data,network.message(GREETING_checkVisitor,"返回数据为失败",response.body().asString()));
}
@Test(description = "获取贺卡首页banner",priority = 5)
public void 获取贺卡首页banner(){
Response response = network.getResponse(GREETING_banner);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(GREETING_banner,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(GREETING_banner,"返回数据为空",response.body().asString()));
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(GREETING_banner,"贺卡列表为空",response.body().asString()));
}
@Test(description = "获取转发数量最高的贺卡",priority = 6)
public void 获取转发数量最高的贺卡(){
Response response = network.getResponse(GREETING_allForward);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(GREETING_allForward,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(GREETING_allForward,"返回数据为空",response.body().asString()));
int size = response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0,network.message(GREETING_allForward,"贺卡列表为空",response.body().asString()));
greetingCardId = response.jsonPath().getString("data.get(0).id");
}
@Test(description = "根据page获取当前页面的Tips",priority = 7)
public void 根据page获取当前页面的Tips(){
HashMap<String,Object> params = new HashMap<String,Object>();
params.put("page", "greeting_card");
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 = 8)
public void 按类型查询标签(){
HashMap<String,Object> params = new HashMap<String,Object>();
params.put("tagType", "greeting_card");
Response response = network.getResponse(params,GREETING_findByType);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,GREETING_findByType,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,GREETING_findByType,"返回数据为空",response.body().asString()));
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(params,GREETING_findByType,"贺卡列表为空",response.body().asString()));
}
@Test(description = "获取当前用户关注公众号类型",priority = 9)
public void 获取当前用户关注公众号类型(){
Response response = network.getResponse(GREETING_oaSubscribeType);
boolean success = response.jsonPath().getBoolean("success");
int data = response.jsonPath().getInt("data");
Assert.assertTrue(success,network.message(GREETING_oaSubscribeType,"接口返回失败",response.body().asString()));
Assert.assertEquals(data,2,network.message(GREETING_oaSubscribeType,"返回数据错误",response.body().asString()));
}
@Test(description = "获取更多贺卡列表",priority = 10)
public void 获取更多贺卡列表(){
HashMap<String,Object> params = new HashMap<String,Object>();
params.put("pageIndex", "1");
params.put("pageSize", "10");
params.put("type", "0");
Response response = network.getResponse(GREETING_pageList);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,GREETING_pageList,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,GREETING_pageList,"返回数据为失败",response.body().asString()));
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0,network.message(params,GREETING_pageList,"贺卡列表为空",response.body().asString()));
}
//获取贺卡详情页
@Test(description="获取贺卡详情页",priority = 11)
public void 获取贺卡详情页() {
//根据ContentId获取Scid
Map<String, Object> params = new HashMap<String, Object>();
params.put("contentId",greetingCardId);
Response response = network.getResponse(params, GETSCID);
scid = response.jsonPath().getString("data");
Assert.assertNotNull(scid,network.message(params, GETSCID,"获取scid失败",response.body().asString()));
params.clear();
params.put("scid",scid);
response = network.getResponse(params,GREETING_H5INFO);
String id = response.jsonPath().getString("data.id");
Assert.assertEquals(greetingCardId, id, network.message(params,GREETING_H5INFO,"获取贺卡页面失败",response.body().asString()));
}
@Test(description="贺卡是否可以正常访问",priority = 12)
public void 贺卡是否可以正常访问() {
Response response = network.getResponse(GREETING_check);
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(GREETING_check,"接口返回失败",response.body().asString()));
Assert.assertTrue(data,network.message(GREETING_check,"返回数据为失败",response.body().asString()));
}
@Test(description="获取贺卡预览",priority = 13)
public void 获取贺卡预览() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params,GREETING_preView);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(GREETING_preView,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(GREETING_preView,"返回数据为空",response.body().asString()));
String blessWord = response.jsonPath().getString("data.blessWord");
String sellerSignature = response.jsonPath().getString("data.sellerSignature");
Assert.assertNotNull(blessWord,network.message(GREETING_preView,"返回数据为空",response.body().asString()));
Assert.assertEquals(sellerSignature,"吉吉",network.message(GREETING_preView,"返回数据为空",response.body().asString()));
}
@Test(description="红包功能是否开启",priority = 14)
public void 红包功能是否开启() {
Response response = network.getResponse(GREETING_isRedpackEnable);
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(GREETING_isRedpackEnable,"接口返回失败",response.body().asString()));
Assert.assertTrue(data,network.message(GREETING_isRedpackEnable,"返回数据为失败",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,GREETING_self);
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,GREETING_self,"接口返回失败",response.body().asString()));
Assert.assertTrue(data,network.message(params,GREETING_self,"返回数据为失败",response.body().asString()));
}
@Test(description="获取销售名片",priority = 16)
public void 获取销售名片() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params,GREETING_getInfoByScid);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,GREETING_getInfoByScid,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,GREETING_getInfoByScid,"返回数据为失败",response.body().asString()));
userId = response.jsonPath().getInt("data.userId");
String sellerName = response.jsonPath().getString("data.sellerName");
Assert.assertEquals(userId,5495,network.message(params,GREETING_getInfoByScid,"接口返回失败",response.body().asString()));
Assert.assertEquals(sellerName,"吉吉",network.message(params,GREETING_getInfoByScid,"返回数据为失败",response.body().asString()));
}
@Test(description="获取代理人是否超过次数限制",priority = 17)
public void 获取代理人是否超过次数限制() {
Response response = network.getResponse(GREETING_checkLimit);
boolean success = response.jsonPath().getBoolean("success");
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(GREETING_checkLimit,"接口返回失败",response.body().asString()));
Assert.assertFalse(data,network.message(GREETING_checkLimit,"返回数据为失败",response.body().asString()));
}
@Test(description="获取更多精彩贺卡",priority = 18)
public void 获取更多精彩贺卡() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params,GREETING_more);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,GREETING_more,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params,GREETING_more,"返回数据为空",response.body().asString()));
}
@AfterClass
public void teardown(){
}
}
package com.kjj.cases.basics;
import com.kjj.utils.BaseUtils;
import com.kjj.utils.NetworkUtils;
import io.restassured.response.Response;
import org.testng.Assert;
......@@ -32,17 +31,17 @@ public class GreetingCard {
// BANNER
@Test(description="BANNER",priority = 1)
public void BANNER() throws IOException {
Response response = network.getResponse(GREETING_BANNER);
Response response = network.getResponse(GREETING_banner);
boolean hasList = response.jsonPath().getInt("data.size()") > 0;
Assert.assertTrue(hasList,network.message(GREETING_BANNER,"获取Banner列表失败",response.body().asString()));
Assert.assertTrue(hasList,network.message(GREETING_banner,"获取Banner列表失败",response.body().asString()));
}
// 转发最多
@Test(description="大家都在发",priority = 2)
public void 大家都在发() throws IOException {
Response response = network.getResponse(GREETING_ALLFORWARD);
Response response = network.getResponse(GREETING_allForward);
boolean hasList = response.jsonPath().getInt("data.size()") > 0;
Assert.assertTrue(hasList,network.message(GREETING_ALLFORWARD,"获取大家都在发列表失败",response.body().asString()));
Assert.assertTrue(hasList,network.message(GREETING_allForward,"获取大家都在发列表失败",response.body().asString()));
}
// 贺卡tab
......@@ -51,10 +50,10 @@ public class GreetingCard {
Map<String, Object> params = new HashMap<String, Object>();
params.put("tagType","greeting_card");
params.put("exclusiveArea",0);
Response response = network.getResponse(params,GREETING_FINDBYTYPE);
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失败",response.body().asString()));
Assert.assertEquals(totalCount,3,network.message(params, GREETING_findByType,"获取贺卡tab失败",response.body().asString()));
}
// 获取539的贺卡列表
......@@ -65,11 +64,11 @@ public class GreetingCard {
params.put("pageSize", 10);
params.put("type",6);
params.put("tag1Id",tagId);
Response response = network.getResponse(params,GREETING_PAGELIST);
Response response = network.getResponse(params, GREETING_pageList);
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失败",response.body().asString()));
Assert.assertTrue(hasList,network.message(params, GREETING_pageList,"获取贺卡tab失败",response.body().asString()));
}
// 贺卡详情页
......
......@@ -12,17 +12,16 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import static com.kjj.config.BasicConfig.ISVIPSUBSCRIBE;
import static com.kjj.config.BasicConfig.SELLERCARD_APPRAISELISTNEW;
import static com.kjj.config.BasicConfig.SELLERCARD_COMPANYLIST;
import static com.kjj.config.BasicConfig.SELLERCARD_EDITBASEINFO;
import static com.kjj.config.BasicConfig.SELLERCARD_EDITMAJORGOODAUTH;
import static com.kjj.config.BasicConfig.SELLERCARD_GETQUESTIONS;
import static com.kjj.config.BasicConfig.SELLERCARD_ISDISPLAYACTIVITY;
import static com.kjj.config.BasicConfig.SELLERCARD_PERSONALPROFILE;
import static com.kjj.config.BasicConfig.SELLERCARD_PRODUCTLIST;
import static com.kjj.config.BasicConfig.SELLERCARD_SELLERCARDCASENEW;
import static com.kjj.config.BasicConfig.SELLERCARD_TOPOFDETAIL;
import static com.kjj.config.BasicConfig.SELLERCARD_appraiseListNew;
import static com.kjj.config.BasicConfig.SELLERCARD_companyList;
import static com.kjj.config.BasicConfig.SELLERCARD_editBaseInfo;
import static com.kjj.config.BasicConfig.SELLERCARD_editMajorGoodAuth;
import static com.kjj.config.BasicConfig.SELLERCARD_getQuestions;
import static com.kjj.config.BasicConfig.SELLERCARD_isDisplayActivity;
import static com.kjj.config.BasicConfig.SELLERCARD_personalProfile;
import static com.kjj.config.BasicConfig.SELLERCARD_productList;
import static com.kjj.config.BasicConfig.SELLERCARD_sellerCardCasesList;
import static com.kjj.config.BasicConfig.SELLERCARD_topOfDetail;
import static com.kjj.config.BasicConfig.VERSION_INFO;
import static com.kjj.config.BasicConfig.WECHAT_NAME;
import static com.kjj.config.BasicConfig.apiCount;
......@@ -60,12 +59,12 @@ public class SellerCard {
@Test(description = "头部展示", priority = 3)
public void 头部展示() throws IOException {
//获取信息
Response response = network.getResponse(SELLERCARD_TOPOFDETAIL);
Response response = network.getResponse(SELLERCARD_topOfDetail);
scid = response.jsonPath().getString("data.scid");
sellerId = response.jsonPath().getString("data.sellerId");
String sellerName = response.jsonPath().getString("data.sellerName");
Assert.assertEquals(sellerName, WECHAT_NAME, network.message(SELLERCARD_TOPOFDETAIL,"获取用户失败",response.body().asString()));
Assert.assertEquals(sellerName, WECHAT_NAME, network.message(SELLERCARD_topOfDetail,"获取用户失败",response.body().asString()));
//修改用户信息
Map<String, Object> params = new HashMap<String, Object>();
......@@ -75,60 +74,60 @@ public class SellerCard {
params.put("address", "杭州数娱大厦(文一西路98号)");
params.put("addressLocation", "120.112204,30.287785");
params.put("avatarStyle", 3);
Response editRsponse = network.postResponse(params, SELLERCARD_EDITBASEINFO);
Response editRsponse = network.postResponse(params, SELLERCARD_editBaseInfo);
boolean isChanged = editRsponse.jsonPath().getBoolean("success");
Assert.assertTrue(isChanged, network.message(params, SELLERCARD_EDITBASEINFO,"修改用户信息无效",response.body().asString()));
Assert.assertTrue(isChanged, network.message(params, SELLERCARD_editBaseInfo,"修改用户信息无效",response.body().asString()));
//重新获取用户信息
response = network.getResponse(SELLERCARD_TOPOFDETAIL);
response = network.getResponse(SELLERCARD_topOfDetail);
sellerName = response.jsonPath().getString("data.sellerName");
String phoneNumber = response.jsonPath().getString("data.phoneNumber");
String wechatNumber = response.jsonPath().getString("data.wechatNumber");
String address = response.jsonPath().getString("data.address");
int avatarStyle = response.jsonPath().getInt("data.avatarStyle");
Assert.assertEquals(sellerName, "自动化测试", 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()));
Assert.assertEquals(sellerName, "自动化测试", 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()));
// 改为原微信昵称
params.put("sellerName", WECHAT_NAME);
editRsponse = network.postResponse(params, SELLERCARD_EDITBASEINFO);
editRsponse = network.postResponse(params, SELLERCARD_editBaseInfo);
}
@Test(description = "专业介绍", priority = 4)
public void 专业介绍() throws IOException {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid", scid);
Response response = network.getResponse(params, SELLERCARD_PERSONALPROFILE);
Response response = network.getResponse(params, SELLERCARD_personalProfile);
int exprLength = response.jsonPath().getInt("data.exprLength"); //工作年限
Assert.assertEquals(exprLength, 2, network.message(params, SELLERCARD_PERSONALPROFILE,"个人介绍-获取工作年限不匹配",response.body().asString()));
Assert.assertEquals(exprLength, 2, network.message(params, SELLERCARD_personalProfile,"个人介绍-获取工作年限不匹配",response.body().asString()));
//修改工作年限和个人介绍
Map<String, Object> baseParams = new HashMap<String, Object>();
baseParams.put("exprLength", 2);
baseParams.put("personalIntro", "我在行业内整挺好!");
Response baseResponse = network.postResponse(baseParams, SELLERCARD_EDITBASEINFO);
Response baseResponse = network.postResponse(baseParams, SELLERCARD_editBaseInfo);
boolean isChanged = baseResponse.jsonPath().getBoolean("success");
Assert.assertTrue(isChanged, network.message(baseParams, SELLERCARD_EDITBASEINFO,"修改工作年限和个人介绍无效",response.body().asString()));
Assert.assertTrue(isChanged, network.message(baseParams, SELLERCARD_editBaseInfo,"修改工作年限和个人介绍无效",response.body().asString()));
//修改擅长专业
Map<String, Object> personalParams = new HashMap<String, Object>();
personalParams.put("goodAtCustom", "嘻嘻哈哈");
personalParams.put("goodAtDefault", "16");
Response personalResponse = network.postResponse(personalParams, SELLERCARD_EDITMAJORGOODAUTH);
Response personalResponse = network.postResponse(personalParams, SELLERCARD_editMajorGoodAuth);
isChanged = personalResponse.jsonPath().getBoolean("success");
Assert.assertTrue(isChanged, network.message(personalParams, SELLERCARD_EDITBASEINFO,"修改擅长专业无效",response.body().asString()));
Assert.assertTrue(isChanged, network.message(personalParams, SELLERCARD_editBaseInfo,"修改擅长专业无效",response.body().asString()));
//查看修改后的专业介绍
response = network.getResponse(params, SELLERCARD_PERSONALPROFILE);
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,"修改个人介绍失败",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()));
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 方法执行优先级
......@@ -140,32 +139,32 @@ public class SellerCard {
params.put("appraiseState", 1);
params.put("isPersonal", false);
Response response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW);
Response response = network.getResponse(params, SELLERCARD_appraiseListNew);
boolean hasAppraise = response.jsonPath().getInt("data.appraiseList.totalCount") > 0;
Assert.assertTrue(hasAppraise, network.message(params, SELLERCARD_APPRAISELISTNEW,"获取用户评价失败",response.body().asString()));
Assert.assertTrue(hasAppraise, network.message(params, SELLERCARD_appraiseListNew,"获取用户评价失败",response.body().asString()));
params.put("isPersonal", true);
response = network.getResponse(params, SELLERCARD_APPRAISELISTNEW);
response = network.getResponse(params, SELLERCARD_appraiseListNew);
hasAppraise = response.jsonPath().getInt("data.appraiseList.totalCount") == 0;
Assert.assertTrue(hasAppraise, network.message(params, SELLERCARD_APPRAISELISTNEW,"获取专业评价失败",response.body().asString()));
Assert.assertTrue(hasAppraise, network.message(params, SELLERCARD_appraiseListNew,"获取专业评价失败",response.body().asString()));
}
@Test(description = "互动问答", priority = 6) //priorty 方法执行优先级
public void 互动问答() throws IOException {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid", scid);
Response response = network.getResponse(params, SELLERCARD_GETQUESTIONS);
Response response = network.getResponse(params, SELLERCARD_getQuestions);
int qurstionsCount = response.jsonPath().getInt("data.questionList.size()");
Assert.assertEquals(qurstionsCount, 2, network.message(params, SELLERCARD_GETQUESTIONS,"获取用户评价失败",response.body().asString()));
Assert.assertEquals(qurstionsCount, 2, network.message(params, SELLERCARD_getQuestions,"获取用户评价失败",response.body().asString()));
}
@Test(description = "风险评测", priority = 7) //priorty 方法执行优先级
public void 风险评测() throws IOException {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid", scid);
Response response = network.getResponse(params, SELLERCARD_ISDISPLAYACTIVITY);
Response response = network.getResponse(params, SELLERCARD_isDisplayActivity);
String contentId = response.jsonPath().getString("data.contentId");//写死风险评测id
Assert.assertEquals(contentId, "Kj21Mzc0NzE", network.message(params, SELLERCARD_ISDISPLAYACTIVITY,"风险评测-获取失败",response.body().asString()));
Assert.assertEquals(contentId, "Kj21Mzc0NzE", network.message(params, SELLERCARD_isDisplayActivity,"风险评测-获取失败",response.body().asString()));
}
//
......@@ -174,16 +173,16 @@ public class SellerCard {
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageIndex", 1);
params.put("pageSize", 200);
Response response = network.getResponse(params, SELLERCARD_COMPANYLIST);
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,"公司列表-获取失败",response.body().asString()));
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);
response = network.postResponse(editParams, SELLERCARD_editBaseInfo);
boolean isChanged = response.jsonPath().getBoolean("success");
Assert.assertTrue(isChanged, network.message(editParams, SELLERCARD_EDITBASEINFO,"选择公司失效",response.body().asString()));
Assert.assertTrue(isChanged, network.message(editParams, SELLERCARD_editBaseInfo,"选择公司失效",response.body().asString()));
}
@Test(description = "服务案例", priority = 9) //priorty 方法执行优先级
......@@ -191,9 +190,9 @@ public class SellerCard {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
params.put("pageSize",4);
Response response = network.getResponse(params, SELLERCARD_SELLERCARDCASENEW);
Response response = network.getResponse(params, SELLERCARD_sellerCardCasesList);
int count = response.jsonPath().getInt("data.sellerCases.size()");
Assert.assertEquals(count,3, network.message(params, SELLERCARD_SELLERCARDCASENEW,"服务案例-获取失败",response.body().asString()));
Assert.assertEquals(count,3, network.message(params, SELLERCARD_sellerCardCasesList,"服务案例-获取失败",response.body().asString()));
}
@Test(description = "精选产品", priority = 10) //priorty 方法执行优先级
......@@ -202,9 +201,9 @@ public class SellerCard {
params.put("scid",scid);
params.put("pageSize",3);
params.put("isMore",false);
Response response = network.getResponse(params, SELLERCARD_PRODUCTLIST);
Response 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()));
Assert.assertEquals(count,3,network.message(params, SELLERCARD_productList,"精选产品-获取失败",response.body().asString()));
}
@AfterClass
......
......@@ -598,16 +598,16 @@ public class BasicConfig {
// *************** 名片 ***************
public static final String SELLERCARD_TOPOFDETAIL = HOST + "/kjy/mp/sellerCardV5/topOfDetail";
public static final String SELLERCARD_EDITBASEINFO = HOST + "/kjy/mp/sellerCard/editBaseInfo";
public static final String SELLERCARD_PERSONALPROFILE = HOST + "/kjy/mp/sellerCardV5/personalProfile";
public static final String SELLERCARD_EDITMAJORGOODAUTH = HOST + "/kjy/mp/sellerCard/editMajorGoodAuth";
public static final String SELLERCARD_APPRAISELISTNEW = HOST + "/kjy/mp/sellerCardV5/appraiseListNew";
public static final String SELLERCARD_GETQUESTIONS = HOST + "/kjy/mp/sellerCardV5/getQuestions";
public static final String SELLERCARD_ISDISPLAYACTIVITY = HOST + "/kjy/mp/clue/activity/isDisplayActivity";
public static final String SELLERCARD_COMPANYLIST = HOST + "/kjy/mp/company/list";
public static final String SELLERCARD_SELLERCARDCASENEW = HOST + "/kjy/mp/sellerCardV5/sellerCardCasesList";
public static final String SELLERCARD_PRODUCTLIST = HOST + "/kjy/mp/sellerCardV5/productList";
public static final String SELLERCARD_topOfDetail = HOST + "/kjy/mp/sellerCardV5/topOfDetail";
public static final String SELLERCARD_editBaseInfo = HOST + "/kjy/mp/sellerCard/editBaseInfo";
public static final String SELLERCARD_personalProfile = HOST + "/kjy/mp/sellerCardV5/personalProfile";
public static final String SELLERCARD_editMajorGoodAuth = HOST + "/kjy/mp/sellerCard/editMajorGoodAuth";
public static final String SELLERCARD_appraiseListNew = HOST + "/kjy/mp/sellerCardV5/appraiseListNew";
public static final String SELLERCARD_getQuestions = HOST + "/kjy/mp/sellerCardV5/getQuestions";
public static final String SELLERCARD_isDisplayActivity = HOST + "/kjy/mp/clue/activity/isDisplayActivity";
public static final String SELLERCARD_companyList = HOST + "/kjy/mp/company/list";
public static final String SELLERCARD_sellerCardCasesList = HOST + "/kjy/mp/sellerCardV5/sellerCardCasesList";
public static final String SELLERCARD_productList = HOST + "/kjy/mp/sellerCardV5/productList";
public static final String SELLERCARD_GETSELLERCARDCONFIG = HOST + "/kjy/mp/sellerConfig/getSellerCardConfig";
public static final String SELLERCARD_GETSELLERCARDSTYLE = HOST + "/kjy/mp/sellerConfig/getSellerCardStyle";
public static final String SELLERCARD_TOPOFCONTENT = HOST + "/kjy/mp/sellerCardV5/topOfContent";
......@@ -724,15 +724,27 @@ public class BasicConfig {
// *************** 贺卡 ***************
public static final String GREETING_BANNER = HOST + "/kjy/mp/greeting/banner";
public static final String GREETING_ALLFORWARD = HOST + "/kjy/mp/greeting/allForward";
public static final String GREETING_FINDBYTYPE = HOST + "/kjy/mp/tag/findByType";
public static final String GREETING_PAGELIST = HOST + "/kjy/mp/greeting/pageList";
public static final String GREETING_banner = HOST + "/kjy/mp/greeting/banner";
public static final String GREETING_allForward = HOST + "/kjy/mp/greeting/allForward";
public static final String GREETING_findByType = HOST + "/kjy/mp/tag/findByType";
public static final String GREETING_pageList = HOST + "/kjy/mp/greeting/pageList";
public static final String GREETING_CONFLIST = HOST + "/kjy/mp/greeting/conf/list";
public static final String GREETING_H5SHARE = ACTIVITY_HOST + "/kjy/mp/greeting/conf/h5share";
public static final String GREETING_H5INFO = ACTIVITY_HOST + "/kjy/mp/content/h5info";
public static final String GREETING_SAVEDEFAULT = ACTIVITY_HOST + "/kjy/mp/greeting/conf/saveDefault";
public static final String GREETING_getTipsByPage = HOST + "/kjy/mp/tips/getTipsByPage";
public static final String GREETING_getMarketingToolArea = HOST + "/kjy/mp/home/getMarketingToolArea";
public static final String GREETING_answerPageList = HOST + "/kjy/mp/game/answerPageList";
public static final String GREETING_getSellerVipInfo = HOST + "/kjy/mp/seller/getSellerVipInfo";
public static final String GREETING_checkVisitor = HOST + "/kjy/mp/greeting/checkVisitor";
public static final String GREETING_oaSubscribeType = HOST + "/kjy/mp/user/oaSubscribeType";
public static final String GREETING_check = ACTIVITY_HOST + "/kjy/mp/greeting/conf/check";
public static final String GREETING_preView = ACTIVITY_HOST + "/kjy/mp/greeting/preView";
public static final String GREETING_isRedpackEnable = ACTIVITY_HOST + "/kjy/mp/greeting/packet/isRedpackEnable";
public static final String GREETING_self = ACTIVITY_HOST + "/kjy/mp/seller/self";
public static final String GREETING_getInfoByScid = ACTIVITY_HOST + "/kjy/mp/seller/getInfoByScid";
public static final String GREETING_checkLimit = ACTIVITY_HOST + "/kjy/mp/greeting/conf/checkLimit";
public static final String GREETING_more = ACTIVITY_HOST + "/kjy/mp/greeting/more";
// *************** 管理后台 ***************
......
......@@ -11,51 +11,56 @@
<!-- <class name="com.kjj.qa.cases.Novice"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="支付">
<classes>
<class name="com.kjj.cases.basics.Pay"/>
</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.CircleFriends"/>
</classes>
</test>
<test preserve-order="true" name="boss看板">
<classes>
<class name="com.kjj.cases.basics.Boss"/>
</classes>
</test>
<test preserve-order="true" name="boss看板演示版">
<classes>
<class name="com.kjj.cases.basics.BossTest"/>
</classes>
</test>
<test preserve-order="true" name="贺卡">
<classes>
<class name="com.kjj.cases.basics.GreetingCard"/>
</classes>
</test>
<!-- <test preserve-order="true" name="支付">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.basics.Pay"/>-->
<!-- </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.CircleFriends"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="boss看板">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.basics.Boss"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="boss看板演示版">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.basics.BossTest"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="贺卡">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.basics.GreetingCard"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="我的名片">
<classes>
<class name="com.kjj.cases.basics.card.PersonCard"/>
<class name="com.kjj.cases.assistant.card.PersonCard"/>
</classes>
</test>
<test preserve-order="true" name="文章中个人名片">
<classes>
<class name="com.kjj.cases.basics.card.ArticalPersonCard"/>
<class name="com.kjj.cases.assistant.card.ArticalPersonCard"/>
</classes>
</test>
<test preserve-order="true" name = "种草素材">
<test preserve-order="true" name="营销工具-贺卡">
<classes>
<class name="com.kjj.cases.assistant.RecommendMaterial"/>
<class name="com.kjj.cases.assistant.markettools.greetingCrad"/>
</classes>
</test>
<!-- <test preserve-order="true" name = "种草素材">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.RecommendMaterial"/>-->
<!-- </classes>-->
<!-- </test>-->
</suite>
<!-- Suite -->
......
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