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

删除留言功能

parent 024e5f1b
......@@ -302,14 +302,4 @@ public class ArticalPersonCard implements Authorization {
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()));
}
}
......@@ -81,13 +81,6 @@ public class RecommendMaterial implements Authorization {
Response response = network.getResponse(params, FORWARD);
Boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params, FORWARD, "种草文章转发失败", response.body().asString()));
//个人中心——历史分享
Map<String,Object> paramsHistory = new HashMap<>();
paramsHistory.put("sellerId",2991); //吉吉的销售员id
Response historyRes = network.getResponse(paramsHistory,HOME_sellerContentHistory);
Object list = historyRes.jsonPath().getJsonObject("data.list.get(0).scId");
Assert.assertEquals(list,scid, network.message(paramsHistory,HOME_sellerContentHistory,"获取历史分享失败",historyRes.body().asString()));
}
......@@ -387,15 +380,4 @@ public class RecommendMaterial implements Authorization {
//tku 切换为访客的
network.agentCookies.put(TKU_COOKIE_NAME, VISITOR_TKU);
}
// 获取代理人个人专栏
@Test(description = "访客_获取代理人私信", priority = 25)
public void 访客_获取代理人私信() {
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()));
}
}
\ No newline at end of file
......@@ -551,14 +551,12 @@ public class GreetingCrad implements Authorization{
params.put("scid",scid);
params.put("confId",confId);
Response response = network.postResponse(params,GREETING_open);
System.out.println(GREETING_open+"\n"+response.body().asString());
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(params,GREETING_open,"接口返回失败",response.body().asString()));
sleep(2000);
sleep(3000);
//获取拆红包结果
response = network.postResponse(params,GREETING_openResult);
System.out.println(GREETING_openResult+"\n"+response.body().asString());
success = response.jsonPath().getBoolean("success");
Object result = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,GREETING_openResult,"接口返回失败",response.body().asString()));
......@@ -566,7 +564,7 @@ public class GreetingCrad implements Authorization{
int redPacketState = response.jsonPath().getInt("data.redPacketState");
int receivedAmount = response.jsonPath().getInt("data.receivedAmount");
Assert.assertEquals(redPacketState,2,network.message(params,GREETING_openResult,"红包领取失败",response.body().asString()));
Assert.assertEquals(redPacketState,3,network.message(params,GREETING_openResult,"红包领取失败",response.body().asString()));
Assert.assertEquals(receivedAmount,0,network.message(params,GREETING_openResult,"红包领取金额错误",response.body().asString()));
}
......
......@@ -128,7 +128,7 @@ public class Pay implements Authorization {
@Test (description = "优惠券_优惠码绑定",priority = 10)
public void 优惠券_优惠码绑定 () {
userTku3();
//吉吉切换非会员
//切换非会员
updateTypeOrDate(207,false);
//绑定优惠码
Map<String, Object> params = new HashMap<String, Object>();
......
......@@ -639,172 +639,6 @@ public class MyCustomer implements Authorization {
Assert.assertTrue(birthRemind, network.message(param, BasicConfig.CUSTOMERDETAIL, "客户资料内容有误", response.body().asString()));
}
// 客户详情页_留言
@Test(description = "客户详情页_留言", priority = 42)
public void 客户详情页_留言() throws IOException{
// 判断销售员是否首次访问新功能(留言)
param = new HashMap<>();
param.put("type", 20);
response = network.getResponse(param, BasicConfig.NEWFUNC_FIRSTVISIT);
boolean data =response.jsonPath().getBoolean("data");
Assert.assertFalse(data, network.message(param, BasicConfig.NEWFUNC_FIRSTVISIT, "判断错误,用户非首次访问", response.body().asString()));
}
//客户详情页_留言_历史信息
@Test(description = "客户详情页_留言_历史信息", priority = 43)
public void 客户详情页_留言_历史信息() throws IOException{
param.clear();
param.put("role", 1);
param.put("sessionId", sessionId);
response = network.getResponse(param, BasicConfig.CHAT_COUNTHISTORY);
int data = response.jsonPath().getInt("data");
Assert.assertTrue(data > 1, network.message(param, BasicConfig.CHAT_COUNTHISTORY, "历史消息总数小于1", response.body().asString()));
}
// 客户详情页_留言_留言对象是否关注公众号
@Test(description = "客户详情页_留言_留言对象是否关注公众号", priority = 44)
public void 客户详情页_留言_留言对象是否关注公众号() throws IOException{
param = new HashMap<>();
param.put("targetSid", ForwardAndRead.decodeTku(BasicConfig.AGENT2_TKU).get("sellerId"));
response = network.getResponse(param, BasicConfig.CHAT_GETSUBSCRIBESTATUS);
int subscribe = response.jsonPath().getInt("data.subscribe");
Assert.assertEquals(subscribe, 1, network.message(param, BasicConfig.CHAT_GETSUBSCRIBESTATUS, "判断用户是否关注公众号失败", response.body().asString()));
}
// 客户详情页_留言_发送消息
@Test(description = "客户详情页_留言_发送消息", priority = 45)
public void 客户详情页_留言_发送消息() throws IOException{
param = new HashMap<>();
param.put("content", "Hello");
param.put("role", "1");
param.put("sessionId", sessionId);
response= network.postResponse(param, BasicConfig.CHAT_SEND);
Assert.assertEquals(response.jsonPath().getString("desc"), "OK", network.message(param, BasicConfig.CHAT_SEND, "消息发送失败", response.body().asString()));
}
// 留言_客户接收消息
@Test(description = "留言_客户接收消息", priority = 46)
public void 留言_客户接收消息() throws IOException{
String scid = ForwardAndRead.getContentScId(BasicConfig.ARTICLE_CONTENTID);
network.agentCookies.put(TKU_COOKIE_NAME, VISITOR1_TKU);
param.clear();
param.put("scid", scid);
response = network.getResponse(param, BasicConfig.CHECKUNREAD);
int unreadCount = response.jsonPath().getInt("data.unreadCount");
String sessionIds = response.jsonPath().getString("data.seller.sessionId");
Assert.assertEquals(unreadCount, 1, network.message(param, BasicConfig.CHECKUNREAD, "未读消息数错误", response.body().asString()));
Assert.assertEquals(sessionIds, sessionId, network.message(param, BasicConfig.CHECKUNREAD, "对话sessionId不符", response.body().asString()));
}
// 留言_客户阅读消息
@Test(description = "留言_客户阅读消息", priority = 47)
public void 留言_客户阅读消息() throws IOException{
// 客户获取最后一条聊天记录ID
param.clear();
param.put("pageSize", 30);
param.put("isPushMessage", true);
param.put("role", 2);
param.put("sessionId", sessionId);
response = network.getResponse(param, BasicConfig.CHAT_LIST);
List<ChatList> chatLists = JsonUtil.parseResponseToPageBean(response, ChatList.class);
lastMessageId = chatLists.get(chatLists.size()-1).getId();
param.clear();
param.put("role", 2);
param.put("sessionId", sessionId);
param.put("lastId", lastMessageId);
response = network.postResponse(param, BasicConfig.CHAT_READED);
Assert.assertEquals(response.jsonPath().getString("desc"), "OK", network.message(param, BasicConfig.CHAT_READED, "访客阅读消息失败", response.body().asString()));
network.agentCookies.put(TKU_COOKIE_NAME, BasicConfig.AGENT2_TKU);
}
// 客户详情页_留言_聊天内容
@Test(description = "客户详情页_留言_聊天内容", priority = 48)
public void 客户详情页_留言_聊天内容() throws IOException{
param = new HashMap<>();
param.put("pageSize", 30);
param.put("isPushMessage", true);
param.put("role", 1);
param.put("sessionId", sessionId);
response = network.getResponse(param, BasicConfig.CHAT_LIST);
List<ChatList> chatLists = JsonUtil.parseResponseToPageBean(response, ChatList.class);
if(chatLists.size() != 0){
Long senderId = chatLists.get(chatLists.size()-1).getSenderId();
long receiverId = chatLists.get(chatLists.size()-1).getReceiverId();
String content = chatLists.get(chatLists.size()-1).getContent();
int readFlag = chatLists.get(chatLists.size()-1).getReadFlag();
Assert.assertEquals(senderId, ForwardAndRead.decodeTku(BasicConfig.AGENT2_TKU).get("sellerId"), network.message(param, BasicConfig.CHAT_LIST, "发送者sellerId错误", response.body().asString()));
Assert.assertEquals(receiverId, visitor1UserId, network.message(param, BasicConfig.CHAT_LIST, "接收者userId错误", response.body().asString()));
Assert.assertEquals(content, "Hello", network.message(param, BasicConfig.CHAT_LIST, "消息内容错误", response.body().asString()));
Assert.assertEquals(readFlag, 1, network.message(param, BasicConfig.CHAT_LIST, "消息已读状态错误", response.body().asString()));
}else {
Assert.fail(network.message(param, BasicConfig.CHAT_LIST, "聊天记录为空", response.body().asString()));
}
}
// 留言_客户回复消息
@Test(description = "留言_客户回复消息", priority = 49)
public void 留言_客户回复消息() throws IOException{
network.agentCookies.put(TKU_COOKIE_NAME, VISITOR1_TKU);
param.clear();
param.put("content", "你好");
param.put("role", "2");
param.put("sessionId", sessionId);
response= network.postResponse(param, BasicConfig.CHAT_SEND);
Assert.assertEquals(response.jsonPath().getString("desc"), "OK", network.message(param, BasicConfig.CHAT_SEND, "消息发送失败", response.body().asString()));
network.agentCookies.put(TKU_COOKIE_NAME, BasicConfig.AGENT2_TKU);
}
// 我的客户首页_查询未读信息
@Test(description = "首页_查询未读信息", priority = 50)
public void 首页_查询未读信息() throws IOException{
response = network.getResponse(BasicConfig.SELLERUNREADMESSAGE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(BasicConfig.SELLERUNREADMESSAGE, "接口请求失败", response.body().asString()));
int unreadCount = response.jsonPath().getInt("data.unreadCount");
Assert.assertEquals(unreadCount, 1, network.message(param, BasicConfig.SELLERUNREADMESSAGE, "代理人未读消息数有误", response.body().asString()));
}
// 客户详情页_留言_最新信息
@Test(description = "客户详情页_留言_最新信息", priority = 51)
public void 客户详情页_留言_最新信息() throws IOException{
// 获取当前时间戳
Date current = new Date();
long timestamp = current.getTime();
param.clear();
param.put("role", 1);
param.put("sessionId", sessionId);
param.put("lastId", lastMessageId);
param.put("timestamp", timestamp);
response = network.getResponse(param, BasicConfig.CHAT_NEW);
long senderId = response.jsonPath().getLong("data.list[0].senderId");
long receiverId = response.jsonPath().getLong("data.list[0].receiverId");
String content = response.jsonPath().getString("data.list[0].content");
Assert.assertEquals(senderId, visitor1UserId, network.message(param, BasicConfig.CHAT_NEW, "发送者userID错误", response.body().asString()));
Assert.assertEquals(receiverId, (long)ForwardAndRead.decodeTku(BasicConfig.AGENT2_TKU).get("sellerId"), network.message(param, BasicConfig.CHAT_NEW, "接收者sellerId错误", response.body().asString()));
Assert.assertEquals(content, "你好", network.message(param, BasicConfig.CHAT_NEW, "消息内容错误", response.body().asString()));
}
// 消息通知页_对话记录
@Test(description = "消息通知页_对话记录", priority = 52)
public void 消息通知页_对话记录() throws IOException{
param = new HashMap<>();
param.put("pageIndex", 1);
param.put("pageSize", 90);
response = network.getResponse(param, BasicConfig.CHAT_LINKMANLIST);
List<LinkList> linkLists = JsonUtil.parseResponseToPageBean(response, LinkList.class);
String sessionIds = (String) linkLists.get(0).getSession().get("sessionId");
String lastContent = (String) linkLists.get(0).getSession().get("lastContent");
Assert.assertEquals(sessionIds, sessionId, network.message(param, BasicConfig.CHAT_LINKMANLIST, "对话记录sessionId有误", response.body().asString()));
Assert.assertEquals(lastContent, "你好", network.message(param, BasicConfig.CHAT_LINKMANLIST, "对话记录最后一条内容错误", response.body().asString()));
}
// 还原用户信息
@Test(description = "还原用户详细信息", priority = 53)
public void 还原用户详细信息() throws IOException{
......
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