Commit b98cddad authored by 龚小红's avatar 龚小红

Merge branch 'Feature/20211215-gxh' into 'master'

针对关注拿不到用户头像的问题进行修复

See merge request test-group/kejiji!203
parents a435bbbd 864cd769
......@@ -133,28 +133,38 @@ public class GameLottery implements Authorization {
@Test(description = "代理人_编辑指定中奖",priority = 8)
public void 代理人_编辑指定中奖(){
//获取客户列表
visitor = null;
int i=1;
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageIndex",1);
params.put("pageSize",50);
params.put("visitorNickname","");
Response response = network.getResponse(params, LOTTERRY_customerList);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params, LOTTERRY_customerList,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params, LOTTERRY_customerList,"返回数据为空",response.body().asString()));
if(response.jsonPath().getInt("data.list.size()")<1){
System.out.println("客户列表为空");
}
//选择"Su Yi"
List<Visitor> visitorList = JsonUtil.parseResponsePathToListBean(response,"data.list",Visitor.class);
for (Visitor item:visitorList) {
if (item.getVisitorNickname().equals("Su Yi")){
visitor = item;
break;
while(visitor==null){
params.put("pageIndex",i);
params.put("pageSize",20);
params.put("visitorNickname","");
Response response = network.getResponse(params, LOTTERRY_customerList);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params, LOTTERRY_customerList,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params, LOTTERRY_customerList,"返回数据为空",response.body().asString()));
if(response.jsonPath().getInt("data.list.size()")<1){
System.out.println("客户列表为空");
}
String str = response.body().asString();
System.out.println(str.indexOf("Su Yi"));
if (str.indexOf("Su Yi") > 0){
//选择"Su Yi"
List<Visitor> visitorList = JsonUtil.parseResponsePathToListBean(response,"data.list",Visitor.class);
for (Visitor item:visitorList) {
if (item.getVisitorNickname().equals("Su Yi")){
visitor = item;
break;
}
}
}
i++;
}
//指定"Su Yi"中奖
ArrayList<Visitor> visitorListChoose = new ArrayList<Visitor>();
System.out.println(visitor.toString());
......@@ -164,16 +174,16 @@ public class GameLottery implements Authorization {
params.put("pageSize",20);
params.put("winners",visitorListChoose);
System.out.println(params.toString());
response = network.postResponse(params, LOTTERRY_addWinnersEn);
success = response.jsonPath().getBoolean("success");
data = response.jsonPath().getJsonObject("data");
System.out.println(response.body().asString());
Response response = network.postResponse(params, LOTTERRY_addWinnersEn);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params, LOTTERRY_addWinnersEn,"接口返回失败",response.body().asString()));
Assert.assertNotNull(data,network.message(params, LOTTERRY_addWinnersEn,"返回数据为空",response.body().asString()));
winnerId = response.jsonPath().getJsonObject("data.get(0).winnerId");
System.out.println("winnerId:" + winnerId);
}
@Test(description = "代理人_保存抽奖配置",priority = 9)
public void 代理人_保存抽奖配置(){
Map<String, Object> params = new HashMap<String, Object>();
......
......@@ -16,6 +16,7 @@ import java.io.IOException;
import java.util.*;
import static com.kjj.config.BasicConfig.*;
import static com.kjj.utils.BaseUtils.tku1;
import static com.kjj.utils.ThreadSleepUtils.sleep;
public class WhoSawMe implements Authorization {
......@@ -25,7 +26,7 @@ public class WhoSawMe implements Authorization {
private Long xxxSellerId;
private Long childSellerId;
private Long clueId;
private Long xxrUserId;
private long xxrUserId;
private Long jjSellerId;
private String tagId0;
private String reportId;
......@@ -34,6 +35,7 @@ public class WhoSawMe implements Authorization {
private String scid; // 代理人周报scid
private String taskArticleContentId; // 任务素材contentId
private int taskId;
private long userId;
@BeforeClass
public void setUp() throws IOException {
......@@ -44,6 +46,7 @@ public class WhoSawMe implements Authorization {
// 关闭数据看板演示数据
ForwardAndRead.closeDemoData();
xxrUserId = ForwardAndRead.decodeTku(VISITOR1_TKU).get("userId");
userId = ForwardAndRead.decodeTku(tku1).get("userId");
}
// 进入谁看过我主页
......@@ -162,9 +165,9 @@ public class WhoSawMe implements Authorization {
param.put("pageSize", 20);
response = network.postResponse(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "接口请求失败", response.body().asString()));
String visitorWxName = response.jsonPath().getString("data.list[0].nickName");
long visitId = response.jsonPath().getLong("data.list[0].visitId");
boolean isNew = response.jsonPath().getBoolean("data.list[1].isNew");
Assert.assertEquals(visitorWxName, ForwardAndRead.getUserInfo(VISITOR1_TKU).get("wxName"), network.message(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "最近访客微信昵称不匹配", response.body().asString()));
Assert.assertEquals(visitId, xxrUserId, network.message(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "最近访客微信昵称不匹配", response.body().asString()));
Assert.assertTrue(isNew, network.message(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "新老客户身份判断错误", response.body().asString()));
clueId = response.jsonPath().getLong("data.list[0].clueId");
......@@ -300,19 +303,6 @@ public class WhoSawMe implements Authorization {
}
@Test(description = "运营周报_生成代理人头像二维码", priority = 21)
public void 运营周报_生成代理人头像二维码() throws IOException{
long xxxUserId = ForwardAndRead.decodeTku(AGENT2_TKU).get("userId");
param.clear();
param.put("needAvatarCover", true);
param.put("pageType", 1);
param.put("scene", scid+","+xxxUserId+",s=1");
param.put("visitorId", xxxUserId);
response = network.postResponse(param, BasicConfig.SELLERCARD_AYSNCGETMPORCODE);
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(param, BasicConfig.SELLERCARD_AYSNCGETMPORCODE, "生成代理人头像二维码失败", response.body().asString()));
}
@Test(description = "运营周报_获取往期周报列表", priority = 22)
public void 运营周报_获取往期周报列表() throws IOException{
response = network.getResponse(BasicConfig.WEEKLY_LIST);
......@@ -928,9 +918,9 @@ public class WhoSawMe implements Authorization {
param.put("pageSize", 20);
response = network.postResponse(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "接口请求失败", response.body().asString()));
String clueSummary = response.jsonPath().getString("data.list.find{it.nickName == '小葡萄'}.clueSummary");
String clueSummary = response.jsonPath().getString("data.list.find{it.visitId == "+userId+"}.clueSummary");
Assert.assertEquals(clueSummary, "TA想要领取风险测评报告", network.message(param, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "最近访客微信昵称不匹配", response.body().asString()));
clueId = response.jsonPath().getLong("data.list.find{it.nickName == '小葡萄'}.clueId");
clueId = response.jsonPath().getLong("data.list.find{it.visitId == "+userId+"}.clueId");
}
// 销售线索_查看测评报告的领取详情
......@@ -959,8 +949,8 @@ public class WhoSawMe implements Authorization {
//查看线索客户信息
param.put("clueId",clueId);
Response response = network.getResponse(param,WHOSAWME_clientInfo);
String custName = response.jsonPath().getString("data.custName");
Assert.assertEquals(custName,"小葡萄", network.message(param,WHOSAWME_clientInfo,"线索客户信息错误",response.body().asString()));
Object data = response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(param,WHOSAWME_clientInfo,"线索客户信息错误",response.body().asString()));
}
// 访客_咨询问题
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment