Commit ac4118c7 authored by 郭姣's avatar 郭姣

Merge branch 'master' into gifeature/20210924-gj

# Conflicts:
#	src/test/liveTestNG.xml
parents b8f87874 5889baec
......@@ -17,6 +17,4 @@ public class TreasureAward {
private Integer winLimitCount;
private Integer isLimit;
}
......@@ -392,7 +392,7 @@ public class HomePage implements Authorization {
params.put("pageNo",1);
params.put("pageSize",20);
Response listRes = network.getResponse(params,MANAGER_exclusiveItemPage);
Object id = listRes.jsonPath().getJsonObject("data.list.get(1).id");
Object id = listRes.jsonPath().getJsonObject("data.list.get(0).id");
String desc = listRes.jsonPath().getString("desc");
Assert.assertEquals(desc,"OK",network.message(params,MANAGER_exclusiveItemPage,"获取id失败",listRes.body().asString()));
......@@ -795,6 +795,7 @@ public class HomePage implements Authorization {
//获取用户信息
Map<String, Object> params = new HashMap<String, Object>();
Response response = network.getResponse(USER_INFO);
System.out.println(response.body().asString());
userId = response.jsonPath().getInt("data.userId");
Assert.assertNotNull(response.jsonPath().getJsonObject("data"),network.message(USER_INFO,"获取用户信息失败",response.body().asString()));
......
......@@ -103,13 +103,8 @@ public class Pay implements Authorization {
System.out.println(response.body().asString());
int data = response.jsonPath().getInt("data");
Assert.assertTrue(data==5,network.message(statusParams, PAY_status,"取消支付:订单状态不对",response.body().asString()));
}
@Test (description = "默认付费_切换会员类型为保险版",priority = 4)
public void 默认付费_切换为保险版会员类型(){
//会员类型版本判断
......@@ -139,7 +134,7 @@ public class Pay implements Authorization {
Response response = network.getResponse(PAY_isRenewCondition);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertFalse(data,network.message(PAY_isRenewCondition,"不满足续费条件",response.body().asString()));
Assert.assertTrue(data,network.message(PAY_isRenewCondition,"用户不满足续费条件",response.body().asString()));
}
......@@ -176,8 +171,6 @@ public class Pay implements Authorization {
codeListParam.put("pageSize",20);
response =network.getResponse(codeListParam,MANAGER_codeList);
promotionCode=response.jsonPath().getString("data.list[0].promotionCode");
}
......
......@@ -3,6 +3,7 @@ package com.kjj.cases.live.agent;
import com.kjj.bean.agent.GrabWelfares;
import com.kjj.bean.agent.LiveUserList;
import com.kjj.cases.admin.Authorization;
import com.kjj.cases.live.liveConfig.LiveMaterial;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.IdMakeUtil;
......@@ -13,10 +14,13 @@ import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.kjj.utils.BaseUtils.ssoLogin;
public class LiveLater implements Authorization {
public String pageSize;
public List<LiveUserList> liveUserId;
......@@ -368,4 +372,23 @@ public class LiveLater implements Authorization {
int potentialNum = response.jsonPath().getInt("data.potentialNum");
Assert.assertTrue(potentialNum > 0,network.message(params,BasicConfig.MOBILE_potentialNum,"准客户数量错误",response.body().asString()));
}
@Test(description = "删除权益", priority = 21)
public void 删除权益() {
ssoLogin();
for (int resourceId : Arrays.asList(LiveMaterial.resourceId, LiveMaterial.termResourceId, LiveMaterial.freeResourceId, LiveMaterial.picResourceId)){
System.out.println(resourceId);
Map<String, Object> delResourceParam = new HashMap<>();
delResourceParam.put("id", resourceId);
Response delResourceRes = network.postResponse(delResourceParam, BasicConfig.MANAGER_delResource);
try {
boolean data = delResourceRes.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(delResourceParam, BasicConfig.MANAGER_delResource, "删除权益失败", delResourceRes.body().asString()));
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(delResourceParam, BasicConfig.MANAGER_delResource, "获取数据失败", delResourceRes.body().asString()));
}
}
}
}
......@@ -509,6 +509,4 @@ public class Reward implements Authorization {
}
}
......@@ -16,45 +16,23 @@ import java.util.Map;
public class CloseLive implements Authorization {
@BeforeClass
public void setUp() {
adminAuth();
}
@Test(description = "结束直播", priority = 1)
public void closeLive() {
Map<String, Object> closeParam = new HashMap<>();
closeParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
closeParam.put("cid", 101);
Response closeRes = network.postResponse(closeParam, BasicConfig.ANCHOR_CLOSE);
Object data = closeRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(closeParam, BasicConfig.ANCHOR_CLOSE, "结束直播失败", closeRes.body().asString()));
}
@Test(description = "删除权益", priority = 2)
public void 删除权益() {
for (int resourceId : Arrays.asList(LiveMaterial.resourceId, LiveMaterial.termResourceId, LiveMaterial.freeResourceId, LiveMaterial.picResourceId)){
System.out.println(resourceId);
Map<String, Object> delResourceParam = new HashMap<>();
delResourceParam.put("id", resourceId);
Response delResourceRes = network.postResponse(delResourceParam, BasicConfig.MANAGER_delResource);
try {
boolean data = delResourceRes.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(delResourceParam, BasicConfig.MANAGER_delResource, "删除权益失败", delResourceRes.body().asString()));
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(delResourceParam, BasicConfig.MANAGER_delResource, "获取数据失败", delResourceRes.body().asString()));
}
}
}
@BeforeClass
public void setUp() {
adminAuth();
}
@Test(description = "结束直播", priority = 1)
public void closeLive() {
Map<String, Object> closeParam = new HashMap<>();
closeParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
closeParam.put("cid", 101);
Response closeRes = network.postResponse(closeParam, BasicConfig.ANCHOR_CLOSE);
Object data = closeRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(closeParam, BasicConfig.ANCHOR_CLOSE, "结束直播失败", closeRes.body().asString()));
}
}
......@@ -59,28 +59,11 @@ public class SimpleLiveConfig implements Authorization {
Params.put("shareContent", "自动化直播 #{shortLink}");
Params.put("shelfStatus", 2);
Params.put("secondPoster", "https://streamimg.kjjcrm.com/kjy/image/20210201/cc999ebde48e49f99ac3f0d93480453f.jpg");
Params.put("regionType",2);
Params.put("regionType",1);
Params.put("preAwardUrl","https://yun.dui88.com/kjy/image/20210629/1624949155842.png");
Params.put("preWindowUrl","https://yun.dui88.com/kjy/image/20210629/1624949098093.png");
Params.put("distributionType", 0);
Params.put("distributionType", 1);
Params.put("existSeriesPoster", 0);
List<ProvinceCityCodeList> provinceCityCode = new ArrayList<>();
ProvinceCityCodeList save = new ProvinceCityCodeList();
save.setProvinceCode(110000);
save.setCityCode(null);
provinceCityCode.add(save);
ProvinceCityCodeList save1 = new ProvinceCityCodeList();
save1.setProvinceCode(420000);
save1.setCityCode(420900);
provinceCityCode.add(save1);
ProvinceCityCodeList save2 = new ProvinceCityCodeList();
save2.setProvinceCode(330000);
save2.setCityCode(330100);
provinceCityCode.add(save2);
Params.put("provinceCityCodeList", provinceCityCode);
Response response = network.postResponse(Params, BasicConfig.MANAGER_saveAndUpdate_0);
liveID = response.jsonPath().getString("data");
EncodeLiveID = IdMakeUtil.encodingId(Long.valueOf(liveID));
......@@ -148,4 +131,21 @@ public class SimpleLiveConfig implements Authorization {
System.out.println(response.body().asString());
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_saveAndUpdate_8, "产品资料配置失败", response.body().asString()));
}
/**
* 直播中奖品
*/
//直播中奖品配置
@Test(description = "直播中抽奖", priority = 9)
public void 直播中抽奖() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", liveID);
Params.put("interactNum", 1);
Params.put("showInteractNum", 1);
Params.put("welfareId", 191);
Params.put("afterMin", 20);
Response response = network.postResponse(Params, BasicConfig.MANAGER_add_1);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_add_1, "直播中抽奖配置失败", response.body().asString()));
}
}
package com.kjj.cases.live.treasure;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.kjj.bean.manager.TreasureAward;
import com.kjj.bean.manager.TreasureCode;
import com.kjj.bean.manager.TreasureRed;
import com.kjj.bean.manager.WelfareList;
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.utils.BaseUtils.ssoLogin;
import static com.kjj.utils.ThreadSleepUtils.sleep;
public class GoldenEgg implements Authorization {
@BeforeClass
public void setUp() { ssoLogin(); }
public String ConfId;
public String shareSign;
public JSONObject treasureConf;
public String interactConfId;
/**
* 添加代理人绑定关系
*/
@Test(description = "代理人绑定", priority = 1)
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);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
/**
* 裂变宝箱配置
*/
public List<WelfareList> id;
@Test(description = "代理人A分享直播间", priority = 2)
public void 代理人A分享直播间() {
agentAuth();
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType",1);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_sign);
String data = signRes.jsonPath().getString("data");
this.shareSign = data;
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "代理人A与访客A邀请关系绑定", priority = 3)
public void 代理人A与访客A邀请关系绑定() {
visitorAuth();
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, BasicConfig.MOBILE_binding);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客A获取绑定结果和绑定凭证", priority = 4)
public void 访客A获取绑定结果和绑定凭证() {
visitorAuth();
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);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "查询配置奖品列表", priority = 5)
public void 查询配置奖品列表() {
Map<String, Object> getListParam = new HashMap<>();
getListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
getListParam.put("companyId", 101);
getListParam.put("pageIndex", 1);
getListParam.put("pageSize", 20);
getListParam.put("welfareType", 6);
Response response = network.getResponse(getListParam, BasicConfig.MANAGER_getList4Admin);
System.out.println(response.body().asString());
List<WelfareList> list = JsonUtil.parseResponseToPageBean(response, WelfareList.class);
this.id = list;
Assert.assertNotNull(list, network.message(getListParam, BasicConfig.MANAGER_getList4Admin, "查询奖品列表失败", response.body().asString()));
}
@Test(description = "创建砸金蛋配置", priority = 6)
public void 创建砸金蛋配置() {
Map<String, Object> saveParam = new HashMap<>();
saveParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
saveParam.put("openCondition", 1);
saveParam.put("treasureConfId", null);
TreasureAward treasureAward = new TreasureAward();
treasureAward.setWelfareId(id.get(0).getId());
treasureAward.setAwardName("砸金蛋实物奖品");
treasureAward.setTreasureProbability(10000);
treasureAward.setTreasureType(3);
treasureAward.setRuleType(1);
treasureAward.setTotalNum(1);
treasureAward.setWinLimitCount(1);
saveParam.put("treasureAward", treasureAward);
TreasureRed treasureRed = new TreasureRed();
treasureRed.setRedTotalAmount(100);
treasureRed.setFixedNum(100);
treasureRed.setRuleType(1);
treasureRed.setTotalNum(1);
treasureRed.setTreasureProbability(0);
treasureRed.setTreasureType(2);
saveParam.put("treasureRed", treasureRed);
TreasureCode treasureCode = new TreasureCode();
treasureCode.setFixedNum(5);
treasureCode.setRuleType(1);
treasureCode.setTreasureProbability(0);
treasureCode.setTreasureType(1);
saveParam.put("treasureCode", treasureCode);
saveParam.put("treasurePeriod", 1);
Response response = network.postResponse(saveParam, BasicConfig.MANAGER_goldenEgg_saveOrUpdate);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(saveParam, BasicConfig.MANAGER_goldenEgg_saveOrUpdate, "新增砸金蛋配置失败", response.body().asString()));
}
@Test(description = "查询砸金蛋配置详情", priority = 7)
public void 查询砸金蛋配置详情() {
Map<String, Object> confDetailParam = new HashMap<>();
confDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail);
System.out.println(response.body().asString());
Integer openCondition = response.jsonPath().getInt("data.openCondition");
Assert.assertTrue(openCondition > 0, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "查询砸金蛋配置详情失败", response.body().asString()));
treasureConf = JSON.parseObject(JSON.toJSONString(response.jsonPath().get("data")));
}
@Test(description = "开启砸金蛋配置", priority = 8)
public void 开启砸金蛋配置() {
Map<String, Object> switchStatusParam = new HashMap<>();
switchStatusParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
switchStatusParam.put("confStatus", 1);
Response response = network.postResponse(switchStatusParam, BasicConfig.MANAGER_goldenEgg_switchStatus);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(data, network.message(switchStatusParam, BasicConfig.MANAGER_goldenEgg_switchStatus, "开启砸金蛋失败", response.body().asString()));
}
@Test(description = "查询砸金蛋配置状态", priority = 9)
public void 查询宝箱配置状态() {
Map<String, Object> statusParam = new HashMap<>();
statusParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(statusParam, BasicConfig.MANAGER_getConfDetail);
System.out.println(response.body().asString());
boolean goldenEggTreasureConfStatus =response.jsonPath().getBoolean("data.goldenEggTreasureConfStatus");
boolean goldenEggTreasureConfBuildStatus =response.jsonPath().getBoolean("data.goldenEggTreasureConfBuildStatus");
Assert.assertTrue(goldenEggTreasureConfStatus, network.message(statusParam, BasicConfig.MANAGER_getConfDetail, "砸金蛋未配置", response.body().asString()));
Assert.assertTrue(goldenEggTreasureConfBuildStatus, network.message(statusParam, BasicConfig.MANAGER_getConfDetail, "砸金蛋未开启", response.body().asString()));
}
@Test(description = "查询砸金蛋配置数据", priority = 10)
public void 查询砸金蛋配置数据() {
visitorAuth();
Map<String, Object> getLiveAwardListParam = new HashMap<>();
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(getLiveAwardListParam, BasicConfig.MOBILE_allLottery);
System.out.println(response.body().asString());
try{
int on = response.jsonPath().getInt("data.on");
String confStr = Integer.toBinaryString(on);
char confStatus = confStr.charAt(confStr.length()-4);
Assert.assertEquals(confStatus, '1',network.message(getLiveAwardListParam, BasicConfig.MOBILE_allLottery, "砸金蛋开关未开启", response.body().asString()));
}catch (Exception e){
e.printStackTrace();
Assert.fail(network.message(getLiveAwardListParam, BasicConfig.MANAGER_skGoodsSwitchDetail, "砸金蛋开关未开启", response.body().asString()));
}
}
@Test(description = "查询直播前砸金蛋配置详情", priority = 11)
public void 查询直播前砸金蛋配置详情() {
sleep(2000);
Map<String, Object> detailParam = new HashMap<>();
detailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(detailParam, BasicConfig.MOBILE_goldenEgg_detail);
System.out.println(response.body().asString());
HashMap data =response.jsonPath().getJsonObject("data");
this.ConfId=(String) data.get("treasureConfId");
Assert.assertNotNull(ConfId, network.message(detailParam, BasicConfig.MOBILE_goldenEgg_detail, "查询砸金蛋配置详情失败", response.body().asString()));
}
@Test(description = "获取跑马灯数据", priority = 12)
public void 获取跑马灯数据() {
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("pageSize",10);
Response response = network.getResponse(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_list);
System.out.println(response.body().asString());
int size =response.jsonPath().getInt("data.size()");
Assert.assertTrue(size>0, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_list, "砸金蛋失败", response.body().asString()));
}
@Test(description = "代理人A与访客A邀请关系绑定", priority = 13)
public void 代理人A与访客G邀请关系绑定() {
visitorAuth7();
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, BasicConfig.MOBILE_binding);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客A获取绑定结果和绑定凭证", priority = 14)
public void 访客G获取绑定结果和绑定凭证() {
visitorAuth7();
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);
System.out.println(tokenRes.body().asString());
Integer type = tokenRes.jsonPath().getInt("data.type");
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "黑名单用户仅不可砸中实物", priority = 15)
public void 黑名单用户仅不可砸中实物() {
visitorAuth7();
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
chooseAwardParam.put("treasureConfId",ConfId);
Response response = network.postResponse(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString()));
sleep(2000);
Map<String, Object> param = new HashMap<>();
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
}
@Test(description = "第1个访客A砸金蛋砸出实物", priority = 16)
public void 1个访客A砸金蛋砸出实物() {
visitorAuth();
sleep(2000);
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
chooseAwardParam.put("treasureConfId",ConfId);
Response response = network.postResponse(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString()));
sleep(2000);
Map<String, Object> param = new HashMap<>();
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus,5, network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 3,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
interactConfId = response.jsonPath().getString("data.award.interactConfId");
}
@Test(description = "代理人A与访客B邀请关系绑定", priority = 17)
public void 代理人A与访客B邀请关系绑定() {
visitorAuth7();
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, BasicConfig.MOBILE_binding);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客B获取绑定结果和绑定凭证", priority = 18)
public void 访客B获取绑定结果和绑定凭证() {
visitorAuth7();
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);
System.out.println(tokenRes.body().asString());
Integer type = tokenRes.jsonPath().getInt("data.type");
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "第2个访客B砸金蛋砸出抽奖码", priority = 19)
public void 2个访客B砸金蛋砸出抽奖码() {
visitorAuth2();
sleep(2000);
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
chooseAwardParam.put("treasureConfId",ConfId);
Response response = network.postResponse(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString()));
sleep(2000);
Map<String, Object> param = new HashMap<>();
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus,5, network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList,0, network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
}
@Test(description = "增加实物奖品数量", priority = 20)
public void 增加实物奖品数量() {
JSONObject treasureAward = treasureConf.getJSONObject("treasureAward");
treasureAward.put("totalNum",2);//-1无限制,1限制1次
Response response = network.postResponse(treasureConf, BasicConfig.MANAGER_goldenEgg_saveOrUpdate);
System.out.println(treasureConf.toJSONString());
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(treasureConf, BasicConfig.MANAGER_goldenEgg_saveOrUpdate, "增加实物奖品数量失败", response.body().asString()));
}
@Test(description = "实物奖品增加后数量变化", priority = 21)
public void 实物奖品增加后数量变化() {
Map<String, Object> confDetailParam = new HashMap<>();
confDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail);
System.out.println(response.body().asString());
int totalNum = response.jsonPath().getInt("data.treasureAward.totalNum");
int receivingNum = response.jsonPath().getInt("data.treasureAward.receivingNum");
int receiveNum = response.jsonPath().getInt("data.treasureAward.receiveNum");
Assert.assertEquals(totalNum ,2, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品总数错误", response.body().asString()));
Assert.assertEquals(receivingNum ,1, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品进行中数量错误", response.body().asString()));
Assert.assertEquals(receiveNum ,0, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品已领取错误", response.body().asString()));
}
@Test(description = "代理人A与访客C邀请关系绑定", priority = 22)
public void 代理人A与访客C邀请关系绑定() {
visitorAuth3();
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, BasicConfig.MOBILE_binding);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客C获取绑定结果和绑定凭证", priority = 23)
public void 访客C获取绑定结果和绑定凭证() {
visitorAuth3();
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);
System.out.println(tokenRes.body().asString());
Integer type = tokenRes.jsonPath().getInt("data.type");
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "第3个访客C砸金蛋砸出实物", priority = 24)
public void 3个访客C砸金蛋砸出实物() {
visitorAuth3();
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
chooseAwardParam.put("treasureConfId",ConfId);
Response response = network.postResponse(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString()));
Map<String, Object> param = new HashMap<>();
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType,3, network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
}
@Test(description = "减少实物奖品数量", priority = 25)
public void 减少实物奖品数量() {
JSONObject treasureAward = treasureConf.getJSONObject("treasureAward");
treasureAward.put("totalNum",1);//-1无限制,1限制1次
Response response = network.postResponse(treasureConf, BasicConfig.MANAGER_goldenEgg_saveOrUpdate);
System.out.println(response.body().asString());
boolean success = response.jsonPath().getBoolean("success");
Assert.assertFalse(success, network.message(treasureConf, BasicConfig.MANAGER_goldenEgg_saveOrUpdate, "减少实物奖品数量成功", response.body().asString()));
}
@Test(description = "第3个访客C砸金蛋超时", priority = 26)
public void 3个访客C砸金蛋超时() {
visitorAuth3();
sleep(2000);
Map<String, Object> param = new HashMap<>();
param.put("treasureConfId",treasureConf.get("treasureConfId"));
Response response = network.getResponse(param, BasicConfig.MOBILE_oldenEggTimeOut);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.MOBILE_oldenEggTimeOut, "砸金蛋超时设置失败", response.body().asString()));
sleep(2000);
param.put("treasureConfId",ConfId);
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
response = network.postResponse(param, BasicConfig.MOBILE_goldenEgg_reset);
System.out.println(response.body().asString());
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.MOBILE_goldenEgg_reset, "砸金蛋超时重置失败", response.body().asString()));
}
@Test(description = "第3个访客C超时后重新砸蛋砸出实物奖品", priority = 27)
public void 3个访客C超时后重新砸蛋砸出实物奖品() {
visitorAuth3();
sleep(2000);
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
chooseAwardParam.put("treasureConfId",ConfId);
Response response = network.postResponse(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString()));
sleep(2000);
Map<String, Object> param = new HashMap<>();
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 3,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
}
@Test(description = "第3个访客C再次砸金蛋超时", priority = 28)
public void 3个访客C再次砸金蛋超时() {
visitorAuth3();
sleep(2000);
Map<String, Object> param = new HashMap<>();
param.put("treasureConfId",treasureConf.get("treasureConfId"));
Response response = network.getResponse(param, BasicConfig.MOBILE_oldenEggTimeOut);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.MOBILE_oldenEggTimeOut, "砸金蛋超时设置失败", response.body().asString()));
sleep(2000);
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
response = network.postResponse(param, BasicConfig.MOBILE_goldenEgg_reset);
System.out.println(response.body().asString());
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(treasureConf, BasicConfig.MOBILE_goldenEgg_reset, "砸金蛋超时重置失败", response.body().asString()));
}
@Test(description = "代理人A与访客D邀请关系绑定", priority = 29)
public void 代理人A与访客D邀请关系绑定() {
visitorAuth4();
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, BasicConfig.MOBILE_binding);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客D获取绑定结果和绑定凭证", priority = 30)
public void 访客D获取绑定结果和绑定凭证() {
visitorAuth4();
ThreadSleepUtils.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);
System.out.println(tokenRes.body().asString());
Integer type = tokenRes.jsonPath().getInt("data.type");
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "第3个用户再次超时后访客D砸蛋砸出实物奖品", priority = 31)
public void 3个用户再次超时后访客D砸蛋砸出实物奖品() {
visitorAuth4();
sleep(2000);
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
chooseAwardParam.put("treasureConfId",ConfId);
Response response = network.postResponse(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString()));
Map<String, Object> param = new HashMap<>();
sleep(2000);
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 3,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
}
@Test(description = "代理人A与访客E邀请关系绑定", priority = 32)
public void 代理人A与访客E邀请关系绑定() {
visitorAuth5();
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, BasicConfig.MOBILE_binding);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客E获取绑定结果和绑定凭证", priority = 33)
public void 访客E获取绑定结果和绑定凭证() {
visitorAuth5();
ThreadSleepUtils.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);
System.out.println(tokenRes.body().asString());
Integer type = tokenRes.jsonPath().getInt("data.type");
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "第5个用户E砸蛋砸出抽奖码", priority = 34)
public void 5个用户E砸蛋砸出抽奖码() {
visitorAuth5();
sleep(2000);
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
chooseAwardParam.put("treasureConfId",ConfId);
Response response = network.postResponse(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString()));
Map<String, Object> param = new HashMap<>();
sleep(2000);
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
}
@Test(description = "访客A获取分享加密串", priority = 35)
public void 访客A获取分享加密串() {
visitorAuth();
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 15);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_sign);
System.out.println(signRes.body().asString());
String data = signRes.jsonPath().getString("data");
this.shareSign = data;
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "访客E与访客A邀请关系绑定", priority = 36)
public void 访客F与访客A邀请关系绑定() {
visitorAuth6();
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, 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 = "访客E获取绑定结果和绑定凭证", priority = 37)
public void 访客F获取绑定结果和绑定凭证() {
visitorAuth6();
ThreadSleepUtils.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);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "修改实物奖品数量为无限制", priority = 38)
public void 修改实物奖品数量为无限制() {
JSONObject treasureAward = treasureConf.getJSONObject("treasureAward");
treasureAward.put("totalNum",-1);
treasureAward.put("ruleType",2);
Response response = network.postResponse(treasureConf, BasicConfig.MANAGER_goldenEgg_saveOrUpdate);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(treasureConf, BasicConfig.MANAGER_goldenEgg_saveOrUpdate, "修改实物奖品为无限制失败", response.body().asString()));
}
@Test(description = "第5个访客F砸蛋砸出实物奖品", priority = 39)
public void 5个访客F砸蛋砸出实物奖品() {
visitorAuth6();
sleep(5000);
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
chooseAwardParam.put("treasureConfId",ConfId);
Response response = network.postResponse(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString()));
sleep(2000);
Map<String, Object> param = new HashMap<>();
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 3,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
}
@Test(description = "修改红包概率为100%", priority = 40)
public void 修改红包概率为100() {
JSONObject treasureAward = treasureConf.getJSONObject("treasureAward");
JSONObject treasureRed = treasureConf.getJSONObject("treasureRed");
treasureAward.put("treasureProbability",0);
treasureRed.put("treasureProbability",10000);
Response response = network.postResponse(treasureConf, BasicConfig.MANAGER_goldenEgg_saveOrUpdate);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(treasureConf, BasicConfig.MANAGER_goldenEgg_saveOrUpdate, "修改红包概率失败", response.body().asString()));
}
@Test(description = "黑名单用户G砸金蛋超时", priority = 41)
public void 黑名单用户G砸金蛋超时() {
visitorAuth7();
Map<String, Object> param = new HashMap<>();
param.put("treasureConfId",treasureConf.get("treasureConfId"));
Response response = network.getResponse(param, BasicConfig.MOBILE_oldenEggTimeOut);
System.out.println(response.body().asString());
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.MOBILE_oldenEggTimeOut, "砸金蛋超时设置失败", response.body().asString()));
sleep(2000);
param.put("treasureConfId",ConfId);
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
response = network.postResponse(param, BasicConfig.MOBILE_goldenEgg_reset);
System.out.println(response.body().asString());
data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.MOBILE_goldenEgg_reset, "砸金蛋超时重置失败", response.body().asString()));
}
@Test(description = "黑名单用户G超时后仅能砸出抽奖码", priority = 42)
public void 黑名单用户G超时后仅能砸出抽奖码() {
visitorAuth7();
sleep(2000);
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
chooseAwardParam.put("treasureConfId",ConfId);
Response response = network.postResponse(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString()));
Map<String, Object> param = new HashMap<>();
sleep(2000);
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
}
@Test(description = "访客I与访客A邀请关系绑定", priority = 43)
public void 访客I与访客A邀请关系绑定() {
visitorAuth8();
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, 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 = "访客F获取绑定结果和绑定凭证", priority = 44)
public void 访客I获取绑定结果和绑定凭证() {
visitorAuth8();
ThreadSleepUtils.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);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "第6个访客F砸出红包", priority = 45)
public void 6个访客F砸出红包() {
visitorAuth8();
sleep(2000);
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
chooseAwardParam.put("treasureConfId",ConfId);
Response response = network.postResponse(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString()));
Map<String, Object> param = new HashMap<>();
sleep(2000);
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 2,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
}
@Test(description = "访客H与访客A邀请关系绑定", priority = 46)
public void 访客H与访客A邀请关系绑定() {
visitorAuth9();
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, 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 = "访客H获取绑定结果和绑定凭证", priority = 47)
public void 访客H获取绑定结果和绑定凭证() {
visitorAuth9();
ThreadSleepUtils.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);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "第7个访客H砸出抽奖码", priority = 48)
public void 7个访客H砸出抽奖码() {
visitorAuth9();
sleep(2000);
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
chooseAwardParam.put("treasureConfId",ConfId);
Response response = network.postResponse(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString()));
Map<String, Object> param = new HashMap<>();
sleep(2000);
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
}
@Test(description = "砸金蛋进行中数量变化", priority = 49)
public void 砸金蛋进行中数量变化() {
Map<String, Object> confDetailParam = new HashMap<>();
confDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail);
System.out.println(response.body().asString());
int totalNum = response.jsonPath().getInt("data.treasureAward.totalNum");
int receivingNum = response.jsonPath().getInt("data.treasureAward.receivingNum");
int receiveNum = response.jsonPath().getInt("data.treasureAward.receiveNum");
Assert.assertEquals(totalNum ,-1, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品总数错误", response.body().asString()));
Assert.assertEquals(receivingNum ,3, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品进行中数量错误", response.body().asString()));
Assert.assertEquals(receiveNum ,0, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品已领取错误", response.body().asString()));
totalNum = response.jsonPath().getInt("data.treasureRed.totalNum");
receivingNum = response.jsonPath().getInt("data.treasureRed.receivingNum");
receiveNum = response.jsonPath().getInt("data.treasureRed.receiveNum");
Assert.assertEquals(totalNum ,1, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品总数错误", response.body().asString()));
Assert.assertEquals(receivingNum ,1, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品进行中数量错误", response.body().asString()));
Assert.assertEquals(receiveNum ,0, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品已领取错误", response.body().asString()));
}
@Test(description = "用户B给用户A助力", priority = 50)
public void 用户B给用户A助力() {
visitorAuth2();
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("shareType",15);
Response response=network.getResponse(Params,BasicConfig.MOBILE_popupDetail);
System.out.println(response.body().asString());
Object degreePopup=response.jsonPath().getJsonObject("data.degreePopup");
Assert.assertNotNull(degreePopup,network.message(Params,BasicConfig.MOBILE_popupDetail,"授权及助力弹窗为空",response.body().asString()));
Params.clear();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("shareSign",shareSign);
Params.put("shareType",15);
Params.put("confId",ConfId);
response = network.postResponse(Params, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MOBILE_assist, "用户B给用户H助力失败", response.body().asString()));
}
@Test(description = "访客A实物兑奖成功", priority = 51)
public void 访客A实物兑奖成功() {
visitorAuth();
Map<String, Object> param = new HashMap<>();
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
Response response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus,2,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "实物兑奖失败", response.body().asString()));
Assert.assertEquals(helperList,1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "邀请头像数量错误", response.body().asString()));
}
@Test(description = "访客B获取分享加密串", priority = 52)
public void 访客B获取分享加密串() {
visitorAuth2();
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 15);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_sign);
String data = signRes.jsonPath().getString("data");
this.shareSign = data;
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "用户C给用户B助力", priority = 53)
public void 用户C给用户B助力() {
visitorAuth3();
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("shareType",15);
Response response=network.getResponse(Params,BasicConfig.MOBILE_popupDetail);
System.out.println(response.body().asString());
Object degreePopup=response.jsonPath().getJsonObject("data.degreePopup");
Assert.assertNotNull(degreePopup,network.message(Params,BasicConfig.MOBILE_popupDetail,"授权及助力弹窗为空",response.body().asString()));
Params.clear();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("shareSign",shareSign);
Params.put("shareType",15);
Params.put("confId",ConfId);
response = network.postResponse(Params, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MOBILE_assist, "用户B给用户H助力失败", response.body().asString()));
}
@Test(description = "访客B抽奖码兑奖成功", priority = 54)
public void 访客B抽奖码兑奖成功() {
visitorAuth2();
Map<String, Object> param = new HashMap<>();
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
Response response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus,2,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "实物兑奖失败", response.body().asString()));
Assert.assertEquals(helperList,1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "邀请头像数量错误", response.body().asString()));
}
@Test(description = "访客F获取分享加密串", priority = 55)
public void 访客F获取分享加密串() {
visitorAuth8();
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 15);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_sign);
String data = signRes.jsonPath().getString("data");
this.shareSign = data;
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "用户D给用户F助力", priority = 56)
public void 用户D给用户F助力() {
visitorAuth5();
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("shareType",15);
Response response=network.getResponse(Params,BasicConfig.MOBILE_popupDetail);
System.out.println(response.body().asString());
Object degreePopup=response.jsonPath().getJsonObject("data.degreePopup");
Assert.assertNotNull(degreePopup,network.message(Params,BasicConfig.MOBILE_popupDetail,"授权及助力弹窗为空",response.body().asString()));
Params.clear();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("shareSign",shareSign);
Params.put("shareType",15);
Params.put("confId",ConfId);
response = network.postResponse(Params, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MOBILE_assist, "用户B给用户H助力失败", response.body().asString()));
}
@Test(description = "访客F红包兑奖成功", priority = 57)
public void 访客F红包兑奖成功() {
visitorAuth8();
Map<String, Object> param = new HashMap<>();
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
Response response = network.getResponse(param, BasicConfig.MOBILE_goldenEgg_joinInfo);
System.out.println(response.body().asString());
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus,2,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "实物兑奖失败", response.body().asString()));
Assert.assertEquals(helperList,1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "邀请头像数量错误", response.body().asString()));
}
@Test(description = "砸金蛋已领取数量变化", priority = 58)
public void 砸金蛋已领取数量变化() {
Map<String, Object> confDetailParam = new HashMap<>();
confDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail);
System.out.println(response.body().asString());
int totalNum = response.jsonPath().getInt("data.treasureAward.totalNum");
int receivingNum = response.jsonPath().getInt("data.treasureAward.receivingNum");
int receiveNum = response.jsonPath().getInt("data.treasureAward.receiveNum");
Assert.assertEquals(totalNum ,-1, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品总数错误", response.body().asString()));
Assert.assertEquals(receivingNum ,2, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品进行中数量错误", response.body().asString()));
Assert.assertEquals(receiveNum ,1, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品已领取错误", response.body().asString()));
totalNum = response.jsonPath().getInt("data.treasureRed.totalNum");
receivingNum = response.jsonPath().getInt("data.treasureRed.receivingNum");
receiveNum = response.jsonPath().getInt("data.treasureRed.receiveNum");
Assert.assertEquals(totalNum ,1, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品总数错误", response.body().asString()));
Assert.assertEquals(receivingNum ,0, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品进行中数量错误", response.body().asString()));
Assert.assertEquals(receiveNum ,1, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品已领取错误", response.body().asString()));
}
@Test(description = "查询用户是否未提交收货地址", priority = 59)
public void 查询用户是否未提交收货地址() {
visitorAuth();
ThreadSleepUtils.sleep(1000);
Map<String, Object> locationResultParam = new HashMap<>();
locationResultParam.put("liveId", "Kj21NTE3Mjc");
locationResultParam.put("scene", 1);
Response locationResultRes = network.getResponse(locationResultParam, BasicConfig.USER_locationResult);
System.out.println(locationResultRes.body().asString());
Object winnerRegion = locationResultRes.jsonPath().getJsonObject("data.winnerRegion");
Assert.assertNull(winnerRegion, network.message(locationResultParam, BasicConfig.USER_locationResult, "查询用户是否提交收货地址失败", locationResultRes.body().asString()));
}
@Test(description = "提交收货地址", priority = 60)
public void 提交收货地址() {
visitorAuth();
ArrayList<String> region = new ArrayList<>();
region.add("浙江省");
region.add("杭州市");
region.add("西湖区");
Map<String, Object> submitInfoParam = new HashMap<>();
submitInfoParam.put("liveId", "Kj21NTE3Mjc");
submitInfoParam.put("confId", "Kj20NjIwNTY3");
submitInfoParam.put("winnerName", "中奖人");
submitInfoParam.put("region", region);
submitInfoParam.put("location", "西湖区数娱大厦");
submitInfoParam.put("phoneNum", "13498765432");
Response submitInfoRes = network.postResponse(submitInfoParam, BasicConfig.USER_submitInfo);
System.out.println(submitInfoRes.body().asString());
Boolean result = submitInfoRes.jsonPath().getBoolean("success");
Assert.assertTrue(result, network.message(submitInfoParam, BasicConfig.USER_submitInfo, "提交收货地址失败", submitInfoRes.body().asString()));
ThreadSleepUtils.sleep(3000);
}
@Test(description = "查询用户是否提交收货地址", priority = 61)
public void 查询用户是否提交收货地址() {
visitorAuth();
ThreadSleepUtils.sleep(1000);
Map<String, Object> locationResultParam = new HashMap<>();
locationResultParam.put("liveId", "Kj21NTE3Mjc");
locationResultParam.put("scene", 1);
Response locationResultRes = network.getResponse(locationResultParam, BasicConfig.USER_locationResult);
System.out.println(locationResultRes.body().asString());
Object winnerRegion = locationResultRes.jsonPath().getJsonObject("data.winnerRegion");
Assert.assertNotNull(winnerRegion, network.message(locationResultParam, BasicConfig.USER_locationResult, "查询用户是否提交收货地址失败", locationResultRes.body().asString()));
}
@Test(description = "获取直播配置详情", priority = 62)
public void 获取直播配置详情() {
adminAuth();
Map<String, Object> ConfDetailParam = new HashMap<>();
ConfDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response ConfDetailRes = network.getResponse(ConfDetailParam, BasicConfig.ANCHOR_getConfDetail);
Object data = ConfDetailRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(ConfDetailParam, BasicConfig.ANCHOR_getConfDetail, "获取直播配置详情失败", ConfDetailRes.body().asString()));
}
@Test(description = "开始直播", priority = 63)
public void 开启直播() {
Map<String, Object> openParam = new HashMap<>();
openParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
openParam.put("cid", 101);
Response openRes = network.postResponse(openParam, BasicConfig.ANCHOR_OPEN);
Object data = openRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(openParam, BasicConfig.ANCHOR_OPEN, "开启直播失败", openRes.body().asString()));
ThreadSleepUtils.sleep(10000);
}
@Test(description = "结束直播", priority = 64)
public void closeLive() {
Map<String, Object> closeParam = new HashMap<>();
closeParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
closeParam.put("cid", 101);
Response closeRes = network.postResponse(closeParam, BasicConfig.ANCHOR_CLOSE);
Object data = closeRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(closeParam, BasicConfig.ANCHOR_CLOSE, "结束直播失败", closeRes.body().asString()));
}
}
......@@ -276,7 +276,16 @@ public class BasicConfig {
public static final String MANAGER_videoSwitch = MANAGER_HOST + "/kjy/manager/live/trans/video/conf/status/switch";
public static final String MANAGER_videoDetail = MANAGER_HOST + "/kjy/manager/live/trans/video/conf/detail";
// *************** 新版预告页 ***************
// *************** 砸金蛋 ***************
public static final String MANAGER_goldenEgg_saveOrUpdate = MANAGER_HOST +"/kjy/manager/live/treasure/goldenEgg/saveOrUpdate";
public static final String MANAGER_goldenEgg_detail = MANAGER_HOST +"/kjy/manager/live/treasure/goldenEgg/detail";
public static final String MANAGER_goldenEgg_switchStatus = MANAGER_HOST +"/kjy/manager/live/treasure/goldenEgg/switchStatus";
public static final String MOBILE_goldenEgg_detail = MOBILE_HOST +"/kjy/live/treasure/goldenEgg/detail";
public static final String MOBILE_goldenEgg_open = MOBILE_HOST +"/kjy/live/treasure/goldenEgg/open";
public static final String MOBILE_goldenEgg_joinInfo = MOBILE_HOST +"/kjy/live/treasure/goldenEgg/joinInfo";
public static final String MOBILE_goldenEgg_list = MOBILE_HOST +"/kjy/live/user/list";
public static final String MOBILE_oldenEggTimeOut = MOBILE_HOST +"/test/goldenEggTimeOut";
public static final String MOBILE_goldenEgg_reset = MOBILE_HOST +"/kjy/live/treasure/goldenEgg/reset";
// *************** 猜数字红包 ***************
......
......@@ -81,185 +81,195 @@
<class name="com.kjj.cases.live.flipCard.FlipCard"/>
</classes>
</test>
<!-- <test preserve-order="true" name="中奖规则配置">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.liveConfig.WinningRules"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="指定中奖">-->
<!-- <classes>-->
<!-- <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.inviteReward.InviteReward"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="直播前-我的客户页">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.LiveBefore"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="宝箱裂变">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.treasure.Treasure"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="助播-开启直播">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.anchor.OpenLive"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="评论及回复">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.liveConfig.Comment"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="直播中编辑资料">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.liveConfig.EvaluationConf"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="访客签到">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.lotteryCode.SignIn"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="直播中抽奖">-->
<!-- <classes>-->
<!-- <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>-->
<!-- <class name="com.kjj.cases.live.guess.LiveGuess"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="看直播攒现金">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.treasure.TimeRed"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="免费领福利">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.FreeReward.FreeReward"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="我要咨询">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.Potential"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="访客领取资料">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.anchor.LiveVisitors"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="红包领取">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.red.LiveVistorRed"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="有奖答题">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.answer.Answer"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="投票">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.choice.Choice"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="问题">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.question.Question"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="直播中时长宝箱">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.treasure.TreasureTime"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="闯关答题">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.answer.passQues"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="直播中获取线索统计">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.LiveAgent"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="助播-结束直播">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.anchor.CloseLive"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="直播结束-我的客户页">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.LiveLater"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="奖品发放配置">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.Reward"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="指定中奖付款码">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.liveConfig.spec"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="客户管理">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.agent.Customer"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="访客端直播结束页">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.customer.AfterLive" />-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="访客端个人主页">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.customer.PersonalPage" />-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="中奖规则配置">
<classes>
<class name="com.kjj.cases.live.liveConfig.WinningRules"/>
</classes>
</test>
<test preserve-order="true" name="指定中奖">
<classes>
<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.inviteReward.InviteReward"/>
</classes>
</test>
<test preserve-order="true" name="直播前-我的客户页">
<classes>
<class name="com.kjj.cases.live.agent.LiveBefore"/>
</classes>
</test>
<test preserve-order="true" name="宝箱裂变">
<classes>
<class name="com.kjj.cases.live.treasure.Treasure"/>
</classes>
</test>
<test preserve-order="true" name="助播-开启直播">
<classes>
<class name="com.kjj.cases.live.anchor.OpenLive"/>
</classes>
</test>
<test preserve-order="true" name="评论及回复">
<classes>
<class name="com.kjj.cases.live.liveConfig.Comment"/>
</classes>
</test>
<test preserve-order="true" name="直播中编辑资料">
<classes>
<class name="com.kjj.cases.live.liveConfig.EvaluationConf"/>
</classes>
</test>
<test preserve-order="true" name="访客签到">
<classes>
<class name="com.kjj.cases.live.lotteryCode.SignIn"/>
</classes>
</test>
<test preserve-order="true" name="直播中抽奖">
<classes>
<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>
<class name="com.kjj.cases.live.guess.LiveGuess"/>
</classes>
</test>
<test preserve-order="true" name="看直播攒现金">
<classes>
<class name="com.kjj.cases.live.treasure.TimeRed"/>
</classes>
</test>
<test preserve-order="true" name="免费领福利">
<classes>
<class name="com.kjj.cases.live.FreeReward.FreeReward"/>
</classes>
</test>
<test preserve-order="true" name="我要咨询">
<classes>
<class name="com.kjj.cases.live.agent.Potential"/>
</classes>
</test>
<test preserve-order="true" name="访客领取资料">
<classes>
<class name="com.kjj.cases.live.anchor.LiveVisitors"/>
</classes>
</test>
<test preserve-order="true" name="红包领取">
<classes>
<class name="com.kjj.cases.live.red.LiveVistorRed"/>
</classes>
</test>
<test preserve-order="true" name="有奖答题">
<classes>
<class name="com.kjj.cases.live.answer.Answer"/>
</classes>
</test>
<test preserve-order="true" name="投票">
<classes>
<class name="com.kjj.cases.live.choice.Choice"/>
</classes>
</test>
<test preserve-order="true" name="问题">
<classes>
<class name="com.kjj.cases.live.question.Question"/>
</classes>
</test>
<test preserve-order="true" name="直播中时长宝箱">
<classes>
<class name="com.kjj.cases.live.treasure.TreasureTime"/>
</classes>
</test>
<test preserve-order="true" name="闯关答题">
<classes>
<class name="com.kjj.cases.live.answer.passQues"/>
</classes>
</test>
<test preserve-order="true" name="直播中获取线索统计">
<classes>
<class name="com.kjj.cases.live.agent.LiveAgent"/>
</classes>
</test>
<test preserve-order="true" name="助播-结束直播">
<classes>
<class name="com.kjj.cases.live.anchor.CloseLive"/>
</classes>
</test>
<test preserve-order="true" name="直播结束-我的客户页">
<classes>
<class name="com.kjj.cases.live.agent.LiveLater"/>
</classes>
</test>
<test preserve-order="true" name="奖品发放配置">
<classes>
<class name="com.kjj.cases.live.agent.Reward"/>
</classes>
</test>
<test preserve-order="true" name="指定中奖付款码">
<classes>
<class name="com.kjj.cases.live.liveConfig.spec"/>
</classes>
</test>
<test preserve-order="true" name="客户管理">
<classes>
<class name="com.kjj.cases.live.agent.Customer"/>
</classes>
</test>
<test preserve-order="true" name="访客端直播结束页">
<classes>
<class name="com.kjj.cases.live.customer.AfterLive" />
</classes>
</test>
<test preserve-order="true" name="访客端个人主页">
<classes>
<class name="com.kjj.cases.live.customer.PersonalPage" />
</classes>
</test>
<test preserve-order="true" name="创建简易直播">
<classes>
<class name="com.kjj.cases.live.liveConfig.SimpleLiveConfig" />
</classes>
</test>
<test preserve-order="true" name="砸金蛋">
<classes>
<class name="com.kjj.cases.live.treasure.GoldenEgg" />
</classes>
</test>
</suite>
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