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

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

1.在新手引导中加入资料包优化、互助问答优化后的整体创建绑定线索流程。

See merge request test-group/kejiji!169
parents 991a67fb 416f3143
......@@ -487,7 +487,7 @@ public class InvitationLetter implements Authorization{
Assert.assertTrue(size>0,network.message(params,GREETING_findByType,"标签列表为空",response.body().asString()));
}
@Test(description = "代理人_获取趣味测试列表",priority = 25)
@Test(description = "代理人_获取趣味测试列表",priority = 26)
public void 代理人_获取趣味测试列表(){
HashMap<String,Object> params = new HashMap<String,Object>();
params.put("pageIndex", 1);
......@@ -502,7 +502,7 @@ public class InvitationLetter implements Authorization{
Assert.assertTrue(size>0,network.message(params,GAME_answerPageList,"趣味测试列表为空",response.body().asString()));
}
@Test(description = "代理人_获取测试线索列表",priority = 25)
@Test(description = "代理人_获取测试线索列表",priority = 27)
public void 代理人_获取测试线索列表(){
HashMap<String,Object> params = new HashMap<String,Object>();
Response response = network.getResponse(params,GAME_clueList);
......
package com.kjj.cases.assistant.menu;
import com.alibaba.fastjson.JSONObject;
import com.beust.jcommander.internal.Lists;
import com.kjj.cases.admin.Authorization;
import com.kjj.cases.assistant.whoSawMe.ForwardAndRead;
import com.kjj.config.BasicConfig;
import com.kjj.utils.NetworkUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.*;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.kjj.config.BasicConfig.*;
......@@ -19,16 +25,24 @@ import static com.kjj.utils.ThreadSleepUtils.sleep;
public class NoviceGuidance implements Authorization {
private long userId; //小葡萄的用户id
private long sellerId; //小葡萄的销售id
private String grasscontentId = "Kj22MTk4NDc1OQ"; //文章id
private String grasscontentId = "Kj21Nzc1NDM"; //文章id:9692
private String scid; //转发文章的scid
private String visitId; //访问id
public final long ARTICLE_ID = 9692;
public long dataID; //资料包的contentID
public long dataContentID; //资料包的ID
public long articleDataID; //文章插入资料包后的包id
public long clueId; //线索ID
public long qaID; //互助问答ID
public String questionId; //互助问答加密后的ID
private static final NetworkUtils network = NetworkUtils.getInstance();
@BeforeClass
public void setUp(){
public void setUp() {
ssoLogin();
}
@Test(description = "禁用代理人小葡萄",priority = 1)
@Test(description = "禁用代理人小葡萄", priority = 1)
public void 禁用代理人小葡萄() throws UnsupportedEncodingException, SQLException {
//取关公众号
userId = (long) unsubscribe();
......@@ -36,7 +50,7 @@ public class NoviceGuidance implements Authorization {
disableUser(userId);
}
@Test(description = "小葡萄关注公众号并切换为会员",priority = 2)
@Test(description = "小葡萄关注公众号并切换为会员", priority = 2)
public void 小葡萄关注公众号并切换为会员() throws SQLException {
//关注公众号
userId = (long) subscribe();
......@@ -44,16 +58,157 @@ public class NoviceGuidance implements Authorization {
updateTypeOrDate(userId);
}
@Test(description = "进入首页唤起完善名片引导",priority = 3)
public void 进入首页唤起完善名片引导(){
@Test(description = "创建资料包", priority = 3)
public void 创建资料包() {
Map<String, Object> params = new HashMap<>();
params.put("datagramName", "自动化专用资料包");
params.put("bgImageUrl", "//yun.dui88.com/kjy/image/20211103/1635920821557.jpeg");
params.put("imageUrl", "///yun.dui88.com/kjy/image/20211103/1635920809529.jpeg");
params.put("materialGuide", "自动化专用资料包引导");
params.put("recommendWordId", "3");
List<Map<String, Object>> articleBlockList = new ArrayList<>();
Map<String, Object> articleBlock = new HashMap<>();
articleBlock.put("seriesTitle", "文章区块标题");
List<Long> ids = Lists.newArrayList();
ids.add(248107L);
articleBlock.put("contentIds", ids);
articleBlockList.add(articleBlock);
params.put("articleBlocks", articleBlockList);
System.out.println(JSONObject.toJSONString(params));
Response response = network.postResponse(params, BasicConfig.MANAGER_datagram_addOrUpdate);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(BasicConfig.MANAGER_datagram_addOrUpdate, "新增资料包失败", response.body().asString()));
}
@Test(description = "查询资料包列表", priority = 4)
public void 查询资料包列表() {
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("pageIndex", 1);
Params.put("pageSize", 20);
Response response = network.getResponse(Params, BasicConfig.MANAGER_datagram_list);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size > 0, network.message(BasicConfig.MANAGER_datagram_list, "用户绑定失败", response.body().asString()));
dataContentID = response.jsonPath().getLong("data.list.get(" + (size - 1) + ").contentId");
dataID = response.jsonPath().getLong("data.list.get(" + (size - 1) + ").id");
}
@Test(description = "查询资料包详情", priority = 5)
public void 查询资料包详情() {
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("id", dataID);
Response response = network.getResponse(Params, BasicConfig.MANAGER_datagram_detail);
String datagramName = response.jsonPath().getString("data.datagramName");
Assert.assertEquals(datagramName, "自动化专用资料包", network.message(BasicConfig.MANAGER_datagram_detail, "资料包标题错误", response.body().asString()));
}
@Test(description = "增加文章资料包", priority = 6)
public void 增加文章资料包() {
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("contentId", ARTICLE_ID);
Params.put("resourceId", dataContentID);
Params.put("resourceIntro", "自动化测试文案");
Params.put("resourceType", 7);
Params.put("subTitle", "自动化文章测试资料包介绍");
Params.put("title", "自动化文章测试资料包标题");
Response response = network.postResponse(Params, BasicConfig.MANAGER_resource_addOrUpdate);
articleDataID = response.jsonPath().getLong("data");
Assert.assertNotNull(articleDataID, network.message(BasicConfig.MANAGER_resource_addOrUpdate, "删除文章中资料包失败", response.body().asString()));
}
@Test(description = "查询资源位详情", priority = 7)
public void 查询资源位详情() {
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("id", articleDataID);
Response response = network.getResponse(Params, BasicConfig.MANAGER_resource_findById);
String resourceTitle = response.jsonPath().getString("data.resourceIntro");
Assert.assertEquals(resourceTitle, "自动化测试文案", network.message(BasicConfig.MANAGER_resource_findById, "资料包标题错误", response.body().asString()));
}
@Test(description = "资料包有文章绑定删除失败", priority = 8)
public void 资料包有文章绑定删除失败() {
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("id", dataID);
Response response = network.postResponse(Params, BasicConfig.MANAGER_resource_delete);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success, network.message(BasicConfig.MANAGER_resource_delete, "资料包有文章绑定,删除成功", response.body().asString()));
}
@Test(description = "创建互助问答",priority = 9)
public void 创建互助问答() {
Map<String, Object> params = new HashMap<>();
params.put("question","自动化专用互助问答");
params.put("questionType",2);
params.put("answerRichText","<p>自动化专用互助问答详情</p>");
params.put("datagramId",dataContentID);
params.put("answer","自动化专用互助问答简介");
params.put("extraQuestion","自动化关联问题");
Response response = network.postResponse(params, BasicConfig.MANAGER_qa_addOrUpdate);
boolean data=response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(BasicConfig.MANAGER_qa_addOrUpdate,"新增互助问答失败",response.body().asString()));
}
@Test(description = "查看互助问答列表",priority = 10)
public void 查看互助问答列表() {
Map<String, Object> params = new HashMap<>();
params.put("pageIndex",1);
params.put("pageSize",20);
Response response = network.getResponse(params, BasicConfig.MANAGER_qa_pageList);
int size=response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size > 0,network.message(BasicConfig.MANAGER_qa_pageList,"新增互助问答失败",response.body().asString()));
qaID = response.jsonPath().getLong("data.list.get(0).id");
}
@Test(description = "文章绑定互助问答",priority = 11)
public void 文章绑定互助问答() {
Map<String, Object> params = new HashMap<>();
List<Long> qas = Lists.newArrayList();
qas.add(qaID);
List<List<Integer> > tagList = Lists.newArrayList();
List<Integer> tags = Lists.newArrayList();
tags.add(707);
tagList.add(tags);
params.put("accurateContentType",1);
params.put("anxietyType",2);
params.put("contentId",ARTICLE_ID);
params.put("dataTag","1千+转发");
params.put("firstTagId",101);
params.put("isHotContent",0);
params.put("productId",101);
params.put("qaIds",qas);
params.put("recommendReason",2);
params.put("status",0);
params.put("tagList",tagList);
params.put("tags",1);
Response response = network.postResponse(params, BasicConfig.MANAGER_article_edit);
boolean data=response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(BasicConfig.MANAGER_article_edit,"新增互助问答失败",response.body().asString()));
}
@Test(description = "文章有绑定删除互助问答失败",priority = 12)
public void 文章有绑定删除互助问答失败() {
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("forceDelete",0);
Params.put("id",qaID);
Response response = network.postResponse(Params, BasicConfig.MANAGER_qa_del);
boolean success=response.jsonPath().getBoolean("success");
Assert.assertFalse(success,network.message(BasicConfig.MANAGER_qa_del,"互助问答已绑定文章下绑定成功",response.body().asString()));
}
@Test(description = "进入首页唤起完善名片引导", priority = 13)
public void 进入首页唤起完善名片引导() {
Response response = network.getResponse(ROOKIEGUIDE_homeGuide);
boolean success = response.jsonPath().getBoolean("success");
int guideType = response.jsonPath().getInt("data.guideType");
Assert.assertTrue(success,network.message(ROOKIEGUIDE_homeGuide,"接口返回失败",response.body().asString()));
Assert.assertEquals(guideType,11,network.message(ROOKIEGUIDE_homeGuide,"返回数据为空",response.body().asString()));
Assert.assertTrue(success, network.message(ROOKIEGUIDE_homeGuide, "接口返回失败", response.body().asString()));
Assert.assertEquals(guideType, 11, network.message(ROOKIEGUIDE_homeGuide, "返回数据为空", response.body().asString()));
}
@Test(description = "小葡萄保存名片基本信息",priority = 4)
@Test(description = "小葡萄保存名片基本信息", priority = 14)
public void 小葡萄保存名片基本信息() {
HashMap<String, Object> params = new HashMap<String, Object>();
//修改用户信息
......@@ -64,18 +219,18 @@ public class NoviceGuidance implements Authorization {
Assert.assertTrue(success, network.message(params, SELLERCARD_editBaseInfo, "接口返回失败状态", response.body().asString()));
}
@Test(description = "进入名片后唤起新手引导",priority = 5)
public void 进入名片后唤起新手引导(){
@Test(description = "进入名片后唤起新手引导", priority = 15)
public void 进入名片后唤起新手引导() {
sleep(2000);
Response response = network.getResponse(SELLERCARD_CARDGUIDE);
boolean success = response.jsonPath().getBoolean("success");
int guideType = response.jsonPath().getInt("data.guideType");
Assert.assertTrue(success,network.message(SELLERCARD_CARDGUIDE ,"接口返回失败",response.body().asString()));
Assert.assertEquals(guideType,21,network.message(SELLERCARD_CARDGUIDE ,"引导类型错误",response.body().asString()));
Assert.assertTrue(success, network.message(SELLERCARD_CARDGUIDE, "接口返回失败", response.body().asString()));
Assert.assertEquals(guideType, 21, network.message(SELLERCARD_CARDGUIDE, "引导类型错误", response.body().asString()));
}
@Test(description = "完成名片的新手引导",priority = 6)
public void 完成名片的新手引导(){
@Test(description = "完成名片的新手引导", priority = 16)
public void 完成名片的新手引导() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("guideType", 21);
Response response = network.postResponse(params, BasicConfig.COMPLETEGUIDE);
......@@ -88,30 +243,30 @@ public class NoviceGuidance implements Authorization {
response = network.getResponse(SELLERCARD_CARDGUIDE);
success = response.jsonPath().getBoolean("success");
int guideType = response.jsonPath().getInt("data.guideType");
Assert.assertTrue(success,network.message(SELLERCARD_CARDGUIDE ,"接口返回失败",response.body().asString()));
Assert.assertEquals(guideType,0,network.message(SELLERCARD_CARDGUIDE ,"引导类型错误",response.body().asString()));
Assert.assertTrue(success, network.message(SELLERCARD_CARDGUIDE, "接口返回失败", response.body().asString()));
Assert.assertEquals(guideType, 0, network.message(SELLERCARD_CARDGUIDE, "引导类型错误", response.body().asString()));
}
@Test(description = "再次进入首页唤起没有新手引导",priority = 7)
public void 再次进入首页唤起没有新手引导(){
@Test(description = "再次进入首页唤起没有新手引导", priority = 17)
public void 再次进入首页唤起没有新手引导() {
Response response = network.getResponse(ROOKIEGUIDE_homeGuide);
boolean success = response.jsonPath().getBoolean("success");
int guideType = response.jsonPath().getInt("data.guideType");
Assert.assertTrue(success,network.message(ROOKIEGUIDE_homeGuide,"接口返回失败",response.body().asString()));
Assert.assertEquals(guideType,12,network.message(ROOKIEGUIDE_homeGuide,"返回数据为空",response.body().asString()));
Assert.assertTrue(success, network.message(ROOKIEGUIDE_homeGuide, "接口返回失败", response.body().asString()));
Assert.assertEquals(guideType, 12, network.message(ROOKIEGUIDE_homeGuide, "返回数据为空", response.body().asString()));
}
@Test(description = "进入谁看过我后唤起转发引导",priority = 8)
public void 进入谁看过我后唤起转发引导(){
@Test(description = "进入谁看过我后唤起转发引导", priority = 18)
public void 进入谁看过我后唤起转发引导() {
Response response = network.getResponse(ROOKIECLUEGUIDE);
boolean success = response.jsonPath().getBoolean("success");
int guideType = response.jsonPath().getInt("data.guideType");
Assert.assertTrue(success,network.message(ROOKIECLUEGUIDE ,"接口返回失败",response.body().asString()));
Assert.assertEquals(guideType,35,network.message(ROOKIECLUEGUIDE ,"引导类型错误",response.body().asString()));
Assert.assertTrue(success, network.message(ROOKIECLUEGUIDE, "接口返回失败", response.body().asString()));
Assert.assertEquals(guideType, 35, network.message(ROOKIECLUEGUIDE, "引导类型错误", response.body().asString()));
}
@Test(description = "点击完成线索的转发引导",priority = 9)
public void 点击完成线索的转发引导(){
@Test(description = "点击完成线索的转发引导", priority = 19)
public void 点击完成线索的转发引导() {
Response response = network.getResponse(SELLERCARD_CARDGUIDE);
Map<String, Object> params = new HashMap<String, Object>();
params.put("guideType", 35);
......@@ -131,12 +286,12 @@ public class NoviceGuidance implements Authorization {
response = network.getResponse(ROOKIECLUEGUIDE);
success = response.jsonPath().getBoolean("success");
int guideType = response.jsonPath().getInt("data.guideType");
Assert.assertTrue(success,network.message(ROOKIECLUEGUIDE ,"接口返回失败",response.body().asString()));
Assert.assertEquals(guideType,0,network.message(ROOKIECLUEGUIDE ,"引导类型错误",response.body().asString()));
Assert.assertTrue(success, network.message(ROOKIECLUEGUIDE, "接口返回失败", response.body().asString()));
Assert.assertEquals(guideType, 0, network.message(ROOKIECLUEGUIDE, "引导类型错误", response.body().asString()));
}
@Test(description = "代理人转发文章后访客查看文章",priority = 10)
public void 代理人转发文章(){
@Test(description = "代理人转发文章后访客查看文章", priority = 20)
public void 代理人转发文章() {
//获取素材对应的scid
Map<String, Object> params = new HashMap<>();
params.put("contentId", grasscontentId);
......@@ -151,32 +306,36 @@ public class NoviceGuidance implements Authorization {
response = network.getResponse(params, FORWARD);
Boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params, FORWARD, "种草文章转发失败", response.body().asString()));
}
@Test(description = "代理人转发文章后访客查看文章", priority = 21)
public void 访客访问文章() {
//tKu 切换为访客
userTku();
//访客查看文章
Map<String, Object> params = new HashMap<>();
params.clear();
params.put("scid", scid);
params.put("fromUserId", userId); //代理人的用户id
params.put("visitPath", 1);
response = network.getResponse(params, CONTENT_READ);
Response response = network.getResponse(params, CONTENT_READ);
visitId = response.jsonPath().getString("data.visitId");
Assert.assertNotNull(visitId, network.message(params, CONTENT_READ, "访客记录查看素材失败", response.body().asString()));
}
@Test(description = "代理人点击谁看过我显示备注引导",priority = 11)
public void 代理人点击谁看过我显示备注引导(){
@Test(description = "代理人点击谁看过我显示备注引导", priority = 22)
public void 代理人点击谁看过我显示备注引导() {
network.agentCookies.put("tku", tku);
Response response = network.getResponse(ROOKIECLUEGUIDE);
boolean success = response.jsonPath().getBoolean("success");
int guideType = response.jsonPath().getInt("data.guideType");
Assert.assertTrue(success,network.message(ROOKIECLUEGUIDE ,"接口返回失败",response.body().asString()));
Assert.assertEquals(guideType,34,network.message(ROOKIECLUEGUIDE ,"引导类型错误",response.body().asString()));
Assert.assertTrue(success, network.message(ROOKIECLUEGUIDE, "接口返回失败", response.body().asString()));
Assert.assertEquals(guideType, 34, network.message(ROOKIECLUEGUIDE, "引导类型错误", response.body().asString()));
}
@Test(description = "点击完成线索的备注引导",priority = 12)
public void 点击完成线索的备注引导(){
@Test(description = "点击完成线索的备注引导", priority = 23)
public void 点击完成线索的备注引导() {
Response response = network.getResponse(SELLERCARD_CARDGUIDE);
Map<String, Object> params = new HashMap<String, Object>();
params.put("guideType", 34);
......@@ -189,68 +348,85 @@ public class NoviceGuidance implements Authorization {
response = network.getResponse(params, ROOKIECLUEGUIDE);
success = response.jsonPath().getBoolean("success");
int guideType = response.jsonPath().getInt("data.guideType");
Assert.assertTrue(success,network.message(ROOKIECLUEGUIDE ,"接口返回失败",response.body().asString()));
Assert.assertEquals(guideType,0,network.message(ROOKIECLUEGUIDE ,"引导类型错误",response.body().asString()));
Assert.assertTrue(success, network.message(ROOKIECLUEGUIDE, "接口返回失败", response.body().asString()));
Assert.assertEquals(guideType, 0, network.message(ROOKIECLUEGUIDE, "引导类型错误", response.body().asString()));
}
@Test(description = "代理人转发文章后访客领取资料包",priority = 13)
public void 代理人转发文章后访客领取资料包(){
@Test(description = "访客转发文章后访客领取资料包", priority = 24)
public void 访客转发文章后访客领取资料包() {
userTku();
sleep(2000);
//查看文章问答列表
//查看文章资料包配置
Map<String, Object> params = new HashMap<>();
params.put("scid",scid);
params.put("pageIndex",1);
params.put("pageSize",3);
Response response = network.getResponse(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS);
System.out.println(response.body().asString());
boolean hasList = response.jsonPath().getInt("data.list.size()") > 0;
Assert.assertTrue(hasList,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"代理人-获取个人专栏列表有误",response.body().asString()));
String answer = response.jsonPath().getString("data.list.get(0).answer");
Assert.assertNotNull(answer,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"获取问答内容有误",response.body().asString()));
String questionId = response.jsonPath().getString("data.list.get(0).questionId");
params.put("scid", scid);
params.put("id", articleDataID);
params.put("preview", 0);
params.put("timestamp", System.currentTimeMillis());
Response response = network.getResponse(params, ARTICLE_findDetailById);
String contentId = response.jsonPath().getString("data.materialVo.contentId");
Assert.assertNotNull(contentId, network.message(params, ARTICLE_findDetailById, "获取问答内容有误", response.body().asString()));
//查看问答具体详情
//领取资料包
params.clear();
params.put("qId",questionId);
params.put("scid",scid);
response = network.getResponse(params,SELLERCARD_GETQUESTIONDETAIL);
params.put("delayFlag", false);
params.put("scId", scid);
params.put("clueTypeName", "FAQ_VISIT_SCAN");
params.put("locationSource", 2);
params.put("insuranceName", "苏逸");
params.put("insurancePhone", "17897238291");
params.put("materialId", contentId);
params.put("sourceId", scid);
params.put("sourceType", 1);
response = network.postResponse(params, SELLERCARD_SENDPUSHFORSCAN);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params,SELLERCARD_GETQUESTIONDETAIL,"代理人-获取个人专栏列表有误",response.body().asString()));
Object data = response.jsonPath().getString("data");
Assert.assertNotNull(data,network.message(params,SELLERCARD_GETQUESTIONDETAIL,"获取问答内容有误",response.body().asString()));
String materialId = response.jsonPath().getString("data.faqAnxietyExtVo.materialId");
//领取赠险
params.clear();
params.put("qId",questionId);
params.put("scId",scid);
params.put("clueTypeName","FAQ_VISIT_SCAN");
params.put("locationSource",2);
params.put("insuranceName","苏逸");
params.put("insurancePhone","17897238291");
params.put("materialId",materialId);
params.put("sourceId",scid);
params.put("sourceType",1);
response = network.postResponse(params,SELLERCARD_SENDPUSHFORSCAN);
success = response.jsonPath().getBoolean("success");
String result = response.jsonPath().getString("data.");
Assert.assertTrue(success,network.message(params,SELLERCARD_SENDPUSHFORSCAN ,"接口返回失败",response.body().asString()));
Assert.assertEquals(result,"success",network.message(params,SELLERCARD_SENDPUSHFORSCAN ,"领取赠险失败",response.body().asString()));
Assert.assertTrue(success, network.message(params, SELLERCARD_SENDPUSHFORSCAN, "接口返回失败", response.body().asString()));
Assert.assertEquals(result, "success", network.message(params, SELLERCARD_SENDPUSHFORSCAN, "领取赠险失败", response.body().asString()));
}
@Test(description = "代理人点击谁看过我显示备注引导",priority = 14)
public void 代理人点击谁看过我显示跟进机会引导(){
// 查看谁看过我首页我的跟进机会列表
@Test(description = "代理人查看我的跟进机会列表", priority = 25)
public void 代理人查看我的跟进机会列表() throws IOException {
network.agentCookies.put("tku", tku);
sleep(2000);
Map<String, Object> params = new HashMap<String, Object>();
List<Object> customerTagIds = Lists.newArrayList();
params.put("customerTagIds", customerTagIds);
params.put("lastClueId", 0);
params.put("listType", 4);
params.put("pageSize", 20);
params.put("grassContentListType", 5);
Response response = network.postResponse(params, BasicConfig.WHOSAWME_CUSTCLUELISTV3);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0, network.message(params, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "接口请求失败", response.body().asString()));
clueId = response.jsonPath().getLong("data.list[0].clueId");
}
@Test(description = "代理人点击谁看过我显示备注引导", priority = 26)
public void 代理人点击谁看过我显示跟进机会引导() {
Response response = network.getResponse(ROOKIECLUEGUIDE);
boolean success = response.jsonPath().getBoolean("success");
int guideType = response.jsonPath().getInt("data.guideType");
Assert.assertTrue(success,network.message(ROOKIECLUEGUIDE ,"接口返回失败",response.body().asString()));
Assert.assertEquals(guideType,31,network.message(ROOKIECLUEGUIDE ,"引导类型错误",response.body().asString()));
Assert.assertTrue(success, network.message(ROOKIECLUEGUIDE, "接口返回失败", response.body().asString()));
Assert.assertEquals(guideType, 31, network.message(ROOKIECLUEGUIDE, "引导类型错误", response.body().asString()));
}
@Test(description = "点击完成线索的备注引导",priority = 15)
public void 点击完成线索的跟进机会引导(){
// 销售线索_跟进建议
@Test(description = "查看资料包_跟进建议", priority = 27)
public void 查看资料包_跟进建议() throws IOException{
Map<String, Object> params = new HashMap<String, Object>();
params = new HashMap<>();
params.put("clueId", clueId);
Response response = network.getResponse(params, BasicConfig.CLUEADVISE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(params, BasicConfig.CLUEADVISE, "接口请求失败", response.body().asString()));
String advise = response.jsonPath().getJsonObject("data.adviceList.get(0).adviceContent");
Assert.assertEquals(advise,"自动化测试资料包话术-勿删除", network.message(params, BasicConfig.CLUEADVISE, "跟进建议内容为空", response.body().asString()));
}
@Test(description = "点击完成线索的备注引导", priority = 28)
public void 点击完成线索的跟进机会引导() {
Response response = network.getResponse(SELLERCARD_CARDGUIDE);
Map<String, Object> params = new HashMap<String, Object>();
params.put("guideType", 31);
......@@ -263,8 +439,8 @@ public class NoviceGuidance implements Authorization {
response = network.getResponse(params, ROOKIECLUEGUIDE);
success = response.jsonPath().getBoolean("success");
int guideType = response.jsonPath().getInt("data.guideType");
Assert.assertTrue(success,network.message(ROOKIECLUEGUIDE ,"接口返回失败",response.body().asString()));
Assert.assertEquals(guideType,32,network.message(ROOKIECLUEGUIDE ,"引导类型错误",response.body().asString()));
Assert.assertTrue(success, network.message(ROOKIECLUEGUIDE, "接口返回失败", response.body().asString()));
Assert.assertEquals(guideType, 32, network.message(ROOKIECLUEGUIDE, "引导类型错误", response.body().asString()));
params.clear();
params.put("guideType", 32);
......@@ -277,7 +453,204 @@ public class NoviceGuidance implements Authorization {
response = network.getResponse(params, ROOKIECLUEGUIDE);
success = response.jsonPath().getBoolean("success");
guideType = response.jsonPath().getInt("data.guideType");
Assert.assertTrue(success,network.message(ROOKIECLUEGUIDE ,"接口返回失败",response.body().asString()));
Assert.assertEquals(guideType,0,network.message(ROOKIECLUEGUIDE ,"引导类型错误",response.body().asString()));
Assert.assertTrue(success, network.message(ROOKIECLUEGUIDE, "接口返回失败", response.body().asString()));
Assert.assertEquals(guideType, 0, network.message(ROOKIECLUEGUIDE, "引导类型错误", response.body().asString()));
}
@Test(description = "访客查看问答访客领取资料包", priority = 29)
public void 访客查看问答访客领取资料包() {
userTku();
sleep(2000);
//查看文章问答列表
Map<String, Object> params = new HashMap<>();
params.put("scid", scid);
params.put("pageIndex", 1);
params.put("pageSize", 3);
Response response = network.getResponse(params, ARTICLE_ENHANCEDCOLUMN_GETFAQS);
System.out.println(response.body().asString());
boolean hasList = response.jsonPath().getInt("data.list.size()") > 0;
Assert.assertTrue(hasList, network.message(params, ARTICLE_ENHANCEDCOLUMN_GETFAQS, "代理人-获取个人专栏列表有误", response.body().asString()));
String answer = response.jsonPath().getString("data.list.get(0).answer");
Assert.assertNotNull(answer, network.message(params, ARTICLE_ENHANCEDCOLUMN_GETFAQS, "获取问答内容有误", response.body().asString()));
questionId = response.jsonPath().getString("data.list.get(0).questionId");
//查看问答具体详情
params.clear();
params.put("qId", questionId);
params.put("scid", scid);
response = network.getResponse(params, SELLERCARD_GETQUESTIONDETAIL);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params, SELLERCARD_GETQUESTIONDETAIL, "代理人-获取个人专栏列表有误", response.body().asString()));
Object data = response.jsonPath().getString("data");
Assert.assertNotNull(data, network.message(params, SELLERCARD_GETQUESTIONDETAIL, "获取问答内容有误", response.body().asString()));
String materialId = response.jsonPath().getString("data.faqAnxietyExtVo.materialId");
//领取资料包
params.clear();
params.put("qId", questionId);
params.put("scId", scid);
params.put("clueTypeName", "FAQ_VISIT_SCAN");
params.put("locationSource", 2);
params.put("insuranceName", "苏逸");
params.put("insurancePhone", "17897238291");
params.put("materialId", materialId);
params.put("sourceId", scid);
params.put("sourceType", 1);
response = network.postResponse(params, SELLERCARD_SENDPUSHFORSCAN);
success = response.jsonPath().getBoolean("success");
String result = response.jsonPath().getString("data");
Assert.assertTrue(success, network.message(params, SELLERCARD_SENDPUSHFORSCAN, "接口返回失败", response.body().asString()));
Assert.assertEquals(result, "success", network.message(params, SELLERCARD_SENDPUSHFORSCAN, "领取资料包失败", response.body().asString()));
}
// 查看谁看过我首页我的跟进机会列表
@Test(description = "代理人查看更新的跟进机会列表", priority = 30)
public void 代理人查看更新的跟进机会列表() throws IOException {
network.agentCookies.put("tku", tku);
sleep(2000);
Map<String, Object> params = new HashMap<String, Object>();
List<Object> customerTagIds = Lists.newArrayList();
params.put("customerTagIds", customerTagIds);
params.put("lastClueId", 0);
params.put("listType", 4);
params.put("pageSize", 20);
params.put("grassContentListType", 5);
Response response = network.postResponse(params, BasicConfig.WHOSAWME_CUSTCLUELISTV3);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0, network.message(params, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "接口请求失败", response.body().asString()));
clueId = response.jsonPath().getLong("data.list[0].clueId");
}
// 销售线索_线索详情
@Test(description = "查看_线索详情", priority = 31)
public void 查看_线索详情() throws IOException{
Map<String, Object> params = new HashMap<String, Object>();
params.put("clueId", clueId);
Response response = network.getResponse(params, BasicConfig.CLUEINFO);
Assert.assertEquals(response.jsonPath().getString("data.faqCluePathListInfoVo.faqCluePathDetailInfoVos.get(0).subtitle"),"直接访问", network.message(params, BasicConfig.CLUEINFO, "文章标题错误", response.body().asString()));
Assert.assertEquals(response.jsonPath().getString("data.faqCluePathListInfoVo.faqCluePathDetailInfoVos.get(0).title"),"《一线城市打拼,二线城市买房,80%以上年轻人都在做的这事靠谱吗?》", network.message(params, BasicConfig.CLUEINFO, "文章标题错误", response.body().asString()));
Assert.assertEquals(response.jsonPath().getString("data.faqCluePathListInfoVo.faqCluePathDetailInfoVos.get(1).subtitle"),"查看问答", network.message(params, BasicConfig.CLUEINFO, "文章标题错误", response.body().asString()));
Assert.assertEquals(response.jsonPath().getString("data.faqCluePathListInfoVo.faqCluePathDetailInfoVos.get(1).title"),"[自动化专用互助问答]", network.message(params, BasicConfig.CLUEINFO, "文章标题错误", response.body().asString()));
Assert.assertEquals(response.jsonPath().getString("data.faqCluePathListInfoVo.faqCluePathDetailInfoVos.get(2).subtitle"),"领取资料", network.message(params, BasicConfig.CLUEINFO, "文章标题错误", response.body().asString()));
Assert.assertEquals(response.jsonPath().getString("data.faqCluePathListInfoVo.faqCluePathDetailInfoVos.get(2).title"), "《自动化专用资料包》", network.message(params, BasicConfig.CLUEINFO, "文章标题错误", response.body().asString()));
}
// 销售线索_跟进建议
@Test(description = "查看问答_跟进建议", priority = 32)
public void 查看问答_跟进建议() throws IOException{
Map<String, Object> params = new HashMap<String, Object>();
params = new HashMap<>();
params.put("clueId", clueId);
Response response = network.getResponse(params, BasicConfig.CLUEADVISE);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(params, BasicConfig.CLUEADVISE, "接口请求失败", response.body().asString()));
String advise = response.jsonPath().getJsonObject("data.adviceList.get(0).adviceContent");
Assert.assertEquals(advise,"自动化测试资料包话术-勿删除", network.message(params, BasicConfig.CLUEADVISE, "跟进建议内容为空", response.body().asString()));
}
@Test(description = "访客提问关联问题", priority = 33)
public void 访客提问关联问题() {
userTku();
//查看文章问答列表
Map<String, Object> params = new HashMap<>();
//提问关联问题
params.clear();
params.put("qId", questionId);
params.put("scId", scid);
params.put("clueTypeName", "FAQ_VISIT_EXTRA_QUESTION");
params.put("locationSource", 2);
params.put("sourceId", scid);
params.put("sourceType", 1);
Response response = network.postResponse(params, SELLERCARD_SENDPUSHFORSCAN);
boolean success = response.jsonPath().getBoolean("success");
String result = response.jsonPath().getString("data");
Assert.assertTrue(success, network.message(params, SELLERCARD_SENDPUSHFORSCAN, "接口返回失败", response.body().asString()));
Assert.assertEquals(result, "success", network.message(params, SELLERCARD_SENDPUSHFORSCAN, "提问失败", response.body().asString()));
}
// 查看谁看过我首页我的跟进机会列表
@Test(description = "代理人查看最新的跟进机会列表", priority = 34)
public void 代理人查看最新的跟进机会列表() throws IOException {
network.agentCookies.put("tku", tku);
sleep(2000);
Map<String, Object> params = new HashMap<String, Object>();
List<Object> customerTagIds = Lists.newArrayList();
params.put("customerTagIds", customerTagIds);
params.put("lastClueId", 0);
params.put("listType", 4);
params.put("pageSize", 20);
params.put("grassContentListType", 5);
Response response = network.postResponse(params, BasicConfig.WHOSAWME_CUSTCLUELISTV3);
int size = response.jsonPath().getInt("data.list.size()");
Assert.assertTrue(size>0, network.message(params, BasicConfig.WHOSAWME_CUSTCLUELISTV3, "接口请求失败", response.body().asString()));
clueId = response.jsonPath().getLong("data.list[0].clueId");
}
// 销售线索_线索详情
@Test(description = "查看关联提问_线索详情", priority = 35)
public void 查看关联提问_线索详情() throws IOException{
Map<String, Object> params = new HashMap<String, Object>();
params.put("clueId", clueId);
Response response = network.getResponse(params, BasicConfig.CLUEINFO);
Assert.assertEquals(response.jsonPath().getString("data.questionAnswerVo.extraQuestion"),"自动化关联问题", network.message(params, BasicConfig.CLUEINFO, "文章标题错误", response.body().asString()));
Assert.assertEquals(response.jsonPath().getString("data.clueSummary"),"发起提问", network.message(params, BasicConfig.CLUEINFO, "文章标题错误", response.body().asString()));
}
@Test(description = "文章取消绑定互助问答",priority = 36)
public void 文章取消绑定互助问答() {
Map<String, Object> params = new HashMap<>();
List<Long> qas = Lists.newArrayList();
List<List<Integer> > tagList = Lists.newArrayList();
List<Integer> tags = Lists.newArrayList();
tags.add(707);
tagList.add(tags);
params.put("accurateContentType",1);
params.put("anxietyType",2);
params.put("contentId",ARTICLE_ID);
params.put("dataTag","1千+转发");
params.put("firstTagId",101);
params.put("isHotContent",0);
params.put("productId",101);
params.put("qaIds",qas);
params.put("recommendReason",2);
params.put("status",0);
params.put("tagList",tagList);
params.put("tags",1);
Response response = network.postResponse(params, BasicConfig.MANAGER_article_edit);
boolean data=response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(BasicConfig.MANAGER_article_edit,"新增互助问答失败",response.body().asString()));
}
@Test(description = "删除互助问答成功",priority = 37)
public void 删除互助问答成功() {
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("forceDelete",0);
Params.put("id",qaID);
Response response = network.postResponse(Params, BasicConfig.MANAGER_qa_del);
boolean data=response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(BasicConfig.MANAGER_qa_del,"删除失败",response.body().asString()));
}
@Test(description = "删除文章中资料包",priority = 38)
public void 删除文章中资料包() {
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("id",articleDataID);
Response response = network.postResponse(Params, BasicConfig.MANAGER_resource_deleteById);
boolean data=response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(BasicConfig.MANAGER_resource_deleteById,"删除文章中资料包失败",response.body().asString()));
}
@Test(description = "删除资料包",priority = 39)
public void 删除资料包() {
Map<String, Object> Params = new HashMap<String, Object>();
Params.put("id",dataID);
Response response = network.postResponse(Params, BasicConfig.MANAGER_resource_delete);
boolean data=response.jsonPath().getBoolean("data");
Assert.assertTrue(data,network.message(BasicConfig.MANAGER_resource_delete,"删除资料包失败",response.body().asString()));
}
}
......@@ -70,7 +70,6 @@ public class Cashback implements Authorization {
callbackParams.put("payTradeNo", "test");
response = network.getResponse(callbackParams, PAY_CALLOUT);
boolean result = response.jsonPath().getBoolean("data");
response.body().prettyPrint();
Assert.assertTrue(result, network.message(callbackParams, PAY_CALLOUT, "mock微信支付回调成功,但我们订单处理失败", response.body().asString()));
......
......@@ -956,6 +956,5 @@ public class WhoSawMe implements Authorization {
String sCid = response.jsonPath().getString("data");
Assert.assertNotNull(reportScid, network.message(param,GAME_consult,"获取sCid失败",response.body().asString()));
visitor2Tku();
}
}
......@@ -3,20 +3,26 @@ package com.kjj.cases.live.anchor;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.kjj.bean.manager.EvaluationDetail;
import com.kjj.bean.manager.Material;
import com.kjj.bean.resources.*;
import com.kjj.cases.admin.Authorization;
import com.kjj.cases.live.liveConfig.LiveMaterial;
import com.kjj.cases.live.treasure.TimeRed;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.BaseUtils;
import com.kjj.utils.IdMakeUtil;
import com.kjj.utils.JsonUtil;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.util.*;
import static com.kjj.utils.ThreadSleepUtils.sleep;
public class LiveVisitors implements Authorization
{
public String confId_imageText;
......@@ -32,6 +38,12 @@ public class LiveVisitors implements Authorization
public static String resourceReceiveRecordId;
public static String freeForEvaReceiveRecordId;
@BeforeTest
public void setUp(){
BaseUtils.ssoLogin();
TimeRed.offResource();
}
/*助播端端权益列表*/
@Test(description = "助播端权益列表", priority = 1)
public void 助播端权益列表()
......@@ -42,7 +54,6 @@ public class LiveVisitors implements Authorization
Response response = network.getResponse(params, BasicConfig.MOBILE_ResourceList);
List<ResourcePushList> list = JsonUtil.parseResponseToListBean(response, ResourcePushList.class);
this.PushList=list;
System.out.println(list);
Assert.assertNotNull(list, network.message(params, BasicConfig.MOBILE_ResourceList, "查询主播端权益列表失败", response.body().asString()));
}
......@@ -58,7 +69,6 @@ public class LiveVisitors implements Authorization
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.postResponse(params, BasicConfig.MOBILE_ResourceOn);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_ResourceOn, "主播端上架权益失败", response.body().asString()));
}
......@@ -67,13 +77,11 @@ public class LiveVisitors implements Authorization
@Test(description = "访客端权益列表", priority = 3)
public void 访客端权益列表()
{
ThreadSleepUtils.sleep(3000);
sleep(10000);
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_Resource);
System.out.println(params);
System.out.println(response.body().asString());
encodeEvaluationId = IdMakeUtil.managerEncodingId(LiveMaterial.evaluationId);
List<LiveVisitor> liveVisitors = JsonUtil.parseResponseToListBean(response, LiveVisitor.class);
LiveVisitor one = liveVisitors.get(0);
......@@ -210,7 +218,7 @@ public class LiveVisitors implements Authorization
@Test(description = "访客端获取测试权益详情", priority = 10)
public void 访客端获取测试权益详情() {
visitorAuth1();
ThreadSleepUtils.sleep(3000);
sleep(3000);
Map<String, Object> evaDetailPar = new HashMap<>();
evaDetailPar.put("confId", confId_eva);
evaDetailPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -245,7 +253,7 @@ public class LiveVisitors implements Authorization
@Test(description = "未提交所有问题答案", priority = 12)
public void 未提交所有问题答案() {
ThreadSleepUtils.sleep(3000);
sleep(3000);
Map<String, Object> submitPar = getEvaSubmitPar(LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()), confId_eva, LiveMaterial.evaluationId, LiveMaterial.getEvaDetails(LiveMaterial.evaluationId).getQuestions().size() - 1, 1, false, true);
Response submitRes = network.postResponse(submitPar, BasicConfig.MOBILE_evaluationSubmit);
try {
......@@ -261,7 +269,7 @@ public class LiveVisitors implements Authorization
@Test(description = "提交不匹配的问题和答案", priority = 13)
public void 提交不匹配的问题和答案() {
ThreadSleepUtils.sleep(3000);
sleep(3000);
Map<String, Object> submitPar = getEvaSubmitPar(LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()), confId_eva, LiveMaterial.evaluationId, LiveMaterial.getEvaDetails(LiveMaterial.evaluationId).getQuestions().size(), 1, true, true);
Response submitRes = network.postResponse(submitPar, BasicConfig.MOBILE_evaluationSubmit);
try {
......@@ -277,7 +285,7 @@ public class LiveVisitors implements Authorization
@Test(description = "不提交选项", priority = 14)
public void 不提交选项() {
ThreadSleepUtils.sleep(3000);
sleep(3000);
Map<String, Object> submitPar = getEvaSubmitPar(LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()), confId_eva, LiveMaterial.evaluationId, LiveMaterial.getEvaDetails(LiveMaterial.evaluationId).getQuestions().size(), 1, false, false);
Response submitRes = network.postResponse(submitPar, BasicConfig.MOBILE_evaluationSubmit);
try {
......@@ -292,7 +300,7 @@ public class LiveVisitors implements Authorization
@Test(description = "正常提交答案", priority = 15)
public void 正常提交答案() {
ThreadSleepUtils.sleep(3000);
sleep(3000);
Map<String, Object> submitPar = getEvaSubmitPar(LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()), confId_eva, LiveMaterial.evaluationId, LiveMaterial.getEvaDetails(LiveMaterial.evaluationId).getQuestions().size(), 1, false, true);
Response submitRes = network.postResponse(submitPar, BasicConfig.MOBILE_evaluationSubmit);
try {
......@@ -417,7 +425,7 @@ public class LiveVisitors implements Authorization
public void 代理人端权益列表查询()
{
agentAuth();
ThreadSleepUtils.sleep(3000);
sleep(3000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_Resource);
......@@ -513,7 +521,7 @@ public class LiveVisitors implements Authorization
public void 获取推送列表()
{
adminAuth();
ThreadSleepUtils.sleep(1000);
sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId", this.PushList.get(5).getConfId());
......@@ -529,7 +537,7 @@ public class LiveVisitors implements Authorization
@Test(description = "访客获取贴片信息", priority = 30)
public void 访客获取贴片信息()
{
ThreadSleepUtils.sleep(1000);
sleep(1000);
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......
......@@ -26,6 +26,7 @@ public class PersonalPage implements Authorization {
private String encodeCompanyId; // 加密的公司id
private String welfareRecordId; // 福利领取记录id
private String sourceRecordId; // 资料领取记录id
private String testRecordId; // 资料领取记录id
@BeforeClass
public void setUp(){
......@@ -66,7 +67,6 @@ public class PersonalPage implements Authorization {
public void 访客查看我的资料() {
System.out.println("params:" + params);
Response response = network.getResponse(params, BasicConfig.USER_resourceList);
System.out.println("访客资料列表: " + response.body().asString());
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(params, BasicConfig.USER_resourceList, "接口调用失败", response.body().asString()));
List<ResourceList> resourceLists = JsonUtil.parseResponseToPageBean(response, ResourceList.class);
ResourceList resourceList = resourceLists.get(0);
......@@ -75,6 +75,15 @@ public class PersonalPage implements Authorization {
String liveId = resourceList.getLiveId();
Assert.assertEquals(liveId, LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()), network.message(params, BasicConfig.USER_resourceList, "资料领取直播id不正确", response.body().asString()));
for (ResourceList resource:resourceLists
) {
if(resource.getType() == 23){
testRecordId = resource.getRecordId();
System.out.println(testRecordId);
break;
}
}
companyName = resourceList.getCompanyName(); // 获取领取资料的公司名称
System.out.println(companyName);
......@@ -122,7 +131,7 @@ public class PersonalPage implements Authorization {
Response liveOnListRes = network.getResponse(params, BasicConfig.USER_getLiveList);
Assert.assertTrue(liveOnListRes.jsonPath().getBoolean("success"), network.message(params, BasicConfig.USER_getLiveList, "接口请求失败", liveOnListRes.body().asString()));
boolean hasLiveOn = true;
try {
try{
List liveList = liveOnListRes.jsonPath().getList("data.list");
if (liveList.size() == 0){
hasLiveOn = false;
......@@ -218,4 +227,19 @@ public class PersonalPage implements Authorization {
e.printStackTrace();
}
}
@Test(description = "查看测试详情", priority = 15)
public void 查看测试详情() {
params.clear();
params.put("recordId", testRecordId);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response resourceDetailRes = network.getResponse(params, BasicConfig.USER_getTestResourceDetail);
Assert.assertTrue(resourceDetailRes.jsonPath().getBoolean("success"), network.message(params, BasicConfig.USER_getTestResourceDetail, "接口请求失败", resourceDetailRes.body().asString()));
try {
String companyName = resourceDetailRes.jsonPath().getString("data.companyName");
Assert.assertEquals(companyName, "【勿动】自动化专用公司", network.message(params, BasicConfig.USER_getTestResourceDetail, "领取记录对应的公司错误", resourceDetailRes.body().asString()));
}catch (NullPointerException e){
e.printStackTrace();
}
}
}
......@@ -26,7 +26,7 @@ public class LiveBinding implements Authorization {
public String shareSign=null;
public void binding(String shareParam) {
public static void binding(String shareParam) {
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareParam);
......@@ -35,7 +35,7 @@ public class LiveBinding implements Authorization {
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
public void token() {
public static void token() {
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -44,7 +44,7 @@ public class LiveBinding implements Authorization {
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
public String share() {
public static String share() {
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType",1);
......
......@@ -36,7 +36,6 @@ public class GoldenEgg implements Authorization {
public String shareSign;
public JSONObject treasureConf;
public String interactConfId;
public LiveBinding liveBinding = new LiveBinding();
public List<WelfareList> id;
/**
......@@ -45,15 +44,15 @@ public class GoldenEgg implements Authorization {
@Test(description = "代理人绑定", priority = 1)
public void 代理人绑定() {
agentAuth();
liveBinding.binding(this.shareSign);
this.shareSign = liveBinding.share();
LiveBinding.binding(this.shareSign);
this.shareSign = LiveBinding.share();
}
@Test(description = "代理人A与访客A邀请关系绑定", priority = 2)
public void 代理人A与访客A邀请关系绑定() {
visitorAuth1();
liveBinding.binding(this.shareSign);;
liveBinding.token();
LiveBinding.binding(this.shareSign);;
LiveBinding.token();
}
@Test(description = "查询配置奖品列表", priority = 3)
public void 查询配置奖品列表() {
......@@ -183,8 +182,8 @@ public class GoldenEgg implements Authorization {
@Test(description = "代理人A与访客A邀请关系绑定", priority = 11)
public void 代理人A与访客G邀请关系绑定() {
visitorAuth7();
liveBinding.binding(this.shareSign);;
liveBinding.token();
LiveBinding.binding(this.shareSign);;
LiveBinding.token();
}
@Test(description = "黑名单用户仅不可砸中实物", priority = 12)
......@@ -243,8 +242,8 @@ public class GoldenEgg implements Authorization {
@Test(description = "代理人A与访客B邀请关系绑定", priority = 14)
public void 代理人A与访客B邀请关系绑定() {
visitorAuth7();
liveBinding.binding(this.shareSign);;
liveBinding.token();
LiveBinding.binding(this.shareSign);;
LiveBinding.token();
}
@Test(description = "第2个访客B砸金蛋砸出抽奖码", priority = 15)
......@@ -301,8 +300,8 @@ public class GoldenEgg implements Authorization {
@Test(description = "代理人A与访客C邀请关系绑定", priority = 18)
public void 代理人A与访客C邀请关系绑定() {
visitorAuth3();
liveBinding.binding(this.shareSign);;
liveBinding.token();
LiveBinding.binding(this.shareSign);;
LiveBinding.token();
}
@Test(description = "第3个访客C砸金蛋砸出实物", priority = 19)
......@@ -413,8 +412,8 @@ public class GoldenEgg implements Authorization {
@Test(description = "代理人A与访客D邀请关系绑定", priority = 24)
public void 代理人A与访客D邀请关系绑定() {
visitorAuth4();
liveBinding.binding(this.shareSign);;
liveBinding.token();
LiveBinding.binding(this.shareSign);;
LiveBinding.token();
}
@Test(description = "第3个用户再次超时后访客D砸蛋砸出实物奖品", priority = 25)
......@@ -447,8 +446,8 @@ public class GoldenEgg implements Authorization {
@Test(description = "代理人A与访客E邀请关系绑定", priority = 26)
public void 代理人A与访客E邀请关系绑定() {
visitorAuth5();
liveBinding.binding(this.shareSign);;
liveBinding.token();
LiveBinding.binding(this.shareSign);;
LiveBinding.token();
}
@Test(description = "第5个用户E砸蛋砸出抽奖码", priority = 27)
......@@ -482,15 +481,15 @@ public class GoldenEgg implements Authorization {
@Test(description = "访客A获取分享加密串", priority = 28)
public void 访客A获取分享加密串() {
visitorAuth1();
this.shareSign = liveBinding.share();
this.shareSign = LiveBinding.share();
}
@Test(description = "访客E与访客A邀请关系绑定", priority = 29)
public void 访客F与访客A邀请关系绑定() {
visitorAuth6();
liveBinding.binding(this.shareSign);;
liveBinding.token();
LiveBinding.binding(this.shareSign);;
LiveBinding.token();
}
@Test(description = "修改实物奖品数量为无限制", priority = 30)
......@@ -593,8 +592,8 @@ public class GoldenEgg implements Authorization {
@Test(description = "访客I与访客A邀请关系绑定", priority = 35)
public void 访客I与访客A邀请关系绑定() {
visitorAuth8();
liveBinding.binding(this.shareSign);;
liveBinding.token();
LiveBinding.binding(this.shareSign);;
LiveBinding.token();
}
@Test(description = "第6个访客F砸出红包", priority = 36)
......@@ -627,8 +626,8 @@ public class GoldenEgg implements Authorization {
@Test(description = "访客H与访客A邀请关系绑定", priority = 37)
public void 访客H与访客A邀请关系绑定() {
visitorAuth9();
liveBinding.binding(this.shareSign);;
liveBinding.token();
LiveBinding.binding(this.shareSign);;
LiveBinding.token();
}
@Test(description = "第7个访客H砸出抽奖码", priority = 38)
......@@ -718,7 +717,7 @@ public class GoldenEgg implements Authorization {
@Test(description = "访客B获取分享加密串", priority = 42)
public void 访客B获取分享加密串() {
visitorAuth2();
this.shareSign = liveBinding.share();
this.shareSign = LiveBinding.share();
}
@Test(description = "用户C给用户B助力", priority = 43)
......@@ -761,7 +760,7 @@ public class GoldenEgg implements Authorization {
@Test(description = "访客F获取分享加密串", priority = 45)
public void 访客F获取分享加密串() {
visitorAuth8();
this.shareSign = liveBinding.share();
this.shareSign = LiveBinding.share();
}
@Test(description = "用户D给用户F助力", priority = 46)
......
......@@ -52,7 +52,6 @@ public class TimeRed implements Authorization {
@Test(description = "关注直播间", priority = 2)
public void 关注直播间() {
Map<String, Object> subscribeParam = new HashMap<>();
subscribeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
List<Long> markIds2 = new ArrayList<>();
......@@ -140,7 +139,6 @@ public class TimeRed implements Authorization {
@Test(description = "访客端表单资料提交", priority = 6)
public void 访客端系统表单资料提交()
{
visitorAuth9();
Map<String, Object> params = new HashMap<>();
params.put("confId",this.bizConfId.get(3).getBizConfId());
......@@ -531,8 +529,7 @@ public class TimeRed implements Authorization {
Assert.assertTrue(state1==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客I未领取第5轮红包", stateRes.body().asString()));
}
@Test(description = "下架第6轮红包任务对应的权益", priority = 23)
public void 下架第6轮红包任务对应的权益() {
public static void offResource() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
List<Material> ids = new ArrayList<>();
......@@ -553,6 +550,11 @@ public class TimeRed implements Authorization {
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_saveAndUpdate_8, "产品资料配置失败", response.body().asString()));
}
@Test(description = "下架第6轮红包任务对应的权益", priority = 23)
public void 下架第6轮红包任务对应的权益() {
offResource();
}
@Test(description = "查看第6轮红包任务完成情况", priority = 24)
public void 查看第6轮红包任务完成情况() {
Map<String, Object> Params = new HashMap<>();
......
......@@ -433,6 +433,7 @@ public class BasicConfig {
public static final String USER_companyLiving = MOBILE_HOST + "/kjy/live/company/living";
public static final String USER_welfareDetail = MOBILE_HOST + "/kjy/live/user/welfare/findDetailByRecordId";
public static final String USER_sourceDetail = MOBILE_HOST + "/kjy/live/user/resource/findDetailByRecordId";
public static final String USER_getTestResourceDetail = MOBILE_HOST + "/kjy/live/user/resource/getTestResourceDetail";
// *************** 直播管理端 ***************
public static final String MANAGER_saveAndUpdate_0 = MANAGER_HOST + "/kjy/manager/live/pre/conf/saveAndUpdate";
......@@ -852,7 +853,6 @@ public class BasicConfig {
// *************** 谁看过我 ***************
public static final String WHOSAWME_CUSTCLUELISTV2 = HOST + "/kjy/mp/whoSawMe/custClueList/v2";
public static final String WHOSAWME_CUSTCLUELISTV3 = HOST + "/kjy/mp/whoSawMe/custClueList/v3";
public static final String FORWARDHEADER = HOST + "/kjy/mp/whoSawMe/forward/header";
public static final String FORWARD_LIST = HOST + "/kjy/mp/whoSawMe/forward/list/v2";
......@@ -860,7 +860,6 @@ public class BasicConfig {
public static final String FORWARD_VISITRECORD = HOST + "/kjy/mp/whoSawMe/forward/visitRecordList/v2";
public static final String SELLERUNREADMESSAGE = HOST + "/kjy/mp/custmarketing/sellerUnreadMsg";
public static final String CUSTOMERSEARCH = HOST + "/kjy/mp/whoSawMe/customerSearch";
public static final String SEARCHCUSTOMERBYCONTENT = HOST + "/kjy/mp/custmarketing/searchCustomer";
public static final String DYNAMIC_ADDVISIT = HOST + "/kjy/mp/seller/dynamic/addVisit";
public static final String CLUEINFO = HOST + "/kjy/mp/whoSawMe/clue/info";
public static final String CLUEADVISE = HOST + "/kjy/mp/whoSawMe/clue/info/advise";
......@@ -929,11 +928,11 @@ public class BasicConfig {
public static final String ARTICLE_GETTAGTYPESBYCONTENTID = HOST + "/kjy/mp/explosionContent/resource/getTagTypesByContentId";
public static final String ARTICLE_ISDISPLAYACTIVITY = HOST + "/kjy/mp/clue/activity/isDisplayActivity";
public static final String ARTICLE_GETENHANCEDCOLUMNCONFIG = HOST + "/kjy/mp/sellerConfig/getEnhancedColumnConfig";
public static final String ARTICLE_ENHANCEDCOLUMN_GETCONTENTS = HOST + "/kjy/mp/enhancedColumn/getContents";
public static final String ARTICLE_ENHANCEDCOLUMN_GETFAQS = HOST + "/kjy/mp/enhancedColumn/getFAQs";
public static final String ARTICLE_getQuestionDetail = HOST +"/kjy/mp/explosioncontent/qa/getQuestionDetail";
public static final String ARTICLE_GETEXPLOSIONCONTENTLIST = HOST + "/kjy/mp/explosioncontent/getExplosionContentList";
public static final String ARTICLE_interact = HOST + "/kjy/mp/article/interact";
public static final String ARTICLE_findDetailById = HOST + "/kjy/mp/explosionContent/resource/findDetailById";
// ************** 发圈素材 ***************
public static final String FRIENDS_GETMATERIALTAGS = HOST + "/kjy/mp/materialContent/getmaterialTags";
......@@ -1168,7 +1167,18 @@ public class BasicConfig {
public static final String MANAGER_exclusiveItemDel = MANAGER_HOST + "/kjy/manager/exclusiveItem/del";
public static final String MANAGER_searchCompany = MANAGER_HOST + "/kjy/manager/live/company/search";
public static final String MANAGER_liveList = MANAGER_HOST + "/kjy/manager/live/list";
public static final String MANAGER_manage = MANAGER_HOST + "/kjy/manager/tag/manage";
public static final String MANAGER_resource_allMaterial = MANAGER_HOST + "/kjy/manager/explosionContent/resource/allMaterial";
public static final String MANAGER_resource_addOrUpdate = MANAGER_HOST + "/kjy/manager/explosionContent/resource/addOrUpdate";
public static final String MANAGER_resource_findById = MANAGER_HOST + "/kjy/manager/explosionContent/resource/findById";
public static final String MANAGER_resource_deleteById = MANAGER_HOST + "/kjy/manager/explosionContent/resource/deleteById";
public static final String MANAGER_datagram_list = MANAGER_HOST + "/kjy/manager/datagram/v2/list";
public static final String MANAGER_datagram_addOrUpdate = MANAGER_HOST + "/kjy/manager/datagram/v2/addOrUpdate";
public static final String MANAGER_datagram_detail = MANAGER_HOST + "/kjy/manager/datagram/v2/detail";
public static final String MANAGER_resource_delete = MANAGER_HOST + "/kjy/manager/datagram/v2/delete";
public static final String MANAGER_qa_addOrUpdate = MANAGER_HOST + "/kjy/manager/qa/addOrUpdate";
public static final String MANAGER_article_edit = MANAGER_HOST + "/kjy/manager/grassContent/edit";
public static final String MANAGER_qa_pageList = MANAGER_HOST + "/kjy/manager/qa/pageList";
public static final String MANAGER_qa_del = MANAGER_HOST + "/kjy/manager/qa/del";
// 企业后台
public static final String MANAGER_corp_saveCorp = MANAGER_HOST + "/kjy/manager/corp/company/saveOrUpdate";
......
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