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

Merge branch '2021082502_gxh' into 'master'

2021082502 gxh

See merge request test-group/kejiji!107
parents e4f9ceae 403267d1
package com.kjj.bean.issue;
import lombok.Data;
import java.util.ArrayList;
@Data
public class Dialogue {
private ArrayList<String> quesList;
private String agentConclusion;
private String agentGreet;
private String promiseTitle;
private String promiseDesc;
private String promiseButton;
private String customerActionPromise;
private int inviteType;
public Dialogue(ArrayList<String> quesList, String agentConclusion, String agentGreet, String promiseTitle, String promiseDesc, String promiseButton, String customerActionPromise, int inviteType) {
this.quesList = quesList;
this.agentConclusion = agentConclusion;
this.agentGreet = agentGreet;
this.promiseTitle = promiseTitle;
this.promiseDesc = promiseDesc;
this.promiseButton = promiseButton;
this.customerActionPromise = customerActionPromise;
this.inviteType = inviteType;
}
}
......@@ -229,7 +229,16 @@ public interface Authorization {
network.agentCookies.put("authKey", visitorAuth25);
System.out.println("用户AUTH_KEY:" + visitorAuth25);
}
//访客X(Xmz)ID:96 实名
default void visitorAuth26() {
network.agentCookies.put("authKey", visitorAuth26);
System.out.println("用户AUTH_KEY:" + visitorAuth26);
}
//访客X(Db)ID:96 实名
default void visitorAuth27() {
network.agentCookies.put("authKey", visitorAuth27);
System.out.println("用户AUTH_KEY:" + visitorAuth27);
}
}
......@@ -254,8 +254,7 @@ public class Customer implements Authorization {
int chanceType=response.jsonPath().getInt("data.chanceType");
Assert.assertTrue(chanceType==1, network.message(BasicConfig.MOBILE_followChanceDetail, "跟进类型非咨询", response.body().asString()));
String question=response.jsonPath().getString("data.question");
Assert.assertEquals(question,"咨询问题一",network.message(BasicConfig.MOBILE_followChanceDetail, "咨询问题为null", response.body().asString()));
Assert.assertTrue(question.equals("一度问题1")||question.equals("一度问题2")||question.equals("一度问题3"),network.message(BasicConfig.MOBILE_followChanceDetail, "咨询问题为null", response.body().asString()));
}
......
......@@ -5,6 +5,7 @@ import com.kjj.bean.agent.LiveUserList;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.IdMakeUtil;
import com.kjj.utils.JsonUtil;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response;
......@@ -20,6 +21,7 @@ public class LiveLater implements Authorization {
public String pageSize;
public List<LiveUserList> liveUserId;
@BeforeClass
public void setUp() { agentAuth(); }
......@@ -351,4 +353,14 @@ public class LiveLater implements Authorization {
e.printStackTrace();
}
}
@Test(description = "直播后准客户数量统计",priority = 20)
public void 直播后准客户数量统计(){
Map<String,Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params,BasicConfig.MOBILE_potentialNum);
System.out.println(response.body().asString());
int potentialNum = response.jsonPath().getInt("data.potentialNum");
Assert.assertTrue(potentialNum > 0,network.message(params,BasicConfig.MOBILE_potentialNum,"准客户数量错误",response.body().asString()));
}
}
......@@ -28,14 +28,16 @@ public class Potential implements Authorization {
}
@Test(description = "获取推送问题咨询", priority =2)
public void 获取推送问题() {
@Test(description = "一度用户获取话术模板", priority =2)
public void 一度用户获取话术模板() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(Params, BasicConfig.ANCHOR_questions);
Response response = network.getResponse(Params, BasicConfig.MOBILE_dialogue);
System.out.println(response.body().asString());
bizConfId=response.jsonPath().getString("data[0].id");
Assert.assertNotNull(bizConfId, network.message(Params, BasicConfig.ANCHOR_questions, "为获取到问题ID", response.body().asString()));
String promiseTitle = response.jsonPath().getString("data.promiseTitle");
Assert.assertEquals(promiseTitle,"一度承诺标题", network.message(Params, BasicConfig.MOBILE_dialogue, "一度用户标题", response.body().asString()));
bizConfId=response.jsonPath().getString("data.quesList[0].id");
Assert.assertNotNull(bizConfId, network.message(Params, BasicConfig.MOBILE_dialogue, "未获取到问题ID", response.body().asString()));
}
......@@ -104,7 +106,15 @@ public class Potential implements Authorization {
}
@Test(description = "二度用户获取话术模板", priority =8)
public void 二度用户获取话术模板() {
visitorAuth5();
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(Params, BasicConfig.MOBILE_dialogue);
System.out.println(response.body().asString());
String promiseTitle = response.jsonPath().getString("data.promiseTitle");
Assert.assertEquals(promiseTitle,"二度承诺标题", network.message(Params, BasicConfig.MOBILE_dialogue, "二度用户获取话术模板错误", response.body().asString()));
}
}
......@@ -659,9 +659,6 @@ public class passQues implements Authorization {
int amount1 =resultRes.jsonPath().getInt("data.amount");
System.out.println(amount1);
Assert.assertTrue(amount1==30, network.message(redResultParam, BasicConfig.ANCHOR_redResult, "红包领取金额为空", resultRes.body().asString()));
}
}
......@@ -61,6 +61,7 @@ public class FlipCard implements Authorization {
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareType",6);
params.put("userType","A");
Response response = network.getResponse(params, BasicConfig.MOBILE_helpInfo);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
......@@ -481,8 +482,4 @@ public class FlipCard implements Authorization {
}
}
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.kjj.bean.answer.AddReward;
import com.kjj.bean.answer.AddWelfareConf;
import com.kjj.bean.answer.RewardList;
import com.kjj.bean.issue.Dialogue;
import com.kjj.bean.lottery.ConfIdList;
import com.kjj.bean.manager.*;
import com.kjj.bean.secondKill.SecondKillList;
......@@ -22,6 +23,9 @@ import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.*;
import static com.kjj.utils.BaseUtils.ssoLogin;
public class SaveLive implements Authorization {
public String liveID;
public String EncodeLiveID;
......@@ -32,7 +36,8 @@ public class SaveLive implements Authorization {
private final long secKillGoodsId = 115; // 用来配置轮次的秒杀商品ID
@BeforeClass
public void setUp() {BaseUtils.ssoLogin(); }
public void setUp() {
ssoLogin(); }
/**
* 创建直播
......@@ -2266,32 +2271,9 @@ public class SaveLive implements Authorization {
System.out.println(response.body().asString());
Assert.assertTrue(popupScene==7, network.message(Params, BasicConfig.MANAGER_popupDetail, "闯关答题授权弹窗ID查询为null", response.body().asString()));
}
/**
* 准客户
*/
@Test(description = "问题配置", priority = 121)
public void 问题配置() {
//新增问题配置
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("quesList",Arrays.asList("咨询问题一", "咨询问题二","咨询问题三"));
Response response = network.postResponse(Params, BasicConfig.MANAGER_potentialSaveQues);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data,network.message(Params, BasicConfig.MANAGER_potentialSaveQues, "未配置咨询问题", response.body().asString()));
//查询问题列表
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
response=network.getResponse(Params, BasicConfig.MANAGER_potentialQuesList);
System.out.println(response.body().asString());
String quesDesc=response.jsonPath().getString("data[0].quesDesc");
Assert.assertEquals(quesDesc,"咨询问题一",network.message(Params, BasicConfig.MANAGER_potentialSaveQues, "咨询问题详情为null", response.body().asString()));
}
@Test(description = "保存第5轮和第6轮配置红包", priority = 122)
@Test(description = "保存第5轮和第6轮配置红包", priority = 121)
public void 保存第5轮和第6轮配置红包() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -2314,7 +2296,7 @@ public class SaveLive implements Authorization {
}
@Test(description = "查询时长红包配置列表", priority = 123)
@Test(description = "查询时长红包配置列表", priority = 122)
public void 查询时长红包配置列表() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -2327,7 +2309,7 @@ public class SaveLive implements Authorization {
Assert.assertEquals(list.size(), 6,network.message(Params, BasicConfig.MANAGER_timeRedList, "查询时长红包配置列表失败", response.body().asString()));
}
@Test(description = "查询第5轮和第6轮时长红包详情", priority = 124)
@Test(description = "查询第5轮和第6轮时长红包详情", priority = 123)
public void 查询第5轮和第6轮时长红包详情() {
Map<String, Object> Params = new HashMap<>();
Params.put("id",this.redId.get(4).getId() );
......@@ -2343,11 +2325,10 @@ public class SaveLive implements Authorization {
System.out.println(data);
Assert.assertNotNull(data, network.message(Params, BasicConfig.MANAGER_otherDetail, "查询第6轮时长红包详情失败", response.body().asString()));
}
/**
* 配置秒杀互动
*/
@Test(description = "添加秒杀互动", priority = 125)
@Test(description = "添加秒杀互动", priority = 124)
public void 添加秒杀互动() {
Map<String, Object> secKillAddPar = new HashMap<>();
secKillAddPar.put("goodsId", secKillGoodsId);
......@@ -2366,7 +2347,7 @@ public class SaveLive implements Authorization {
}
}
@Test(description = "获取秒杀轮次列表", priority = 126)
@Test(description = "获取秒杀轮次列表", priority = 125)
public void 获取秒杀轮次列表() {
Map<String, Object> liveSecKillPar = new HashMap<>();
liveSecKillPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -2396,7 +2377,7 @@ public class SaveLive implements Authorization {
newSecKillId = secondKillList.getId();
}
@Test(description = "编辑秒杀轮次", priority = 127)
@Test(description = "编辑秒杀轮次", priority = 126)
public void 编辑秒杀轮次() {
Map<String, Object> secKillUpdatePar = new HashMap<>();
secKillUpdatePar.put("goodsId", secKillGoodsId);
......@@ -2414,7 +2395,7 @@ public class SaveLive implements Authorization {
}
}
@Test(description = "删除秒杀轮次", priority = 128)
@Test(description = "删除秒杀轮次", priority = 127)
public void 删除秒杀轮次() {
Map<String, Object> secKillDelPar = new HashMap<>();
secKillDelPar.put("id", newSecKillId);
......@@ -2436,4 +2417,100 @@ public class SaveLive implements Authorization {
}
}
/**
* 亲友抽奖券配置
*/
@Test(description = "保存亲友抽奖券配置", priority = 128)
public void 保存亲友抽奖券配置(){
ssoLogin();
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("giftedImg","https://yun.dui88.com/kjy/image/20210825/1629861430316.png");
Params.put("notGiftedImg","https://yun.dui88.com/kjy/image/20210825/1629861425857.png");
Params.put("popImg","https://yun.dui88.com/kjy/image/20210825/1629861435394.png");
Params.put("envelopeWord","这是信封话术");
Params.put("lotteryName","亲友抽奖券");
Params.put("lotteryNum",3);
Params.put("lotteryDesc","这是亲友抽奖券的说明");
Response response = network.postResponse(Params, BasicConfig.MANAGER_relativeLottery);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_relativeLottery, "保存亲友券配置失败", response.body().asString()));
}
@Test(description = "查看亲友抽奖券配置详情", priority = 129)
public void 查看亲友抽奖券配置详情() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(Params, BasicConfig.MANAGER_detailLottery);
System.out.println(response.body().asString());
Object data =response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(Params, BasicConfig.MANAGER_detailLottery, "查看亲友抽奖券配置详情为空", response.body().asString()));
int lotteryNum = response.jsonPath().getInt("data.lotteryNum");
int openStatus = response.jsonPath().getInt("data.openStatus");
Assert.assertEquals(openStatus,0, network.message(Params, BasicConfig.MANAGER_detailLottery, "亲友抽奖券数开启状态错误", response.body().asString()));
Assert.assertEquals(lotteryNum,3, network.message(Params, BasicConfig.MANAGER_detailLottery, "亲友抽奖券数量错误", response.body().asString()));
}
@Test(description = "开启亲友抽奖券配置", priority = 130)
public void 开启亲友抽奖券配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("openStatus", 1);
Response response = network.postResponse(Params, BasicConfig.MANAGER_switchStatusLottery);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_switchStatusLottery, "开启亲友券配置失败", response.body().asString()));
}
@Test(description = "查询亲友抽奖券配置状态", priority = 131)
public void 查询亲友抽奖券配置状态() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(Params, BasicConfig.MANAGER_getConfDetail);
System.out.println(response.body().asString());
boolean fissionLotteryConfBuildStatus = response.jsonPath().getBoolean("data.fissionLotteryConfBuildStatus");
Assert.assertTrue(fissionLotteryConfBuildStatus, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未配置亲友抽奖券", response.body().asString()));
boolean fissionLotteryConfStatus = response.jsonPath().getBoolean("data.fissionLotteryConfStatus");
Assert.assertTrue(fissionLotteryConfStatus, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未配置亲友抽奖券", response.body().asString()));
}
/**
* 准客户承诺话术配置
*/
@Test(description = "保存客户承诺话术配置", priority = 132)
public void 保存客户承诺话术配置(){
ssoLogin();
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
ArrayList<Dialogue> dialogues = new ArrayList<>();
dialogues.add(new Dialogue(new ArrayList<>(Arrays.asList("一度问题1","一度问题2","一度问题3")),"一度代理人结束语","一度代理人欢迎语","一度承诺标题","一度承诺描述","一度承诺按钮文案","一度行动承诺",1));
dialogues.add(new Dialogue(new ArrayList<>(Arrays.asList("二度问题1","二度问题2","二度问题3")),"二度代理人结束语","二度代理人欢迎语","二度承诺标题","二度承诺描述","二度承诺按钮文案","二度行动承诺",0));
Params.put("dialogues", dialogues);
Response response = network.postResponse(Params, BasicConfig.MANAGER_saveDialogue);
System.out.println(Params);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_saveDialogue, "保存客户承诺话术配置失败", response.body().asString()));
}
@Test(description = "查看客户承诺话术配置", priority = 133)
public void 查看客户承诺话术配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(Params, BasicConfig.MANAGER_findDialogue);
System.out.println(response.body().asString());
Object data =response.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(Params, BasicConfig.MANAGER_findDialogue, "查看客户承诺话术为空", response.body().asString()));
int size = response.jsonPath().getInt("data.size()");
Assert.assertEquals(size,2, network.message(Params, BasicConfig.MANAGER_findDialogue, "客户承诺话术错误", response.body().asString()));
String promiseTitle1 = response.jsonPath().getString("data.find{it.inviteType == 1}.promiseTitle");
String promiseTitle2 = response.jsonPath().getString("data.find{it.inviteType == 0}.promiseTitle");
Assert.assertEquals(promiseTitle1,"一度承诺标题", network.message(Params, BasicConfig.MANAGER_findDialogue, "一度客户承诺话术错误", response.body().asString()));
Assert.assertEquals(promiseTitle2,"二度承诺标题", network.message(Params, BasicConfig.MANAGER_findDialogue, "二度客户承诺话术错误", response.body().asString()));
}
}
......@@ -38,9 +38,6 @@ public class Share implements Authorization {
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
Assert.assertEquals(mpShareTitle,"直播前常规分享文案",network.message(Params, BasicConfig.MANAGER_mpShareList, "直播前_常规分享配置列表为null", response.body().asString()));
}
@Test(description = "直播中_常规分享", priority = 2)
......@@ -62,8 +59,6 @@ public class Share implements Authorization {
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
Assert.assertEquals(mpShareTitle,"直播中常规分享文案",network.message(Params, BasicConfig.MANAGER_mpShareList, "直播中常规分享配置列表为null", response.body().asString()));
}
@Test(description = "红包分享", priority = 3)
......@@ -85,8 +80,6 @@ public class Share implements Authorization {
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
Assert.assertEquals(mpShareTitle,"红包分享文案",network.message(Params, BasicConfig.MANAGER_mpShareList, "红包分享配置列表为null", response.body().asString()));
}
......@@ -109,8 +102,6 @@ public class Share implements Authorization {
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
Assert.assertEquals(mpShareTitle,"宝箱裂变分享文案",network.message(Params, BasicConfig.MANAGER_mpShareList, "宝箱裂变分享配置列表为null", response.body().asString()));
}
@Test(description = "猜数红包分享", priority = 5)
......@@ -132,8 +123,6 @@ public class Share implements Authorization {
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
Assert.assertEquals(mpShareTitle,"猜数字红包分享文案",network.message(Params, BasicConfig.MANAGER_mpShareList, "猜数字红包配置列表为null", response.body().asString()));
}
@Test(description = "翻牌分享", priority = 6)
......@@ -155,8 +144,6 @@ public class Share implements Authorization {
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
Assert.assertEquals(mpShareTitle,"翻牌红包分享文案",network.message(Params, BasicConfig.MANAGER_mpShareList, "翻牌红包配置列表为null", response.body().asString()));
}
@Test(description = "好运红包分享", priority = 7)
......@@ -178,9 +165,6 @@ public class Share implements Authorization {
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
Assert.assertEquals(mpShareTitle,"好运红包分享",network.message(Params, BasicConfig.MANAGER_mpShareList, "好运红包配置列表为null", response.body().asString()));
}
@Test(description = "答题闯关分享", priority = 8)
......@@ -202,12 +186,27 @@ public class Share implements Authorization {
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
Assert.assertEquals(mpShareTitle,"答题闯关分享文案",network.message(Params, BasicConfig.MANAGER_mpShareList, "答题闯关配置列表为null", response.body().asString()));
}
@Test(description = "亲友抽奖券分享", priority = 9)
public void 亲友抽奖券分享() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("mpShareUrl", "//yun.dui88.com/kjy/image/20210526/1622022856685.jpeg");
Params.put("mpShareTitle", "亲友抽奖券分享文案");
Params.put("shareType",10);
Response response = network.postResponse(Params, BasicConfig.MANAGER_saveOrUpdateMpShare);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data,network.message(Params, BasicConfig.MOBILE_info, "答题闯关分享失败", response.body().asString()));
Params.clear();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("shareType",10);
response=network.getResponse(Params, BasicConfig.MANAGER_mpShareList);
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
Assert.assertEquals(mpShareTitle,"亲友抽奖券分享文案",network.message(Params, BasicConfig.MANAGER_mpShareList, "答题闯关配置列表为null", response.body().asString()));
}
}
......@@ -373,6 +373,7 @@ public class Lottery implements Authorization {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("shareType",11);
Params.put("userType","A");
Response response = network.getResponse(Params, BasicConfig.MOBILE_helpInfo);
System.out.println( response.body().asString());
boolean success = response.jsonPath().getBoolean("success");
......@@ -593,7 +594,6 @@ public class Lottery implements Authorization {
long data = myCountRes.jsonPath().getLong("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(myCountParam, BasicConfig.USER_myCount, "获取抽奖码数量失败", myCountRes.body().asString()));
}
@Test(description = "幸运任务邀请E关系绑定", priority = 42)
......
package com.kjj.cases.live.lottery;
import com.kjj.bean.lottery.ConfIdList;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.JsonUtil;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.kjj.config.BasicConfig.*;
import static com.kjj.utils.ThreadSleepUtils.sleep;
public class RelativeLottery implements Authorization {
public String confId;
public String shareSign;
@BeforeClass
public void setUp(){
visitorAuth9();
}
@Test(description = "查询亲友配置开启状态", priority = 1)
public void 查询亲友配置开启状态() {
Map<String, Object> getLiveAwardListParam = new HashMap<>();
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(getLiveAwardListParam, MOBILE_allLottery);
System.out.println(response.body().asString());
int fissionLotteryConfStatus = response.jsonPath().getInt("data.on");
Assert.assertEquals(fissionLotteryConfStatus, 1,network.message(getLiveAwardListParam, MOBILE_allLottery, "亲友配置券未开启", response.body().asString()));
}
@Test(description = "仅一度用户可以领取抽奖券", priority = 2)
public void 仅一度用户可以领取抽奖券() {
visitorAuth9();
Map<String, Object> getLiveAwardListParam = new HashMap<>();
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(getLiveAwardListParam, MOBILE_confLottery);
System.out.println(response.body().asString());
int isAcceptable = response.jsonPath().getInt("data.userDetail.isAcceptable");
int userAcceptStatus = response.jsonPath().getInt("data.userDetail.userAcceptStatus");
int receiverInfoList = response.jsonPath().getInt("data.userDetail.receiverInfoList.size()");
int lotteryNum = response.jsonPath().getInt("data.confDetail.lotteryNum");
Assert.assertEquals(isAcceptable, 1,network.message(getLiveAwardListParam, MOBILE_confLottery, "一度用户没有亲友券领取资格", response.body().asString()));
Assert.assertEquals(userAcceptStatus, 1,network.message(getLiveAwardListParam, MOBILE_confLottery, "一度用户已领取亲友券", response.body().asString()));
Assert.assertEquals(receiverInfoList, 0,network.message(getLiveAwardListParam, MOBILE_confLottery, "亲友配置券已接受人数错误", response.body().asString()));
Assert.assertEquals(lotteryNum, 3,network.message(getLiveAwardListParam, MOBILE_confLottery, "亲友配置券数量错误", response.body().asString()));
confId = response.jsonPath().getString("data.confDetail.id");
visitorAuth22();
getLiveAwardListParam.clear();
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
response = network.getResponse(getLiveAwardListParam, MOBILE_confLottery);
System.out.println(response.body().asString());
isAcceptable = response.jsonPath().getInt("data.userDetail.isAcceptable");
Assert.assertEquals(isAcceptable, 0,network.message(getLiveAwardListParam, MOBILE_confLottery, "非一度用户有亲友券领取资格", response.body().asString()));
}
@Test(description = "访客H收下抽奖券", priority = 3)
public void 访客H收下抽奖券() {
visitorAuth9();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response bindingRes = network.postResponse(bindingParam, MOBILE_acceptLottery);
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, MOBILE_acceptLottery, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客H_分享直播间", priority = 5)
public void 访客H_分享直播间() {
sleep(1000);
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 10);
Response signRes = network.getResponse(signParam, MOBILE_sign);
System.out.println(signRes.body().asString());
String data = signRes.jsonPath().getString("data");
this.shareSign = data;
Assert.assertNotNull(shareSign, network.message(signParam, MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "根据分享类型获取分享内容", priority = 6)
public void 根据分享类型获取分享内容() {
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareType",14);
params.put("userType","A");
Response response = network.getResponse(params, BasicConfig.MOBILE_helpInfo);
System.out.println(response.body().asString());
Object mpShareTitle = response.jsonPath().getJsonObject("data.mpShareTitle");
Assert.assertEquals(mpShareTitle,"亲友抽奖券分享文案", network.message(params, BasicConfig.MOBILE_helpInfo, "根据分享类型获取分享内容", response.body().asString()));
}
@Test(description = "访客H_获取小程序分享码", priority = 7)
public void 访客H_获取小程序分享码() {
sleep(1000);
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.postResponse(signParam, MOBILE_codeLottery);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertNotNull(data, network.message(signParam, MOBILE_codeLottery, "分享失败", response.body().asString()));
sleep(3000);
response = network.getResponse(signParam, MOBILE_codeDetailLottery);
System.out.println(response.body().asString());
boolean qrCodeUrl = response.jsonPath().getBoolean("data.qrCodeUrl");
Assert.assertNotNull(qrCodeUrl, network.message(signParam, MOBILE_codeDetailLottery, "分享失败", response.body().asString()));
}
@Test(description = "访客H获取直播所有的订阅消息模板", priority = 8)
public void 访客H获取直播所有的订阅消息模板() {
visitorAuth9();
Map<String, Object> sycParam = new HashMap<>();
sycParam.put("appid","wx4d7276f866bd24c8");
Response sycRes = network.postResponse(sycParam, BasicConfig.USER_wxIdAllList);
System.out.println(sycRes.body().asString());
Object data = sycRes.jsonPath().getJsonObject("data");
Assert.assertNotNull(data, network.message(sycParam, BasicConfig.USER_wxIdAllList, "获取订阅消息失败", sycRes.body().asString()));
}
@Test(description = "邀请Xmz关系绑定", priority = 9)
public void 邀请Xmz关系绑定() {
visitorAuth26();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign);
Response bindingRes = network.postResponse(bindingParam, MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "查询访客Xmz绑定结果和绑定凭证", priority = 10)
public void 查询访客Xmz绑定结果和绑定凭证() {
visitorAuth26();
sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
boolean success = tokenRes.jsonPath().getJsonObject("success");
Integer type = tokenRes.jsonPath().getInt("data.type");
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "访客A预约直播间", priority = 11)
public void 访客A预约直播间() {
visitorAuth26();
Map<String, Object> sycParam = new HashMap<>();
sycParam.put("bizId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
sycParam.put("bizType", 1);
List<Long> markIds1 = new ArrayList<>();
markIds1.add(142L);
markIds1.add(143L);
markIds1.add(140L);
sycParam.put("markIds", markIds1);
Response sycRes = network.postResponse(sycParam, BasicConfig.USER_SYCAPPOINTMENT);
Object data = sycRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(sycParam, BasicConfig.USER_SYCAPPOINTMENT, "预约失败", sycRes.body().asString()));
}
@Test(description = "访客Xmz给访客H助力", priority = 12)
public void 访客Xmz给访客H助力() {
visitorAuth26();
sleep(2000);
//获取授权配置助力弹窗
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("shareType",14);
Response response=network.getResponse(Params,BasicConfig.MOBILE_popupDetail);
System.out.println(response.body().asString());
String helpImg=response.jsonPath().getString("data.currentPopup.helpImg");
Assert.assertNotNull(helpImg,network.message(Params,BasicConfig.MOBILE_popupDetail,"助力弹窗为null",response.body().asString()));
Params.clear();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("shareSign",shareSign);
Params.put("shareType",14);
Params.put("confId",confId);
response = network.postResponse(Params, BasicConfig.MOBILE_assist);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(Params, BasicConfig.MOBILE_assist, "访客Xmz给访客H助力失败", response.body().asString()));
}
@Test(description = "查询亲友券被领取1张", priority = 13)
public void 查询亲友券被领取1() {
visitorAuth9();
Map<String, Object> getLiveAwardListParam = new HashMap<>();
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(getLiveAwardListParam, MOBILE_confLottery);
System.out.println(response.body().asString());
int receiverInfoList = response.jsonPath().getInt("data.userDetail.receiverInfoList.size()");
String nickname = response.jsonPath().getString("data.userDetail.receiverInfoList.get(0).nickname");
Assert.assertEquals(receiverInfoList, 1,network.message(getLiveAwardListParam, MOBILE_confLottery, "亲友配置券已接受人数错误", response.body().asString()));
Assert.assertEquals(nickname, "小米粥",network.message(getLiveAwardListParam, MOBILE_confLottery, "亲友配置券领取人错误", response.body().asString()));
}
}
......@@ -389,10 +389,10 @@ public class LiveVistorRed implements Authorization {
}
@Test(description = "访客H查询被助力者访客I的信息", priority = 23)
public void 访客H查询被助力者访客I的信息()
@Test(description = "访客C查询被助力者访客I的信息", priority = 23)
public void 访客C查询被助力者访客I的信息()
{
visitorAuth9();
visitorAuth3();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_Red);
params.put("shareSign", red_sharesign);
......@@ -402,9 +402,9 @@ public class LiveVistorRed implements Authorization {
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedHelpQuery, "帮好友助力失败", response.body().asString()));
}
/*访客端-访客A帮访客B助力*/
@Test(description = "访客H帮访客I助力", priority = 24)
public void 访客H帮访客I助力()
/*访客端-访客C帮访客I助力*/
@Test(description = "访客C帮访客I助力", priority = 24)
public void 访客C帮访客I助力()
{
visitorAuth3();
ThreadSleepUtils.sleep(2000);
......
......@@ -521,7 +521,7 @@ public class TimeRed implements Authorization {
System.out.println(data);
Integer state = response.jsonPath().getInt("data.state");
System.out.println(state);
Assert.assertTrue(state==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客H未领取第4轮红包", response.body().asString()));
Assert.assertTrue(state==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客H未领取第5轮红包", response.body().asString()));
visitorAuth8();
ThreadSleepUtils.sleep(3000);
......@@ -530,7 +530,7 @@ public class TimeRed implements Authorization {
System.out.println(data1);
Integer state1 = stateRes.jsonPath().getInt("data.state");
System.out.println(state1);
Assert.assertTrue(state1==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客I未领取第4轮红包", stateRes.body().asString()));
Assert.assertTrue(state1==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客I未领取第5轮红包", stateRes.body().asString()));
}
@Test(description = "下架第6轮红包任务对应的权益", priority = 23)
......@@ -561,14 +561,14 @@ public class TimeRed implements Authorization {
Response response = network.getResponse(Params, BasicConfig.ANCHOR_tasks);
Object data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(Params, BasicConfig.ANCHOR_tasks, "访客H未完成表单任务",response.body().asString()));
Assert.assertNotNull(data, network.message(Params, BasicConfig.ANCHOR_tasks, "访客H未完成任务",response.body().asString()));
visitorAuth8();
ThreadSleepUtils.sleep(1000);
response = network.getResponse(Params, BasicConfig.ANCHOR_tasks);
data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(Params, BasicConfig.ANCHOR_tasks, "访客H未完成表单任务",response.body().asString()));
Assert.assertNotNull(data, network.message(Params, BasicConfig.ANCHOR_tasks, "访客I未完成任务",response.body().asString()));
}
@Test(description = "开启第6轮红包", priority = 25)
......@@ -581,14 +581,14 @@ public class TimeRed implements Authorization {
Response response = network.postResponse(Params, BasicConfig.ANCHOR_redOpen);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.ANCHOR_redOpen, "访客H开启第4轮红包失败", response.body().asString()));
Assert.assertTrue(data, network.message(Params, BasicConfig.ANCHOR_redOpen, "访客H开启第6轮红包失败", response.body().asString()));
visitorAuth8();
ThreadSleepUtils.sleep(3000);
Response redRes = network.postResponse(Params, BasicConfig.ANCHOR_redOpen);
boolean data1 = redRes.jsonPath().getBoolean("data");
System.out.println(data1);
Assert.assertTrue(data1, network.message(Params, BasicConfig.ANCHOR_redOpen, "访客I开启第4轮红包失败", redRes.body().asString()));
Assert.assertTrue(data1, network.message(Params, BasicConfig.ANCHOR_redOpen, "访客I开启第6轮红包失败", redRes.body().asString()));
}
@Test(description = "查询开启第6轮红包结果", priority = 26)
......@@ -604,7 +604,7 @@ public class TimeRed implements Authorization {
System.out.println(data);
Integer state = response.jsonPath().getInt("data.state");
System.out.println(response.body().asString());
Assert.assertTrue(state==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客H未领取第4轮红包", response.body().asString()));
Assert.assertTrue(state==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客H未领取第6轮红包", response.body().asString()));
visitorAuth8();
ThreadSleepUtils.sleep(3000);
......@@ -613,7 +613,7 @@ public class TimeRed implements Authorization {
System.out.println(data1);
Integer state1 = stateRes.jsonPath().getInt("data.state");
System.out.println(state1);
Assert.assertTrue(state1==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客I未领取第4轮红包", stateRes.body().asString()));
Assert.assertTrue(state1==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客I未领取第6f d s s d f轮红包", stateRes.body().asString()));
}
//提现
......
......@@ -99,6 +99,7 @@ public class Treasure implements Authorization {
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareType",7);
infoParam.put("userType","A");
Response response = network.getResponse(infoParam, BasicConfig.MOBILE_helpInfo);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
......
......@@ -64,6 +64,10 @@ public class BasicConfig {
public static String visitorAuth24 ="2Tsc8MwHZmXJKPfze38rXm37UEX1EtfvfjxjLr1GZDVAdRXD3hSK2j6WjZQgFaqHHJcT5yk3tB64Ebu38fmuJymWQtPcAdr";
//直播访客 (亦心)ID:96 实名用户
public static String visitorAuth25 ="5MgSyboxqzAQZZJEsTf43nVX38cJBxsCHATPDDoWL7qHS5PaPehMLbSmTNWgySTMFYevyw9tSxYKVU2VfhR9fW1FrWTk";
//直播访客 (小米粥)ID:749
public static String visitorAuth26 ="LEH7epeHVDJWzhZ6DiexTHnfbvr9gocGu9FvH3CVz6g4Cez7hNpJpzWTAnDH2FiQ3oj3dDx5W6NQYDzd3ToQiPbQpbtag";
//直播访客 (兑吧集团)ID:947
public static String visitorAuth27 ="LEH7epeHVDJWzhZ6DiexTHnfbvr9gocGu9ExJDb9xHoegrcNGiGyvUPrCXu5VECCsW6HDaVZMFu1Rph5WvdbB3jbkGcM9";
/**
* 集客助手授权key
......@@ -100,7 +104,6 @@ public class BasicConfig {
// *************** 准客户 ***************
public static final String ANCHOR_card = MOBILE_HOST + "/clue/agent/card";
public static final String ANCHOR_questions = MOBILE_HOST + "/kjy/live/agent/potential/questions";
public static final String ANCHOR_submit = MOBILE_HOST + "/kjy/live/agent/potential/submit";
public static final String ANCHOR_agree = MOBILE_HOST + "/kjy/live/agent/potential/agree";
public static final String ANCHOR_questionSubmitted = MOBILE_HOST + "/kjy/live/agent/potential/questionSubmitted";
......@@ -137,6 +140,12 @@ public class BasicConfig {
public static final String MANAGER_secondKillDel = MANAGER_HOST + "/kjy/manager/live/second/kill/goods/delete";
public static final String MANAGER_secondKillUpdate = MANAGER_HOST + "/kjy/manager/live/second/kill/goods/update";
//客户承诺话术配置
public static final String MANAGER_saveDialogue = MANAGER_HOST + "/kjy/manager/live/potential/saveDialogue";
public static final String MANAGER_findDialogue = MANAGER_HOST + "/kjy/manager/live/potential/findDialogue";
public static final String MOBILE_dialogue= MOBILE_HOST + "/kjy/live/agent/potential/dialogue";
public static final String MOBILE_potentialNum= MOBILE_HOST + "/kjy/live/agent/clue/potentialNum";
// *************** 闯关答题 ***************
public static final String MANAGER_addOrUpdateQues = MANAGER_HOST + "/kjy/manager/pass/ques/addOrUpdateQues";
public static final String MANAGER_deleteQues = MANAGER_HOST + "/kjy/manager/pass/ques/deleteQues";
......@@ -281,11 +290,21 @@ public class BasicConfig {
public static final String MOBILE_sign = MOBILE_HOST + "/kjy/live/share/help/sign";
public static final String MOBILE_simple = MOBILE_HOST + "/kjy/live/help/simple";
public static final String MOBILE_info = MOBILE_HOST + "/kjy/live/help/info";
public static final String MOBILE_helpInfo = MOBILE_HOST + "/kjy/live/share/help/info";
public static final String MOBILE_helpInfo = MOBILE_HOST + "/kjy/live/share/help/shareInfo";
public static final String MOBILE_assist = MOBILE_HOST + "/kjy/live/help/assist";
public static final String MOBILE_popupDetail = MOBILE_HOST + "/kjy/live/auth/popup/detail";
// *************** 亲友抽奖券 ***************
public static final String MANAGER_relativeLottery = MANAGER_HOST + "/kjy/manager/fission/lottery/saveOrUpdate";
public static final String MANAGER_detailLottery = MANAGER_HOST + "/kjy/manager/fission/lottery/detail";
public static final String MANAGER_switchStatusLottery = MANAGER_HOST + "/kjy/manager/fission/lottery/switchStatus";
public static final String MOBILE_allLottery = MOBILE_HOST + "/kjy/live/info/pre/data";
public static final String MOBILE_confLottery = MOBILE_HOST +"/kjy/live/fission/lottery/conf/all";
public static final String MOBILE_codeLottery = MOBILE_HOST +"/kjy/live/fission/lottery/user/code";
public static final String MOBILE_drawCode = MOBILE_HOST +"/kjy/live/fission/lottery/user/drawCode";
public static final String MOBILE_codeDetailLottery = MOBILE_HOST +"/kjy/live/fission/lottery/user/code/detail";
public static final String MOBILE_drawDetailLottery = MOBILE_HOST +"/kjy/live/fission/lottery/user/drawCode/detail";
public static final String MOBILE_acceptLottery = MOBILE_HOST +"/kjy/live/fission/lottery/user/accept";
// *************** 时长宝箱 ***************
public static final String MANAGER_list1 = MANAGER_HOST + "/kjy/manager/treasure/time/conf/list";
......@@ -402,11 +421,6 @@ public class BasicConfig {
public static final String MANAGER_popupDetail = MANAGER_HOST + "/kjy/manager/live/auth/popup/detail";
public static final String MANAGER_popupUpdate = MANAGER_HOST + "/kjy/manager/live/auth/popup/update";
//准客户
public static final String MANAGER_potentialSaveQues = MANAGER_HOST + "/kjy/manager/live/potential/saveQues";
public static final String MANAGER_potentialQuesList = MANAGER_HOST + "/kjy/manager/live/potential/quesList";
//客户管理
public static final String MOBILE_potentialCount = MOBILE_HOST + "/kjy/live/agent/customer/potentialCount";
public static final String MOBILE_customerList = MOBILE_HOST + "/kjy/live/agent/customer/list";
......
......@@ -24,7 +24,7 @@ public class DingTalkUtils {
context = "【接口自动化测试结果反馈】\n"
+ context
+ "报告地址: http://10.172.58.199/view/kkk/job/kejiji_interface/HTML_20Report\n"
+ "@张艳玲";
+ "@龚小红";
System.out.println(context);
Map<String, Object> contentParams = new HashMap<String, Object>();
......
......@@ -80,6 +80,11 @@
</classes>
</test>
<test preserve-order="true" name="亲友券">
<classes>
<class name="com.kjj.cases.live.lottery.RelativeLottery"/>
</classes>
</test>
<test preserve-order="true" name="直播前-我的客户页">
<classes>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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