Commit 651c3ddb authored by 龚小红's avatar 龚小红

Merge branch 'feature/20210901-xmc' into 'master'

Feature/20210901 xmc-秒杀互动支付前流程

See merge request test-group/kejiji!112
parents 8e11e39f 03fdeed0
package com.kjj.bean.secondKill;
import lombok.Data;
@Data
public class AnchorGetKGList {
private String goodsTitle;
private String id;
}
package com.kjj.bean.secondKill;
import lombok.Data;
@Data
public class AnchorGetSKList {
private int interactStatus;
private String id;
private int surplusNum;
private String goodsId;
}
package com.kjj.bean.secondKill;
import lombok.Data;
@Data
public class KillGoods {
private String confId;
private int chargeStatus;
}
......@@ -229,16 +229,6 @@ public class Answer implements Authorization {
//访客端
/*查询访客端有奖答题配置详情*/
@Test(description = "代理人关系绑定", priority = 11)
public void 代理人关系绑定() {
agentAuth();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客A查询答题红包配置", priority = 12)
public void 访客A查询答题红包配置()
{
......
......@@ -17,15 +17,6 @@ import org.testng.annotations.Test;
import java.util.*;
public class LiveMaterial implements Authorization {
private final String killGoodsImg = "https://yun.dui88.com/kjy/image/20210818/1629269441692.jpeg";
private final String killGoodsHeadImg = "https://yun.dui88.com/kjy/image/20210818/1629269453038.jpeg";
private final String killGoodsPicture = "https://yun.dui88.com/kjy/image/20210818/1629269488947.jpeg";
private final long companyId = 101; // 直播公司ID
private final String newGoodsTitle = "秒杀商品1";
private long skGoodsId; // 秒杀商品id
private int pageNum; // 秒杀商品分页数
private int goodsCount; // 当前页面商品数量
public static String skGoodsTitle = "编辑秒杀商品"; //秒杀商品名称
@BeforeClass
public void setUp() {
......@@ -363,114 +354,5 @@ public class LiveMaterial implements Authorization {
}
// 配置公司秒杀商品
@Test(description = "添加秒杀商品", priority = 15)
public void 添加秒杀商品() {
List<String> killGoodsHeadImgs = new ArrayList<>();
List<String> killGoodsPictures = new ArrayList<>();
killGoodsHeadImgs.add(killGoodsHeadImg);
killGoodsPictures.add(killGoodsPicture);
Map<String, Object> killGoodsPar = new HashMap<>();
killGoodsPar.put("goodsImg", killGoodsImg);
killGoodsPar.put("goodsHeadImg", killGoodsHeadImgs);
killGoodsPar.put("goodsPictures", killGoodsPictures);
killGoodsPar.put("companyId", companyId);
killGoodsPar.put("goodsTitle", newGoodsTitle);
killGoodsPar.put("goodsExplain", "文字说明");
Response killGoodsRes = network.postResponse(killGoodsPar, BasicConfig.MANAGER_skGoodsSaveOrUpdate);
Assert.assertTrue(killGoodsRes.jsonPath().getBoolean("success"));
boolean data = killGoodsRes.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(killGoodsPar, BasicConfig.MANAGER_skGoodsSaveOrUpdate, "添加秒杀商品失败", killGoodsRes.body().asString()));
}
@Test(description = "获取秒杀商品列表", priority = 16)
public void 获取秒杀商品列表() {
Map<String, Object> skGoodsListsPar = new HashMap<>();
skGoodsListsPar.put("companyId", companyId); // 默认pageSize=20,pageNo=1
try {
Response skGoodsListsRes = network.getResponse(skGoodsListsPar, BasicConfig.MANAGER_skGoodsLists);
long totalCount = skGoodsListsRes.jsonPath().getLong("data.totalCount");
if (totalCount > 20){
pageNum = (int) totalCount / 20 + 1;
skGoodsListsPar.put("pageSize", 20);
skGoodsListsPar.put("pageNo", pageNum);
System.out.println();
skGoodsListsRes = network.getResponse(skGoodsListsPar, BasicConfig.MANAGER_skGoodsLists);
}
List<KillGoodsList> killGoodsLists = JsonUtil.parseResponseToPageBean(skGoodsListsRes, KillGoodsList.class);
goodsCount = killGoodsLists.size();
KillGoodsList killGoodsList = killGoodsLists.get(0);
String goodsTitle = killGoodsList.getGoodsTitle();
Assert.assertEquals(goodsTitle, newGoodsTitle, network.message(skGoodsListsPar, BasicConfig.MANAGER_skGoodsLists, "新增商品错误", skGoodsListsRes.body().asString()));
skGoodsId = killGoodsList.getId();
}catch (Exception e){
e.printStackTrace();
}
}
@Test(description = "获取商品详情", priority = 17)
public void 获取商品详情() {
Map<String, Object> skGoodsDetailPar = new HashMap<>();
skGoodsDetailPar.put("id", skGoodsId);
Response skGoodsDetailRes = network.getResponse(skGoodsDetailPar, BasicConfig.MANAGER_skGoodsDetail);
long id = skGoodsDetailRes.jsonPath().getLong("data.companyId");
String goodsTitle = skGoodsDetailRes.jsonPath().getString("data.goodsTitle");
Assert.assertEquals(goodsTitle, newGoodsTitle, network.message(skGoodsDetailPar, BasicConfig.MANAGER_skGoodsDetail, "获取商品标题错误", skGoodsDetailRes.body().asString()));
Assert.assertEquals(id, companyId, network.message(skGoodsDetailPar, BasicConfig.MANAGER_skGoodsDetail, "获取商品所属公司id错误", skGoodsDetailRes.body().asString()));
}
@Test(description = "编辑秒杀商品", priority = 18)
public void 编辑秒杀商品() {
List<String> killGoodsHeadImgs = new ArrayList<>();
List<String> killGoodsPictures = new ArrayList<>();
killGoodsHeadImgs.add(killGoodsHeadImg);
killGoodsPictures.add(killGoodsPicture);
Map<String, Object> killGoodsPar = new HashMap<>();
killGoodsPar.put("id", skGoodsId);
killGoodsPar.put("goodsImg", killGoodsImg);
killGoodsPar.put("goodsHeadImg", killGoodsHeadImgs);
killGoodsPar.put("goodsPictures", killGoodsPictures);
killGoodsPar.put("companyId", companyId);
killGoodsPar.put("goodsTitle", skGoodsTitle);
killGoodsPar.put("goodsExplain", "文字说明");
Response killGoodsRes = network.postResponse(killGoodsPar, BasicConfig.MANAGER_skGoodsSaveOrUpdate);
try {
boolean data = killGoodsRes.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(killGoodsPar, BasicConfig.MANAGER_skGoodsSaveOrUpdate, "编辑秒杀商品失败", killGoodsRes.body().asString()));
Map<String, Object> skGoodsDetailPar = new HashMap<>();
skGoodsDetailPar.put("id", skGoodsId);
Response skGoodsDetailRes = network.getResponse(skGoodsDetailPar, BasicConfig.MANAGER_skGoodsDetail);
String goodsTitle = skGoodsDetailRes.jsonPath().getString("data.goodsTitle");
Assert.assertEquals(goodsTitle, skGoodsTitle, network.message(skGoodsDetailPar, BasicConfig.MANAGER_skGoodsDetail, "商品名称未更新", skGoodsDetailRes.body().asString()));
}catch (NullPointerException e){
e.printStackTrace();
}
}
@Test(description = "删除秒杀商品", priority = 19)
public void 删除秒杀商品() {
Map<String, Object> skGoodsDelPar = new HashMap<>();
skGoodsDelPar.put("id", skGoodsId);
Response skGoodsDelRes = network.postResponse(skGoodsDelPar, BasicConfig.MANAGER_skGoodsDelete);
boolean data = skGoodsDelRes.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(skGoodsDelPar, BasicConfig.MANAGER_skGoodsDelete, "删除商品失败", skGoodsDelRes.body().asString()));
if(goodsCount == 1){
pageNum = pageNum - 1;
}
Map<String, Object> skGoodsListsPar = new HashMap<>();
skGoodsListsPar.put("companyId", companyId);
skGoodsListsPar.put("pageSize", 20);
skGoodsListsPar.put("pageNo", pageNum);
Response skGoodsListsRes = network.getResponse(skGoodsListsPar, BasicConfig.MANAGER_skGoodsLists);
List<KillGoodsList> killGoodsLists = JsonUtil.parseResponseToPageBean(skGoodsListsRes, KillGoodsList.class);
for (KillGoodsList killGoodsList : killGoodsLists){
long id = killGoodsList.getId();
Assert.assertNotEquals(id, skGoodsId, network.message(skGoodsListsPar, BasicConfig.MANAGER_skGoodsLists, "被删除商品id仍存在于列表", skGoodsListsRes.body().asString()));
}
}
}
......@@ -32,8 +32,6 @@ public class SaveLive implements Authorization {
public long welfareConfId;
private Integer taskId;
public List<RedList> redId;
private long newSecKillId; // 新增秒杀id
private final long secKillGoodsId = 115; // 用来配置轮次的秒杀商品ID
@BeforeClass
public void setUp() {
......@@ -2325,97 +2323,6 @@ 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 = 124)
public void 添加秒杀互动() {
Map<String, Object> secKillAddPar = new HashMap<>();
secKillAddPar.put("goodsId", secKillGoodsId);
secKillAddPar.put("goodsAmount", 1); // 1 == 0.01
secKillAddPar.put("interactNum", 3);
secKillAddPar.put("ableAgent", 0); // 代理人不可参与
secKillAddPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response secKillAddRes = network.postResponse(secKillAddPar, BasicConfig.MANAGER_secondKillSave);
try{
boolean data = secKillAddRes.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(secKillAddPar, BasicConfig.MANAGER_secondKillSave, "添加秒杀互动失败", secKillAddRes.body().asString()));
}catch (NullPointerException e){
System.out.println(secKillAddRes.body().asString());
e.printStackTrace();
Assert.fail(network.message(secKillAddPar, BasicConfig.MANAGER_secondKillSave, "获取数据失败", secKillAddRes.body().asString()));
}
}
@Test(description = "获取秒杀轮次列表", priority = 125)
public void 获取秒杀轮次列表() {
Map<String, Object> liveSecKillPar = new HashMap<>();
liveSecKillPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response liveSecKillRes = network.getResponse(liveSecKillPar, BasicConfig.MANAGER_secondKillLists);
List<SecondKillList> secondKillLists;
try {
secondKillLists = JsonUtil.parseResponseToListBean(liveSecKillRes, SecondKillList.class);
}catch (Exception e){
System.out.println(liveSecKillRes.body().asString());
e.printStackTrace();
return;
}
SecondKillList secondKillList = secondKillLists.get(0);
long goodsId = secondKillList.getGoodsId();
Assert.assertEquals(goodsId, secKillGoodsId, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品id与实际添加的不符", liveSecKillRes.body().asString()));
int goodsAmount = secondKillList.getGoodsAmount();
Assert.assertEquals(goodsAmount, 1, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品价格与实际添加的不符", liveSecKillRes.body().asString()));
String goodsTitle = secondKillList.getGoodsTitle();
Assert.assertEquals(goodsTitle, "自动化专用商品", network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品名称与实际添加的不符", liveSecKillRes.body().asString()));
int interactNum = secondKillList.getInteractNum();
Assert.assertEquals(interactNum, 3, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品数量与实际添加的不符", liveSecKillRes.body().asString()));
int surplusNum = secondKillList.getSurplusNum();
Assert.assertEquals(surplusNum, 3, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品剩余数量与实际不符", liveSecKillRes.body().asString()));
int ableAgent = secondKillList.getAbleAgent();
Assert.assertEquals(ableAgent, 0, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "代理人参与限制与实际添加的不符", liveSecKillRes.body().asString()));
newSecKillId = secondKillList.getId();
}
@Test(description = "编辑秒杀轮次", priority = 126)
public void 编辑秒杀轮次() {
Map<String, Object> secKillUpdatePar = new HashMap<>();
secKillUpdatePar.put("goodsId", secKillGoodsId);
secKillUpdatePar.put("goodsAmount", 0.01);
secKillUpdatePar.put("interactNum", 1);
secKillUpdatePar.put("id", newSecKillId);
secKillUpdatePar.put("ableAgent", 0);
Response secKillUpdateRes = network.postResponse(secKillUpdatePar, BasicConfig.MANAGER_secondKillUpdate);
try{
boolean data = secKillUpdateRes.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(secKillUpdatePar, BasicConfig.MANAGER_secondKillUpdate, "编辑秒杀轮次失败", secKillUpdateRes.body().asString()));
}catch (NullPointerException e){
System.out.println(secKillUpdateRes.body().asString());
e.printStackTrace();
}
}
@Test(description = "删除秒杀轮次", priority = 127)
public void 删除秒杀轮次() {
Map<String, Object> secKillDelPar = new HashMap<>();
secKillDelPar.put("id", newSecKillId);
Response secKillDelRes = network.postResponse(secKillDelPar, BasicConfig.MANAGER_secondKillDel);
boolean data = secKillDelRes.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(secKillDelPar, BasicConfig.MANAGER_secondKillDel, "删除轮次失败", secKillDelRes.body().asString()));
Map<String, Object> liveSecKillPar = new HashMap<>();
liveSecKillPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response liveSecKillRes = network.getResponse(liveSecKillPar, BasicConfig.MANAGER_secondKillLists);
List<SecondKillList> secondKillLists = null;
try{
secondKillLists = JsonUtil.parseResponseToListBean(liveSecKillRes, SecondKillList.class);
}catch (NullPointerException e){
e.printStackTrace();
}
for (SecondKillList secondKillList : secondKillLists){
Assert.assertNotEquals(newSecKillId, secondKillList.getId(), network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "被删除的轮次id还存在", liveSecKillRes.body().asString()));
}
}
/**
* 亲友抽奖券配置
......
package com.kjj.cases.live.secondKill;
import com.kjj.bean.secondKill.KillGoodsList;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.utils.BaseUtils;
import com.kjj.utils.JsonUtil;
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;
public class ManagerConfGoods implements Authorization {
private final long companyId = 101;
private final String killGoodsImg = "https://yun.dui88.com/kjy/image/20210818/1629269441692.jpeg";
private final String killGoodsHeadImg = "https://yun.dui88.com/kjy/image/20210818/1629269453038.jpeg";
private final String killGoodsPicture = "https://yun.dui88.com/kjy/image/20210818/1629269488947.jpeg";
private final String newGoodsTitle = "秒杀商品1";
private long skGoodsId; // 秒杀商品id
public final static String skGoodsTitle = "编辑秒杀商品"; //秒杀商品名称
@BeforeClass
public void setUp(){
BaseUtils.ssoLogin();
}
/**
* 管理后台公司纬度配置秒杀商品
*/
@Test(description = "添加秒杀商品", priority = 2)
public void 添加秒杀商品() {
List<String> killGoodsHeadImgs = new ArrayList<>();
List<String> killGoodsPictures = new ArrayList<>();
killGoodsHeadImgs.add(killGoodsHeadImg);
killGoodsPictures.add(killGoodsPicture);
Map<String, Object> killGoodsPar = new HashMap<>();
killGoodsPar.put("goodsImg", killGoodsImg);
killGoodsPar.put("goodsHeadImg", killGoodsHeadImgs);
killGoodsPar.put("goodsPictures", killGoodsPictures);
killGoodsPar.put("companyId", companyId);
killGoodsPar.put("goodsTitle", newGoodsTitle);
killGoodsPar.put("goodsExplain", "文字说明");
Response killGoodsRes = network.postResponse(killGoodsPar, BasicConfig.MANAGER_skGoodsSaveOrUpdate);
try {
boolean data = killGoodsRes.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(killGoodsPar, BasicConfig.MANAGER_skGoodsSaveOrUpdate, "添加秒杀商品失败", killGoodsRes.body().asString()));
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(killGoodsPar, BasicConfig.MANAGER_skGoodsSaveOrUpdate, "获取数据失败", killGoodsRes.body().asString()));
}
}
@Test(description = "获取秒杀商品列表", priority = 3)
public void 获取秒杀商品列表() {
Map<String, Object> skGoodsListsPar = new HashMap<>();
skGoodsListsPar.put("companyId", companyId); // 默认pageSize=20,pageNo=1
Response skGoodsListsRes = network.getResponse(skGoodsListsPar, BasicConfig.MANAGER_skGoodsLists);
try {
List<KillGoodsList> killGoodsLists = JsonUtil.parseResponseToPageBean(skGoodsListsRes, KillGoodsList.class);
KillGoodsList killGoodsList = killGoodsLists.get(0);
String goodsTitle = killGoodsList.getGoodsTitle();
Assert.assertEquals(goodsTitle, newGoodsTitle, network.message(skGoodsListsPar, BasicConfig.MANAGER_skGoodsLists, "列表首个商品信息与实际不符", skGoodsListsRes.body().asString()));
skGoodsId = killGoodsList.getId();
}catch (Exception e){
e.printStackTrace();
Assert.fail(network.message(skGoodsListsPar, BasicConfig.MANAGER_skGoodsSaveOrUpdate, "获取数据失败", skGoodsListsRes.body().asString()));
}
}
@Test(description = "获取商品详情", priority = 4)
public void 获取商品详情() {
Map<String, Object> skGoodsDetailPar = new HashMap<>();
skGoodsDetailPar.put("id", skGoodsId);
Response skGoodsDetailRes = network.getResponse(skGoodsDetailPar, BasicConfig.MANAGER_skGoodsDetail);
long id = skGoodsDetailRes.jsonPath().getLong("data.companyId");
String goodsTitle = skGoodsDetailRes.jsonPath().getString("data.goodsTitle");
Assert.assertEquals(goodsTitle, newGoodsTitle, network.message(skGoodsDetailPar, BasicConfig.MANAGER_skGoodsDetail, "获取商品标题错误", skGoodsDetailRes.body().asString()));
Assert.assertEquals(id, companyId, network.message(skGoodsDetailPar, BasicConfig.MANAGER_skGoodsDetail, "获取商品所属公司id错误", skGoodsDetailRes.body().asString()));
}
@Test(description = "编辑秒杀商品", priority = 5)
public void 编辑秒杀商品() {
List<String> killGoodsHeadImgs = new ArrayList<>();
List<String> killGoodsPictures = new ArrayList<>();
killGoodsHeadImgs.add(killGoodsHeadImg);
killGoodsPictures.add(killGoodsPicture);
Map<String, Object> killGoodsPar = new HashMap<>();
killGoodsPar.put("id", skGoodsId);
killGoodsPar.put("goodsImg", killGoodsImg);
killGoodsPar.put("goodsHeadImg", killGoodsHeadImgs);
killGoodsPar.put("goodsPictures", killGoodsPictures);
killGoodsPar.put("companyId", companyId);
killGoodsPar.put("goodsTitle", skGoodsTitle);
killGoodsPar.put("goodsExplain", "文字说明");
Response killGoodsRes = network.postResponse(killGoodsPar, BasicConfig.MANAGER_skGoodsSaveOrUpdate);
try {
boolean data = killGoodsRes.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(killGoodsPar, BasicConfig.MANAGER_skGoodsSaveOrUpdate, "编辑秒杀商品失败", killGoodsRes.body().asString()));
Map<String, Object> skGoodsDetailPar = new HashMap<>();
skGoodsDetailPar.put("id", skGoodsId);
Response skGoodsDetailRes = network.getResponse(skGoodsDetailPar, BasicConfig.MANAGER_skGoodsDetail);
String goodsTitle = skGoodsDetailRes.jsonPath().getString("data.goodsTitle");
Assert.assertEquals(goodsTitle, skGoodsTitle, network.message(skGoodsDetailPar, BasicConfig.MANAGER_skGoodsDetail, "商品名称未更新", skGoodsDetailRes.body().asString()));
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(killGoodsPar, BasicConfig.MANAGER_skGoodsSaveOrUpdate, "获取数据失败", killGoodsRes.body().asString()));
}
}
@Test(description = "删除秒杀商品", priority = 6)
public void 删除秒杀商品() {
Map<String, Object> skGoodsDelPar = new HashMap<>();
skGoodsDelPar.put("id", skGoodsId);
Response skGoodsDelRes = network.postResponse(skGoodsDelPar, BasicConfig.MANAGER_skGoodsDelete);
try {
boolean data = skGoodsDelRes.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(skGoodsDelPar, BasicConfig.MANAGER_skGoodsDelete, "删除商品失败", skGoodsDelRes.body().asString()));
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(skGoodsDelPar, BasicConfig.MANAGER_skGoodsSaveOrUpdate, "获取数据失败", skGoodsDelRes.body().asString()));
}
// 检查列表中是否还存在被删除的商品
Map<String, Object> skGoodsListsPar = new HashMap<>();
skGoodsListsPar.put("companyId", companyId);
Response skGoodsListsRes = null;
long totalCount = 0;
try {
skGoodsListsRes = network.getResponse(skGoodsListsPar, BasicConfig.MANAGER_skGoodsLists);
totalCount = skGoodsListsRes.jsonPath().getLong("data.totalCount");
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(skGoodsListsPar, BasicConfig.MANAGER_skGoodsSaveOrUpdate, "获取数据失败", skGoodsListsRes.body().asString()));
}
skGoodsListsPar.put("pageSize", totalCount);
skGoodsListsPar.put("pageNo", 1);
skGoodsListsRes = network.getResponse(skGoodsListsPar, BasicConfig.MANAGER_skGoodsLists);
List<KillGoodsList> killGoodsLists = JsonUtil.parseResponseToPageBean(skGoodsListsRes, KillGoodsList.class);
for (KillGoodsList killGoodsList : killGoodsLists){
long id = killGoodsList.getId();
Assert.assertNotEquals(id, skGoodsId, network.message(skGoodsListsPar, BasicConfig.MANAGER_skGoodsLists, "被删除商品依然存在于列表", skGoodsListsRes.body().asString()));
}
}
}
This diff is collapsed.
......@@ -1055,6 +1055,19 @@ public class Treasure implements Authorization {
}
/**
* 添加代理人绑定关系
*/
@Test(description = "代理人绑定", priority = 70)
public void 代理人绑定() {
agentAuth();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
......
......@@ -139,6 +139,19 @@ public class BasicConfig {
public static final String MANAGER_secondKillLists = MANAGER_HOST + "/kjy/manager/live/second/kill/goods/list";
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 ANCHOR_secondKillSave = MOBILE_HOST + "/conf/live/second/kill/goods/save";
public static final String ANCHOR_secondKillLists = MOBILE_HOST + "/conf/live/second/kill/goods/list";
public static final String ANCHOR_secondKillUpdate = MOBILE_HOST + "/conf/live/second/kill/goods/update";
public static final String ANCHOR_skGoodsLists = MOBILE_HOST + "/conf/live/second/kill/goods/goodsList";
public static final String MOBILE_secondKill_getGoodsList = MOBILE_HOST + "/clue/goods/list";
public static final String MOBILE_secondKill_getGoodsDetail = MOBILE_HOST + "/clue/goods/detail";
public static final String ANCHOR_secondKillOn = MOBILE_HOST + "/conf/live/second/kill/goods/on";
public static final String ANCHOR_secondKillOff = MOBILE_HOST + "/conf/live/second/kill/goods/off";
public static final String MOBILE_secondKill_goodsFirst = MOBILE_HOST + "/clue/goods/first";
public static final String MOBILE_secondKill_downgradeGoodsFirst = MOBILE_HOST + "/clue/downgrade/goods";
public static final String MOBILE_secondKill_goodsOrder = MOBILE_HOST + "/clue/goods/order";
public static final String MOBILE_secondKill_goodsOrderResult = MOBILE_HOST + "/clue/goods/order/result";
public static final String MOBILE_secondKill_killGoods = MOBILE_HOST + "/clue/goods/killGoods";
//客户承诺话术配置
public static final String MANAGER_saveDialogue = MANAGER_HOST + "/kjy/manager/live/potential/saveDialogue";
......@@ -1094,4 +1107,5 @@ public class BasicConfig {
public static final String MANAGER_exclusiveItemPage = MANAGER_HOST + "/kjy/manager/exclusiveItem/page";
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";
}
......@@ -62,5 +62,19 @@ public class IdMakeUtil implements Authorization {
return encodeId;
}
public static long managerDecodeingId(String code) {
BaseUtils.ssoLogin();
Map<String, Object> decodePar = new HashMap<>();
decodePar.put("code", code);
Response decodeRes = network.getResponse(decodePar, BasicConfig.MANAGER_ID_DECODE);
long decodeId = 0;
try {
decodeId = decodeRes.jsonPath().getLong("data");
}catch (NullPointerException e){
e.printStackTrace();
}
return decodeId;
}
}
......@@ -7,6 +7,11 @@
<class name="com.kjj.cases.live.liveConfig.LiveMaterial"/>
</classes>
</test>
<test preserve-order="true" name="配置秒杀商品">
<classes>
<class name="com.kjj.cases.live.secondKill.ManagerConfGoods"/>
</classes>
</test>
<test preserve-order="true" name="团队管理">
<classes>
<class name="com.kjj.cases.live.liveConfig.Team"/>
......@@ -24,6 +29,12 @@
<class name="com.kjj.cases.live.liveConfig.SaveLive"/>
</classes>
</test>
<test preserve-order="true" name="配置秒杀轮次">
<classes>
<class name="com.kjj.cases.live.secondKill.ConfSecondKill"/>
</classes>
</test>
<test preserve-order="true" name="成功案例">
<classes>
<class name="com.kjj.cases.live.liveConfig.LiveCase"/>
......@@ -60,13 +71,11 @@
<class name="com.kjj.cases.live.preview.Preview"/>
</classes>
</test>
<test preserve-order="false" name="翻牌集字红包">
<classes>
<class name="com.kjj.cases.live.flipCard.FlipCard"/>
</classes>
</test>
<test preserve-order="true" name="中奖规则配置">
<classes>
<class name="com.kjj.cases.live.liveConfig.WinningRules"/>
......@@ -79,13 +88,13 @@
<class name="com.kjj.cases.live.lottery.DesignatedWinner"/>
</classes>
</test>
<test preserve-order="true" name="亲友券">
<classes>
<class name="com.kjj.cases.live.lottery.RelativeLottery"/>
</classes>
</test>
<test preserve-order="true" name="直播前-我的客户页">
<classes>
<class name="com.kjj.cases.live.agent.LiveBefore"/>
......@@ -116,6 +125,11 @@
<class name="com.kjj.cases.live.lottery.Lottery"/>
</classes>
</test>
<test preserve-order="true" name="秒杀互动">
<classes>
<class name="com.kjj.cases.live.secondKill.SecondKill"/>
</classes>
</test>
<test preserve-order="true" name="猜数字红包">
<classes>
......
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