Commit 973f688d authored by 张艳玲's avatar 张艳玲

新增猜数字红包

parent 7fda6d13
package com.kjj.bean.lottery;
import lombok.Data;
@Data
public class CondDetail {
private String treasureConfId;
}
......@@ -15,6 +15,7 @@ public class TreasureAward {
private Integer maxNum;
private Integer treasureProbability;
private Integer winLimitCount;
private Integer isLimit;
......
......@@ -15,20 +15,19 @@ import java.util.Map;
public class LotteryCode implements AdminAuthorization {
public String shareSign;
public String token;
@Test(description = "代理人A分享直播间", priority = 1)
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_GETSHARESIGN);
HashMap data = signRes.jsonPath().getJsonObject("data");
this.shareSign = (String)data.get("shareSign");
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);
LiveConstants.setValue(LiveConstants.StringKeyEnum.shareSign.getKey(),shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_GETSHARESIGN, "分享失败", signRes.body().asString()));
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "代理人A与访客A邀请关系绑定", priority = 2)
......@@ -36,7 +35,7 @@ public class LotteryCode implements AdminAuthorization {
visitorAuth();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",LiveConstants.getValue(LiveConstants.StringKeyEnum.shareSign.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
......@@ -50,42 +49,13 @@ public class LotteryCode implements AdminAuthorization {
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String)data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "访客A获取根据绑定凭证发放的抽奖码", priority = 4)
public void 访客A获取根据绑定凭证发放的抽奖码() {
visitorAuth();
ThreadSleepUtils.sleep(2000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token",token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
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 = "代理人A查询抽奖券列表", priority = 5)
public void 代理人A查询抽奖券列表() {
agentAuth();
ThreadSleepUtils.sleep(1000);
Map<String, Object> myLotteryCodeParam = new HashMap<>();
myLotteryCodeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
myLotteryCodeParam.put("pageIndex",1);
myLotteryCodeParam.put("pageSize",30);
Response myLotteryCodeRes = network.getResponse(myLotteryCodeParam, BasicConfig.MOBILE_MyLotteryCode);
Object data = myLotteryCodeRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(myLotteryCodeParam, BasicConfig.MOBILE_MyLotteryCode, "代理人查询抽奖券列表失败", myLotteryCodeRes.body().asString()));
}
@Test(description = "访客A获取直播所有的订阅消息模板", priority = 6)
@Test(description = "访客A获取直播所有的订阅消息模板", priority = 4)
public void 访客A获取直播所有的订阅消息模板() {
visitorAuth();
Map<String, Object> sycParam = new HashMap<>();
......@@ -96,7 +66,7 @@ public class LotteryCode implements AdminAuthorization {
Assert.assertNotNull(data, network.message(sycParam, BasicConfig.USER_wxIdAllList, "获取订阅消息失败", sycRes.body().asString()));
}
@Test(description = "访客A预约直播间", priority = 7)
@Test(description = "访客A预约直播间", priority = 5)
public void 访客A预约直播间() {
visitorAuth();
Map<String, Object> sycParam = new HashMap<>();
......@@ -113,7 +83,7 @@ public class LotteryCode implements AdminAuthorization {
Assert.assertNotNull(data, network.message(sycParam, BasicConfig.USER_SYCAPPOINTMENT, "预约失败", sycRes.body().asString()));
}
@Test(description = "访客A关注直播间", priority = 8)
@Test(description = "访客A关注直播间", priority = 6)
public void 访客A关注直播间() {
visitorAuth();
Map<String, Object> subscribeParam = new HashMap<>();
......@@ -128,7 +98,7 @@ public class LotteryCode implements AdminAuthorization {
Assert.assertTrue(data, network.message(subscribeParam, BasicConfig.USER_SUBSCRIBE, "关注失败", subscribeRes.body().asString()));
}
@Test(description = "访客A查询关注状态", priority = 9)
@Test(description = "访客A查询关注状态", priority = 7)
public void 访客A查询关注状态() {
visitorAuth();
Map<String, Object> findParam = new HashMap<>();
......@@ -140,7 +110,7 @@ public class LotteryCode implements AdminAuthorization {
}
@Test(description = "访客A保存海报获得抽奖码", priority = 10)
@Test(description = "访客A保存海报获得抽奖码", priority = 8)
public void 访客A保存海报获得抽奖码() {
visitorAuth();
Map<String, Object> savePosterParam = new HashMap<>();
......@@ -152,7 +122,7 @@ public class LotteryCode implements AdminAuthorization {
}
@Test(description = "访客A抽奖码数量", priority = 11)
@Test(description = "访客A抽奖码数量", priority = 9)
public void 访客A抽奖码数量() {
visitorAuth();
Map<String, Object> myCountParam = new HashMap<>();
......@@ -164,7 +134,7 @@ public class LotteryCode implements AdminAuthorization {
}
@Test(description = "访客A查询抽奖券列表", priority = 12)
@Test(description = "访客A查询抽奖券列表", priority = 10)
public void 访客A查询抽奖券列表() {
visitorAuth();
ThreadSleepUtils.sleep(1000);
......@@ -178,7 +148,7 @@ public class LotteryCode implements AdminAuthorization {
Assert.assertNotNull(data, network.message(myLotteryCodeParam, BasicConfig.MOBILE_MyLotteryCode, "查询用户自己的抽奖券列表失败", myLotteryCodeRes.body().asString()));
}
@Test(description = "访客H关系绑定", priority = 13)
@Test(description = "访客H关系绑定", priority = 11)
public void 访客H关系绑定() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
......@@ -192,35 +162,19 @@ public class LotteryCode implements AdminAuthorization {
}
@Test(description = "中奖任务邀请H绑定结果和绑定凭证", priority = 14)
@Test(description = "中奖任务邀请H绑定结果和绑定凭证", priority = 12)
public void 获取访客H绑定结果和绑定凭证() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String) data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "中奖任务邀请H根据绑定凭证发放抽奖码", priority = 15)
public void 中奖任务邀请H根据绑定凭证发放抽奖码() {
visitorAuth9();
ThreadSleepUtils.sleep(500);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
}
@Test(description = "访客J关系绑定", priority = 16)
@Test(description = "访客J关系绑定", priority = 13)
public void 访客J关系绑定() {
visitorAuth10();
ThreadSleepUtils.sleep(1000);
......@@ -234,53 +188,37 @@ public class LotteryCode implements AdminAuthorization {
}
@Test(description = "中奖任务邀请J绑定结果和绑定凭证", priority = 17)
@Test(description = "中奖任务邀请J绑定结果和绑定凭证", priority = 14)
public void 获取访客J绑定结果和绑定凭证() {
visitorAuth10();
ThreadSleepUtils.sleep(1000);
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String) data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "邀请J根据绑定凭证发放抽奖码", priority = 18)
public void 邀请J根据绑定凭证发放抽奖码() {
visitorAuth10();
ThreadSleepUtils.sleep(1000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
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 = "代理人B分享直播间", priority = 19)
@Test(description = "代理人B分享直播间", priority = 15)
public void 代理人B分享直播间() {
agentAuth1();
ThreadSleepUtils.sleep(500);
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_GETSHARESIGN);
HashMap data = signRes.jsonPath().getJsonObject("data");
this.shareSign = (String)data.get("shareSign");
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_GETSHARESIGN, "分享失败", signRes.body().asString()));
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "访客I关系绑定", priority = 20)
@Test(description = "访客I关系绑定", priority = 16)
public void 访客I关系绑定() {
visitorAuth8();
ThreadSleepUtils.sleep(1000);
......@@ -294,33 +232,18 @@ public class LotteryCode implements AdminAuthorization {
}
@Test(description = "邀请I绑定结果和绑定凭证", priority = 21)
@Test(description = "邀请I绑定结果和绑定凭证", priority = 17)
public void 访客I绑定结果和绑定凭证() {
visitorAuth8();
ThreadSleepUtils.sleep(1000);
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String) data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "邀请I根据绑定凭证发放抽奖码", priority = 22)
public void 邀请I根据绑定凭证发放抽奖码() {
visitorAuth8();
ThreadSleepUtils.sleep(1000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
}
}
......@@ -129,7 +129,7 @@ public interface AdminAuthorization {
}
/**
* 访客M(大妹子保险)非实名用户授权,ID:102
* 访客M(大妹子)非实名用户授权,ID:299
*/
default void visitorAuth13() {
network.agentCookies.put("authKey", VISITORKEY13);
......@@ -137,7 +137,7 @@ public interface AdminAuthorization {
}
/**
* 访客N(光头强)非实名用户授权,ID:173
* 访客N(光头强)非实名用户授权,ID:540
*/
default void visitorAuth14() {
network.agentCookies.put("authKey", VISITORKEY14);
......@@ -176,6 +176,30 @@ public interface AdminAuthorization {
System.out.println("用户AUTH_KEY:" + VISITORKEY18);
}
/**
* 访客T(林国芸)ID:786
*/
default void visitorAuth19() {
network.agentCookies.put("authKey", visitorAuth19);
System.out.println("用户AUTH_KEY:" + visitorAuth19);
}
/**
* 访客Y(孙心桂)ID:785
*/
default void visitorAuth20() {
network.agentCookies.put("authKey", visitorAuth20);
System.out.println("用户AUTH_KEY:" + visitorAuth20);
}
/**
* 访客W(谢翊美)ID:791
*/
default void visitorAuth21() {
network.agentCookies.put("authKey", visitorAuth21);
System.out.println("用户AUTH_KEY:" + visitorAuth21);
}
}
package com.kjj.cases.live.guess;
import com.kjj.bean.manager.GuessList;
import com.kjj.cases.live.admin.AdminAuthorization;
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.Test;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class LiveGuess implements AdminAuthorization {
public List<GuessList> confId;
public String ConfId;
public String shareSign;
Integer guessMaxNum ;
Integer guessMinNum ;
Integer confGuessMaxNum =10;
Integer confGuessMinNum =1;
private Integer getMidNum(int max,int min){
return (max + min) / 2 ;
}
@Test(description = "直播中新增猜数字红包", priority = 1)
public void 直播中新增猜数字红包() {
adminAuth();
Map<String, Object> saveParam = new HashMap<>();
saveParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
saveParam.put("redAmount",66);
saveParam.put("redRealNum",1);
saveParam.put("redShowNum",1);
saveParam.put("guessMinNum",confGuessMinNum);
saveParam.put("guessMaxNum",confGuessMaxNum);
saveParam.put("guessLeastTime",4);
Response response = network.postResponse(saveParam, BasicConfig.MOBILE_saveOrUpdate2);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(saveParam, BasicConfig.MOBILE_saveOrUpdate2, "新增猜数字红包失败", response.body().asString()));
}
@Test(description = "查询猜数字红包列表", priority = 2)
public void 查询猜数字红包列表() {
adminAuth();
Map<String, Object> listParam = new HashMap<>();
listParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(listParam, BasicConfig.MOBILE_guessList);
List<GuessList> list= JsonUtil.parseResponseToListBean(response,GuessList.class, "guessList");
System.out.println(list);
this.confId=list;
Assert.assertNotNull(list, network.message(listParam, BasicConfig.MOBILE_guessList, "查询猜数字红包列表失败", response.body().asString()));
}
@Test(description = "查询猜数字红包详情页", priority = 3)
public void 查询猜数字红包详情页() {
adminAuth();
Map<String, Object> detailParam = new HashMap<>();
detailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
detailParam.put("confId", this.confId.get(0).getConfId());
Response response = network.getResponse(detailParam, BasicConfig.MOBILE_detail1);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(detailParam, BasicConfig.MOBILE_detail1, "查询猜数字红包详情页失败", response.body().asString()));
}
@Test(description = "直播中编辑猜数字红包", priority = 4)
public void 直播中编辑猜数字红包() {
adminAuth();
Map<String, Object> saveParam = new HashMap<>();
saveParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
saveParam.put("redAmount",66);
saveParam.put("redRealNum",1);
saveParam.put("redShowNum",1);
saveParam.put("guessMinNum",1);
saveParam.put("guessMaxNum",10);
saveParam.put("guessLeastTime",4);
saveParam.put("confId", this.confId.get(0).getConfId());
Response response = network.postResponse(saveParam, BasicConfig.MOBILE_saveOrUpdate2);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(saveParam, BasicConfig.MOBILE_saveOrUpdate2, "编辑猜数红包失败", response.body().asString()));
}
@Test(description = "发放猜数红包", priority = 5)
public void 发放猜数红包() {
adminAuth();
ThreadSleepUtils.sleep(1000);
Map<String, Object> startParam = new HashMap<>();
startParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
startParam.put("type",1);
startParam.put("confId", this.confId.get(0).getConfId());
Response response = network.postResponse(startParam, BasicConfig.MOBILE_startOrEnd);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(startParam, BasicConfig.MOBILE_startOrEnd, "发放猜数红包失败", response.body().asString()));
}
//访客端
@Test(description = "访客H查询猜数字红包配置详情", priority = 6)
public void 访客H查询猜数字红包配置详情() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> confDetailParam = new HashMap<>();
confDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(confDetailParam, BasicConfig.MOBILE_confDetail);
HashMap data =response.jsonPath().getJsonObject("data");
System.out.println(data);
this.ConfId=(String) data.get("confId");
System.out.println(ConfId);
Assert.assertNotNull(ConfId, network.message(confDetailParam, BasicConfig.MOBILE_confDetail, "访客H查询猜数字红包配置详情失败", response.body().asString()));
}
@Test(description = "访客H查询红包信息详情", priority = 7)
public void 访客H查询红包信息详情() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> userDetailParam = new HashMap<>();
userDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
userDetailParam.put("confId",ConfId);
Response response = network.getResponse(userDetailParam, BasicConfig.MOBILE_userDetail);
Object data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(userDetailParam, BasicConfig.MOBILE_userDetail, "访客H查询红包信息详情失败", response.body().asString()));
}
@Test(description = "访客H第1次参与猜数字红包", priority = 8)
public void 访客H1次参与猜数字红包() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> userDetailParam = new HashMap<>();
userDetailParam.put("guessNum",getMidNum(confGuessMaxNum,confGuessMinNum));
userDetailParam.put("confId",ConfId);
Response response = network.postResponse(userDetailParam, BasicConfig.MOBILE_guess);
HashMap data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(userDetailParam, BasicConfig.MOBILE_guess, "访客H第1次参与猜数字红包失败", response.body().asString()));
this.guessMaxNum=(Integer) data.get("guessMaxNum");
this.guessMinNum = (Integer) data.get("guessMinNum");
}
@Test(description = "访客H获取分享加密串", priority = 9)
public void 访客H获取分享加密串() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 2);
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 = "用户J给用户H助力", priority = 10)
public void 用户J给用户H助力() {
visitorAuth10();
ThreadSleepUtils.sleep(1000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",6);
infoParam.put("confId",ConfId);
Response response = network.postResponse(infoParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户J给用户H助力失败", response.body().asString()));
}
@Test(description = "访客H第2次参与猜数字红包", priority = 11)
public void 访客H2次参与猜数字红包() {
visitorAuth9();
ThreadSleepUtils.sleep(2000);
Map<String, Object> userDetailParam = new HashMap<>();
userDetailParam.put("guessNum",getMidNum(guessMaxNum,guessMinNum));
userDetailParam.put("confId",ConfId);
Response response = network.postResponse(userDetailParam, BasicConfig.MOBILE_guess);
HashMap data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(userDetailParam, BasicConfig.MOBILE_guess, "访客H第3次参与猜数字红包失败", response.body().asString()));
this.guessMaxNum=(Integer) data.get("guessMaxNum");
this.guessMinNum = (Integer) data.get("guessMinNum");
}
@Test(description = "用户W给用户H助力", priority = 12)
public void 用户W给用户H助力() {
visitorAuth21();
ThreadSleepUtils.sleep(1000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",6);
infoParam.put("confId",ConfId);
Response response = network.postResponse(infoParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户B给用户H助力失败", response.body().asString()));
}
@Test(description = "访客H第3次参与猜数字红包", priority = 13)
public void 访客H3次参与猜数字红包() {
visitorAuth9();
ThreadSleepUtils.sleep(2000);
Map<String, Object> userDetailParam = new HashMap<>();
userDetailParam.put("guessNum",getMidNum(guessMaxNum,guessMinNum));
userDetailParam.put("confId",ConfId);
Response response = network.postResponse(userDetailParam, BasicConfig.MOBILE_guess);
HashMap data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(userDetailParam, BasicConfig.MOBILE_guess, "访客H第3次参与猜数字红包失败", response.body().asString()));
this.guessMaxNum=(Integer) data.get("guessMaxNum");
this.guessMinNum = (Integer) data.get("guessMinNum");
}
//助力
@Test(description = "用户T给用户H助力", priority = 14)
public void 用户T给用户H助力() {
visitorAuth19();
ThreadSleepUtils.sleep(1000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",6);
infoParam.put("confId",ConfId);
Response response = network.postResponse(infoParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户T给用户H助力失败", response.body().asString()));
}
@Test(description = "访客H第4次参与猜数字红包", priority = 15)
public void 访客H4次参与猜数字红包() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> userDetailParam = new HashMap<>();
userDetailParam.put("guessNum",getMidNum(guessMaxNum,guessMinNum));
userDetailParam.put("confId",ConfId);
Response response = network.postResponse(userDetailParam, BasicConfig.MOBILE_guess);
HashMap data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(userDetailParam, BasicConfig.MOBILE_guess, "访客H第4次参与猜数字红包失败", response.body().asString()));
this.guessMaxNum=(Integer) data.get("guessMaxNum");
this.guessMinNum = (Integer) data.get("guessMinNum");
}
//助力
@Test(description = "用户Y给用户H助力", priority = 16)
public void 用户Y给用户H助力() {
visitorAuth20();
ThreadSleepUtils.sleep(1000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",6);
infoParam.put("confId",ConfId);
Response response = network.postResponse(infoParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户Y给用户H助力失败", response.body().asString()));
}
@Test(description = "访客H第5次参与猜数字红包", priority = 17)
public void 访客H5次参与猜数字红包() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> userDetailParam = new HashMap<>();
userDetailParam.put("guessNum",getMidNum(guessMaxNum,guessMinNum));
userDetailParam.put("confId",ConfId);
Response response = network.postResponse(userDetailParam, BasicConfig.MOBILE_guess);
Object data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(userDetailParam, BasicConfig.MOBILE_guess, "访客H第2次参与猜数字红包失败", response.body().asString()));
}
@Test(description = "访客H参与猜数字红包领取红包", priority = 18)
public void 访客H1次参与猜数字红包领取红包() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> openParam = new HashMap<>();
openParam.put("confId",ConfId);
Response response = network.postResponse(openParam, BasicConfig.MOBILE_open);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(openParam, BasicConfig.MOBILE_open, "访客H第1次参与猜数字红包领取红包失败", response.body().asString()));
}
@Test(description = "访客H轮询红包开启结果", priority = 19)
public void 访客H轮询红包开启结果() {
visitorAuth9();
ThreadSleepUtils.sleep(3000);
Map<String, Object> resultParam = new HashMap<>();
resultParam.put("confId",ConfId);
Response response = network.getResponse(resultParam, BasicConfig.MOBILE_result);
long redReceiveStatus =response.jsonPath().getLong("data.redReceiveStatus");
System.out.println(redReceiveStatus);
Assert.assertTrue(redReceiveStatus==4, network.message(resultParam, BasicConfig.MOBILE_result, "访客H轮询红包开启结果失败", response.body().asString()));
}
@Test(description = "结束猜数红包", priority = 20)
public void 结束猜数红包() {
adminAuth();
ThreadSleepUtils.sleep(2000);
Map<String, Object> endParam = new HashMap<>();
endParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
endParam.put("type",2);
endParam.put("confId", this.confId.get(0).getConfId());
Response response = network.postResponse(endParam, BasicConfig.MOBILE_startOrEnd);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(endParam, BasicConfig.MOBILE_startOrEnd, "结束猜数红包失败", response.body().asString()));
}
}
......@@ -94,32 +94,32 @@ public class ManagerGuess implements AdminAuthorization {
@Test(description = "编辑猜数字红包", priority = 5)
public void 编辑猜数字红包() {
Map<String, Object> AmountParam = new HashMap<>();
AmountParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
AmountParam.put("redAmount",88);
AmountParam.put("redRealNum",1);
AmountParam.put("redShowNum",1);
AmountParam.put("guessMinNum",1);
AmountParam.put("guessMaxNum",10);
AmountParam.put("guessLeastTime",4);
AmountParam.put("confId", this.confid.get(0).getConfId());
Response response = network.postResponse(AmountParam, BasicConfig.MANAGER_saveOrUpdate1);
Map<String, Object> updateParam = new HashMap<>();
updateParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
updateParam.put("redAmount",88);
updateParam.put("redRealNum",1);
updateParam.put("redShowNum",1);
updateParam.put("guessMinNum",1);
updateParam.put("guessMaxNum",10);
updateParam.put("guessLeastTime",4);
updateParam.put("confId", this.confid.get(0).getConfId());
Response response = network.postResponse(updateParam, BasicConfig.MANAGER_saveOrUpdate1);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(AmountParam, BasicConfig.MANAGER_saveOrUpdate1, "新增猜数字红包失败", response.body().asString()));
Assert.assertTrue(data, network.message(updateParam, BasicConfig.MANAGER_saveOrUpdate1, "新增猜数字红包失败", response.body().asString()));
}
@Test(description = "删除猜数字红包", priority = 6)
public void 删除猜数字红包() {
Map<String, Object> detailParam = new HashMap<>();
detailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
detailParam.put("confId", this.confid.get(0).getConfId());
Response response = network.postResponse(detailParam, BasicConfig.MANAGER_del_1);
Map<String, Object> delParam = new HashMap<>();
delParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
delParam.put("confId", this.confid.get(0).getConfId());
Response response = network.postResponse(delParam, BasicConfig.MANAGER_del_1);
boolean data=response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(detailParam, BasicConfig.MANAGER_del_1, "删除猜数字红包失败", response.body().asString()));
Assert.assertTrue(data, network.message(delParam, BasicConfig.MANAGER_del_1, "删除猜数字红包失败", response.body().asString()));
}
......@@ -187,19 +187,19 @@ public class ManagerGuess implements AdminAuthorization {
@Test(description = "直播前编辑猜数字红包", priority = 11)
public void 直播前编辑猜数字红包() {
adminAuth();
Map<String, Object> AmountParam = new HashMap<>();
AmountParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
AmountParam.put("redAmount",99);
AmountParam.put("redRealNum",1);
AmountParam.put("redShowNum",10);
AmountParam.put("guessMinNum",1);
AmountParam.put("guessMaxNum",10);
AmountParam.put("guessLeastTime",4);
AmountParam.put("confId", this.confid.get(0).getConfId());
Response response = network.postResponse(AmountParam, BasicConfig.MOBILE_saveOrUpdate);
Map<String, Object> updateParam = new HashMap<>();
updateParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
updateParam.put("redAmount",99);
updateParam.put("redRealNum",1);
updateParam.put("redShowNum",10);
updateParam.put("guessMinNum",1);
updateParam.put("guessMaxNum",10);
updateParam.put("guessLeastTime",4);
updateParam.put("confId", this.confid.get(0).getConfId());
Response response = network.postResponse(updateParam, BasicConfig.MOBILE_saveOrUpdate);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(AmountParam, BasicConfig.MOBILE_saveOrUpdate, "直播前编辑猜数字红包失败", response.body().asString()));
Assert.assertTrue(data, network.message(updateParam, BasicConfig.MOBILE_saveOrUpdate, "直播前编辑猜数字红包失败", response.body().asString()));
}
......@@ -207,13 +207,13 @@ public class ManagerGuess implements AdminAuthorization {
@Test(description = "直播前删除猜数字红包", priority = 12)
public void 直播前删除猜数字红包() {
adminAuth();
Map<String, Object> detailParam = new HashMap<>();
detailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
detailParam.put("confId", this.confid.get(0).getConfId());
Response response = network.postResponse(detailParam, BasicConfig.MOBILE_delete);
Map<String, Object> delParam = new HashMap<>();
delParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
delParam.put("confId", this.confid.get(0).getConfId());
Response response = network.postResponse(delParam, BasicConfig.MOBILE_delete);
boolean data=response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(detailParam, BasicConfig.MOBILE_delete, "直播前删除猜数字红包失败", response.body().asString()));
Assert.assertTrue(data, network.message(delParam, BasicConfig.MOBILE_delete, "直播前删除猜数字红包失败", response.body().asString()));
}
......
......@@ -20,7 +20,6 @@ public class Lottery implements AdminAuthorization {
public List<ConfidList> List_Confid;
public String shareSign;
public String token;
@Test(description = "代理人抽奖活动弹层福利列表", priority = 1)
public void 抽奖活动弹层福利列表() {
......@@ -50,10 +49,10 @@ public class Lottery implements AdminAuthorization {
visitorAuth();
Map<String, Object> connectSuccessParam = new HashMap<>();
connectSuccessParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response connectSuccessoRes = network.getResponse(connectSuccessParam, BasicConfig.USER_connectSuccess);
boolean success = connectSuccessoRes.jsonPath().getBoolean("success");
Response response = network.getResponse(connectSuccessParam, BasicConfig.USER_connectSuccess);
boolean success = response.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", connectSuccessoRes.body().asString()));
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", response.body().asString()));
}
@Test(description = "访客B到场", priority = 4)
......@@ -61,10 +60,10 @@ public class Lottery implements AdminAuthorization {
visitorAuth2();
Map<String, Object> connectSuccessParam = new HashMap<>();
connectSuccessParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response connectSuccessoRes = network.getResponse(connectSuccessParam, BasicConfig.USER_connectSuccess);
boolean success = connectSuccessoRes.jsonPath().getBoolean("success");
Response response = network.getResponse(connectSuccessParam, BasicConfig.USER_connectSuccess);
boolean success = response.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", connectSuccessoRes.body().asString()));
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", response.body().asString()));
}
......@@ -293,14 +292,13 @@ public class Lottery implements AdminAuthorization {
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 2);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_GETSHARESIGN);
HashMap data = signRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.shareSign = (String) data.get("shareSign");
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_GETSHARESIGN, "分享失败", signRes.body().asString()));
}
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "中奖任务邀请C关系绑定", priority = 21)
public void 中奖任务邀请C关系绑定() {
......@@ -322,27 +320,29 @@ public class Lottery implements AdminAuthorization {
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String) data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "中奖任务邀请C根据绑定凭证发放抽奖码", priority = 23)
public void 中奖任务邀请C根据绑定凭证发放抽奖码() {
@Test(description = "访客C给访客A助力", priority = 23)
public void 访客C给访客A助力() {
visitorAuth3();
ThreadSleepUtils.sleep(2000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
Map<String, Object> assistParam = new HashMap<>();
assistParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
assistParam.put("shareSign",shareSign);
assistParam.put("shareType",3);
assistParam.put("confId",this.List_Confid.get(0).getWelfareConfId());
Response response = network.postResponse(assistParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(assistParam, BasicConfig.MOBILE_assist, "访客C给访客A助力失败", response.body().asString()));
}
@Test(description = "访客C到场", priority = 24)
public void 访客C到场() {
visitorAuth3();
......@@ -398,16 +398,16 @@ public class Lottery implements AdminAuthorization {
Map<String, Object> luckDetailParam = new HashMap<>();
luckDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response luckDetailRes = network.getResponse(luckDetailParam, BasicConfig.ANCHOR_luckDetail);
Object data = luckDetailRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(luckDetailParam, BasicConfig.ANCHOR_luckDetail, "查询中奖任务失败", luckDetailRes.body().asString()));
boolean hasDrawTask = luckDetailRes.jsonPath().getJsonObject("data.hasDrawTask");
System.out.println(hasDrawTask);
Assert.assertTrue(hasDrawTask, network.message(luckDetailParam, BasicConfig.ANCHOR_luckDetail, "查询中奖任务失败", luckDetailRes.body().asString()));
}
@Test(description = "访客A抽奖券列表", priority = 29)
public void 访客A抽奖券列表() {
visitorAuth();
ThreadSleepUtils.sleep(5000);
ThreadSleepUtils.sleep(3000);
Map<String, Object> myLotteryCodeParam = new HashMap<>();
myLotteryCodeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
myLotteryCodeParam.put("pageIndex", 1);
......@@ -463,12 +463,12 @@ public class Lottery implements AdminAuthorization {
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 2);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_GETSHARESIGN);
HashMap data = signRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.shareSign = (String) data.get("shareSign");
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_GETSHARESIGN, "分享失败", signRes.body().asString()));
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
......@@ -492,25 +492,25 @@ public class Lottery implements AdminAuthorization {
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String) data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "幸运任务邀请D根据绑定凭证发放抽奖码", priority = 35)
public void 幸运任务邀请D根据绑定凭证发放抽奖码() {
@Test(description = "访客D给访客B助力", priority = 35)
public void 访客D给访客B助力() {
visitorAuth4();
ThreadSleepUtils.sleep(2000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
Map<String, Object> assistParam = new HashMap<>();
assistParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
assistParam.put("shareSign",shareSign);
assistParam.put("shareType",3);
assistParam.put("confId",this.List_Confid.get(0).getWelfareConfId());
Response response = network.postResponse(assistParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(assistParam, BasicConfig.MOBILE_assist, "访客D给访客B助力失败", response.body().asString()));
}
@Test(description = "访客D到场", priority = 36)
......@@ -518,10 +518,10 @@ public class Lottery implements AdminAuthorization {
visitorAuth4();
Map<String, Object> connectSuccessParam = new HashMap<>();
connectSuccessParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response connectSuccessoRes = network.getResponse(connectSuccessParam, BasicConfig.USER_connectSuccess);
boolean success = connectSuccessoRes.jsonPath().getBoolean("success");
Response response = network.getResponse(connectSuccessParam, BasicConfig.USER_connectSuccess);
boolean success = response.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", connectSuccessoRes.body().asString()));
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", response.body().asString()));
}
@Test(description = "访客D关注直播间", priority = 37)
......@@ -568,25 +568,25 @@ public class Lottery implements AdminAuthorization {
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String) data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "幸运任务邀请E根据绑定凭证发放抽奖码", priority = 41)
public void 幸运任务邀请E根据绑定凭证发放抽奖码() {
@Test(description = "访客E给访客B助力", priority = 41)
public void 访客E给访客B助力() {
visitorAuth5();
ThreadSleepUtils.sleep(2000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
Map<String, Object> assistParam = new HashMap<>();
assistParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
assistParam.put("shareSign",shareSign);
assistParam.put("shareType",3);
assistParam.put("confId",this.List_Confid.get(0).getWelfareConfId());
Response response = network.postResponse(assistParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(assistParam, BasicConfig.MOBILE_assist, "访客E给访客B助力失败", response.body().asString()));
}
@Test(description = "访客E到场", priority = 42)
......@@ -605,10 +605,10 @@ public class Lottery implements AdminAuthorization {
visitorAuth5();
Map<String, Object> subscribeParam = new HashMap<>();
subscribeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response subscribeRes = network.postResponse(subscribeParam, BasicConfig.USER_SUBSCRIBE);
boolean data = subscribeRes.jsonPath().getBoolean("data");
Response response = network.postResponse(subscribeParam, BasicConfig.USER_SUBSCRIBE);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(subscribeParam, BasicConfig.USER_SUBSCRIBE, "关注失败", subscribeRes.body().asString()));
Assert.assertTrue(data, network.message(subscribeParam, BasicConfig.USER_SUBSCRIBE, "关注失败", response.body().asString()));
}
@Test(description = "访客E抽奖码数量", priority = 44)
......@@ -644,24 +644,24 @@ public class Lottery implements AdminAuthorization {
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String) data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "幸运任务邀请F根据绑定凭证发放抽奖码", priority = 47)
public void 幸运任务邀请F根据绑定凭证发放抽奖码() {
@Test(description = "访客F给访客B助力", priority = 47)
public void 访客F给访客B助力() {
visitorAuth6();
Map<String, Object> codeParam = new HashMap<>();
ThreadSleepUtils.sleep(2000);
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
Map<String, Object> assistParam = new HashMap<>();
assistParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
assistParam.put("shareSign",shareSign);
assistParam.put("shareType",3);
assistParam.put("confId",this.List_Confid.get(0).getWelfareConfId());
Response response = network.postResponse(assistParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(assistParam, BasicConfig.MOBILE_assist, "访客F给访客B助力失败", response.body().asString()));
}
@Test(description = "访客F到场", priority = 48)
......@@ -669,10 +669,10 @@ public class Lottery implements AdminAuthorization {
visitorAuth6();
Map<String, Object> connectSuccessParam = new HashMap<>();
connectSuccessParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response connectSuccessoRes = network.getResponse(connectSuccessParam, BasicConfig.USER_connectSuccess);
boolean success = connectSuccessoRes.jsonPath().getBoolean("success");
Response response = network.getResponse(connectSuccessParam, BasicConfig.USER_connectSuccess);
boolean success = response.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", connectSuccessoRes.body().asString()));
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", response.body().asString()));
}
@Test(description = "访客F关注直播间", priority = 49)
......@@ -720,24 +720,24 @@ public class Lottery implements AdminAuthorization {
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String) data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "幸运任务邀请G根据绑定凭证发放抽奖码", priority = 53)
public void 幸运任务邀请G根据绑定凭证发放抽奖码() {
@Test(description = "访客G给访客B助力", priority = 53)
public void 访客G给访客B助力() {
visitorAuth7();
Map<String, Object> codeParam = new HashMap<>();
ThreadSleepUtils.sleep(2000);
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
Map<String, Object> assistParam = new HashMap<>();
assistParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
assistParam.put("shareSign",shareSign);
assistParam.put("shareType",3);
assistParam.put("confId",this.List_Confid.get(0).getWelfareConfId());
Response response = network.postResponse(assistParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(assistParam, BasicConfig.MOBILE_assist, "访客G给访客B助力失败", response.body().asString()));
}
@Test(description = "访客G到场", priority = 54)
......@@ -783,9 +783,9 @@ public class Lottery implements AdminAuthorization {
Map<String, Object> luckDetailParam = new HashMap<>();
luckDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response luckDetailRes = network.getResponse(luckDetailParam, BasicConfig.ANCHOR_luckDetail);
Object data = luckDetailRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(luckDetailParam, BasicConfig.ANCHOR_luckDetail, "查询中奖任务失败", luckDetailRes.body().asString()));
boolean hasFinish = luckDetailRes.jsonPath().getBoolean("data.hasFinish");
System.out.println(hasFinish);
Assert.assertTrue(hasFinish, network.message(luckDetailParam, BasicConfig.ANCHOR_luckDetail, "查询中奖任务失败", luckDetailRes.body().asString()));
}
......
package com.kjj.cases.live.lottery;
import com.alibaba.fastjson.JSON;
import com.kjj.bean.lottery.CondDetail;
import com.kjj.bean.manager.GuessList;
import com.kjj.cases.live.admin.AdminAuthorization;
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.Test;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TreasureTime implements AdminAuthorization {
public List<CondDetail> treasureConfId ;
@Test(description = "获取宝箱配置详情", priority = 1)
public void 获取宝箱配置详情() {
visitorAuth9();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_timeDetail);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_timeDetail, "访客H获取宝箱配置详情失败", response.body().asString()));
}
@Test(description = "获取宝箱参与情况", priority = 2)
public void 获取宝箱参与情况() {
visitorAuth9();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_joinDetail);
List<CondDetail> treasureList = JsonUtil.parseResponseToListBean(response, CondDetail.class,"condDetail");
System.out.println(JSON.toJSONString(treasureList));
this.treasureConfId=treasureList;
System.out.println(treasureList);
String errorMsg = network.message(params, BasicConfig.MOBILE_joinDetail, "访客H获取宝箱参与情况失败", response.body().asString());
Assert.assertNotNull(treasureList,errorMsg);
}
@Test(description = "完成第1个观看任务", priority = 3)
public void 完成第1个观看任务() {
visitorAuth9();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("treasureConfId",this.treasureConfId.get(0).getTreasureConfId());
Response response = network.postResponse(params, BasicConfig.MOBILE_finish);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_finish, "访客H获取宝箱参与情况失败", response.body().asString()));
}
@Test(description = "获取第1个宝箱参与情况", priority = 4)
public void 获取第1个宝箱参与情况() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_joinDetail1);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_joinDetail1, "访客H获取第1个宝箱参与情况失败", response.body().asString()));
}
@Test(description = "访客H开启第1个宝箱", priority = 5)
public void 开启第1个宝箱() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("treasureConfId",this.treasureConfId.get(0).getTreasureConfId());
Response response = network.postResponse(params, BasicConfig.MOBILE_treasureOpen);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_treasureOpen, "访客H开启第1个宝箱失败", response.body().asString()));
}
@Test(description = "查询第1个宝箱中奖结果", priority = 6)
public void 查询第1个宝箱中奖结果() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("treasureConfId",this.treasureConfId.get(0).getTreasureConfId());
Response response = network.getResponse(params, BasicConfig.MOBILE_joinResult);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_joinResult, "访客H查询第1个宝箱中奖结果失败", response.body().asString()));
}
//第2个宝箱校验红包
@Test(description = "完成第2个观看任务", priority = 7)
public void 完成第2个观看任务() {
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("treasureConfId",this.treasureConfId.get(1).getTreasureConfId());
//黑名单用户
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response = network.postResponse(params, BasicConfig.MOBILE_finish);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_finish, "访客H获取宝箱参与情况失败", response.body().asString()));
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Response response1 = network.postResponse(params, BasicConfig.MOBILE_finish);
Object data1=response1.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data1, network.message(params, BasicConfig.MOBILE_finish, "访客H获取宝箱参与情况失败", response1.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response2 = network.postResponse(params, BasicConfig.MOBILE_finish);
Object data2=response2.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data2, network.message(params, BasicConfig.MOBILE_finish, "访客H获取宝箱参与情况失败", response2.body().asString()));
}
@Test(description = "获取第2个宝箱参与情况", priority = 8)
public void 获取第2个宝箱参与情况() {
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
//黑名单用户
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response = network.getResponse(params, BasicConfig.MOBILE_joinDetail1);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_joinDetail1, "访客H获取宝箱参与情况失败", response.body().asString()));
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Response response1 = network.getResponse(params, BasicConfig.MOBILE_joinDetail1);
Object data1=response1.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data1, network.message(params, BasicConfig.MOBILE_joinDetail1, "访客H获取宝箱参与情况失败", response1.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response2 = network.getResponse(params, BasicConfig.MOBILE_joinDetail1);
Object data2=response2.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data2, network.message(params, BasicConfig.MOBILE_joinDetail1, "访客H获取宝箱参与情况失败", response2.body().asString()));
}
@Test(description = "开启第2个宝箱", priority = 9)
public void 开启第2个宝箱() {
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("treasureConfId",this.treasureConfId.get(1).getTreasureConfId());
//黑名单用户
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response = network.postResponse(params, BasicConfig.MOBILE_treasureOpen);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_treasureOpen, "访客H获取宝箱参与情况失败", response.body().asString()));
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Response response1 = network.postResponse(params, BasicConfig.MOBILE_treasureOpen);
Object data1=response1.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data1, network.message(params, BasicConfig.MOBILE_treasureOpen, "访客H获取宝箱参与情况失败", response1.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response2 = network.postResponse(params, BasicConfig.MOBILE_treasureOpen);
Object data2=response2.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data2, network.message(params, BasicConfig.MOBILE_treasureOpen, "访客H获取宝箱参与情况失败", response2.body().asString()));
}
@Test(description = "查询第2个宝箱中奖结果", priority = 10)
public void 查询第2个宝箱中奖结果() {
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("treasureConfId",this.treasureConfId.get(1).getTreasureConfId());
//黑名单用户
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response = network.getResponse(params, BasicConfig.MOBILE_joinResult);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_joinResult, "访客H获取宝箱参与情况失败", response.body().asString()));
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Response response1 = network.getResponse(params, BasicConfig.MOBILE_joinResult);
Object data1=response1.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data1, network.message(params, BasicConfig.MOBILE_joinResult, "访客H获取宝箱参与情况失败", response1.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response2 = network.getResponse(params, BasicConfig.MOBILE_joinResult);
Object data2=response2.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data2, network.message(params, BasicConfig.MOBILE_joinResult, "访客H获取宝箱参与情况失败", response2.body().asString()));
}
//第3个宝箱校验实物
@Test(description = "完成第3个观看任务", priority = 11)
public void 完成第3个观看任务() {
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("treasureConfId",this.treasureConfId.get(2).getTreasureConfId());
//黑名单用户
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response = network.postResponse(params, BasicConfig.MOBILE_finish);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_finish, "访客H获取宝箱参与情况失败", response.body().asString()));
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Response response1 = network.postResponse(params, BasicConfig.MOBILE_finish);
Object data1=response1.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data1, network.message(params, BasicConfig.MOBILE_finish, "访客H获取宝箱参与情况失败", response1.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response2 = network.postResponse(params, BasicConfig.MOBILE_finish);
Object data2=response2.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data2, network.message(params, BasicConfig.MOBILE_finish, "访客H获取宝箱参与情况失败", response2.body().asString()));
}
@Test(description = "获取第3个宝箱参与情况", priority = 12)
public void 获取第3个宝箱参与情况() {
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
//黑名单用户
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response = network.getResponse(params, BasicConfig.MOBILE_joinDetail1);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_joinDetail1, "访客H获取宝箱参与情况失败", response.body().asString()));
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Response response1 = network.getResponse(params, BasicConfig.MOBILE_joinDetail1);
Object data1=response1.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data1, network.message(params, BasicConfig.MOBILE_joinDetail1, "访客H获取宝箱参与情况失败", response1.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response2 = network.getResponse(params, BasicConfig.MOBILE_joinDetail1);
Object data2=response2.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data2, network.message(params, BasicConfig.MOBILE_joinDetail1, "访客H获取宝箱参与情况失败", response2.body().asString()));
}
@Test(description = "开启第3个宝箱", priority = 13)
public void 开启第3个宝箱() {
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("treasureConfId",this.treasureConfId.get(2).getTreasureConfId());
//黑名单用户
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response = network.postResponse(params, BasicConfig.MOBILE_treasureOpen);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_treasureOpen, "访客H获取宝箱参与情况失败", response.body().asString()));
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Response response1 = network.postResponse(params, BasicConfig.MOBILE_treasureOpen);
Object data1=response1.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data1, network.message(params, BasicConfig.MOBILE_treasureOpen, "访客H获取宝箱参与情况失败", response1.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response2 = network.postResponse(params, BasicConfig.MOBILE_treasureOpen);
Object data2=response2.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data2, network.message(params, BasicConfig.MOBILE_treasureOpen, "访客H获取宝箱参与情况失败", response2.body().asString()));
}
@Test(description = "查询第3个宝箱中奖结果", priority = 14)
public void 查询第3个宝箱中奖结果() {
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("treasureConfId",this.treasureConfId.get(2).getTreasureConfId());
//黑名单用户
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response = network.getResponse(params, BasicConfig.MOBILE_joinResult);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_joinResult, "访客H获取宝箱参与情况失败", response.body().asString()));
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Response response1 = network.getResponse(params, BasicConfig.MOBILE_joinResult);
Object data1=response1.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data1, network.message(params, BasicConfig.MOBILE_joinResult, "访客H获取宝箱参与情况失败", response1.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
ThreadSleepUtils.sleep(1000);
Response response2 = network.getResponse(params, BasicConfig.MOBILE_joinResult);
Object data2=response2.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data2, network.message(params, BasicConfig.MOBILE_joinResult, "访客H获取宝箱参与情况失败", response2.body().asString()));
}
//第4个宝箱校验随机抽奖码
@Test(description = "完成第4个观看任务", priority = 15)
public void 完成第4个观看任务() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("treasureConfId",this.treasureConfId.get(3).getTreasureConfId());
Response response = network.postResponse(params, BasicConfig.MOBILE_finish);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_finish, "访客H获取宝箱参与情况失败", response.body().asString()));
}
@Test(description = "获取第4个宝箱参与情况", priority = 16)
public void 获取第4个宝箱参与情况() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_joinDetail1);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_joinDetail1, "访客H获取宝箱参与情况失败", response.body().asString()));
}
@Test(description = "开启第4个宝箱", priority = 17)
public void 开启第4个宝箱() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("treasureConfId",this.treasureConfId.get(3).getTreasureConfId());
Response response = network.postResponse(params, BasicConfig.MOBILE_treasureOpen);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_treasureOpen, "访客H获取宝箱参与情况失败", response.body().asString()));
}
@Test(description = "查询第4个宝箱中奖结果", priority = 18)
public void 查询第4个宝箱中奖结果() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("treasureConfId",this.treasureConfId.get(3).getTreasureConfId());
Response response = network.getResponse(params, BasicConfig.MOBILE_joinResult);
Object data=response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_joinResult, "访客H获取宝箱参与情况失败", response.body().asString()));
}
}
package com.kjj.cases.live.manager;
import com.kjj.cases.live.admin.AdminAuthorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.BaseUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.HashMap;
import java.util.Map;
public class Share implements AdminAuthorization {
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
}
@Test(description = "新增常规小程序分享", priority = 1)
public void 新增常规小程序分享() {
Map<String, Object> saveParam = new HashMap<>();
saveParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
saveParam.put("mpShareUrl", "//yun.dui88.com/kjy/image/20210526/1622022856685.jpeg");
saveParam.put("mpShareTitle", "「{{welfareName}}」常规分享文案{{name}}");
saveParam.put("shareType", 1);
Response response = network.postResponse(saveParam, BasicConfig.MANAGER_saveOrUpdateMpShare);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data,network.message(saveParam, BasicConfig.MOBILE_info, "新增常规小程序分享失败", response.body().asString()));
}
@Test(description = "新增红包小程序分享", priority = 2)
public void 新增红包宝箱小程序分享() {
Map<String, Object> saveParam = new HashMap<>();
saveParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
saveParam.put("mpShareUrl", "//yun.dui88.com/kjy/image/20210526/1622022856685.jpeg");
saveParam.put("mpShareTitle", "「{{welfareName}}」红包分享文案{{name}}");
saveParam.put("shareType", 2);
Response response = network.postResponse(saveParam, BasicConfig.MANAGER_saveOrUpdateMpShare);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data,network.message(saveParam, BasicConfig.MOBILE_info, "新增红包小程序分享失败", response.body().asString()));
}
@Test(description = "新增直播宝箱小程序分享", priority = 3)
public void 新增直播宝箱小程序分享() {
Map<String, Object> saveParam = new HashMap<>();
saveParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
saveParam.put("mpShareUrl", "//yun.dui88.com/kjy/image/20210526/1622022856685.jpeg");
saveParam.put("mpShareTitle", "「{{welfareName}}」宝箱裂变分享文案{{name}}");
saveParam.put("shareType", 4);
Response response = network.postResponse(saveParam, BasicConfig.MANAGER_saveOrUpdateMpShare);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data,network.message(saveParam, BasicConfig.MOBILE_info, "新增直播宝箱小程序分享失败", response.body().asString()));
}
@Test(description = "新增猜数红包小程序分享", priority = 4)
public void 新增猜数红包小程序分享() {
Map<String, Object> saveParam = new HashMap<>();
saveParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
saveParam.put("mpShareUrl", "//yun.dui88.com/kjy/image/20210526/1622022856685.jpeg");
saveParam.put("mpShareTitle", "「{{welfareName}}」猜数字红包分享文案{{name}}");
saveParam.put("shareType", 5);
Response response = network.postResponse(saveParam, BasicConfig.MANAGER_saveOrUpdateMpShare);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data,network.message(saveParam, BasicConfig.MOBILE_info, "新增猜数红包小程序分享失败", response.body().asString()));
}
}
......@@ -47,35 +47,35 @@ public class TreasureTime implements AdminAuthorization {
TreasureCode treasureCode =new TreasureCode();
treasureCode.setFixedNum(1);
treasureCode.setMaxNum(null);
treasureCode.setMaxNum(0);
treasureCode.setRuleType(1);
updateParam.put("treasureCode",treasureCode);
Response response = network.postResponse(updateParam, BasicConfig.MANAGER_update1);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(updateParam, BasicConfig.MANAGER_update1, "第一轮宝箱时长配置失败", response.body().asString()));
Assert.assertTrue(data, network.message(updateParam, BasicConfig.MANAGER_update1, "停留时长1分钟固定抽奖码", response.body().asString()));
}
@Test(description = "获取第轮宝箱配置详情", priority = 3)
public void 获取第轮宝箱配置详情() {
@Test(description = "获取第1轮宝箱配置详情", priority = 3)
public void 获取第1轮宝箱配置详情() {
Map<String, Object> detailParam = new HashMap<>();
detailParam.put("treasureConfId",this.ConfId.get(0).getTreasureConfId());
Response response = network.getResponse(detailParam, BasicConfig.MANAGER_detail1);
Object data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(detailParam, BasicConfig.MANAGER_detail1, "获取第轮宝箱配置详情失败", response.body().asString()));
Assert.assertNotNull(data, network.message(detailParam, BasicConfig.MANAGER_detail1, "获取第1轮宝箱配置详情失败", response.body().asString()));
}
@Test(description = "停留时长2分钟随机抽奖码", priority = 4)
public void 停留时长2分钟随机抽奖码() {
@Test(description = "停留时长2分钟现金红包", priority = 4)
public void 停留时长2分钟现金红包() {
Map<String, Object> updateParam = new HashMap<>();
updateParam.put("treasureConfId",this.ConfId.get(1).getTreasureConfId());
updateParam.put("boxConfType",1);
updateParam.put("boxConfType",2);
updateParam.put("openCondition",2);
TreasureCode treasureCode =new TreasureCode();
......@@ -84,30 +84,53 @@ public class TreasureTime implements AdminAuthorization {
treasureCode.setRuleType(2);
updateParam.put("treasureCode",treasureCode);
TreasureRed treasureRed =new TreasureRed();
treasureRed.setRedTotalAmount(100);
treasureRed.setRuleType(1);
treasureRed.setTotalNum(1);
treasureRed.setFixedNum(30);
updateParam.put("treasureRed",treasureRed);
Response response = network.postResponse(updateParam, BasicConfig.MANAGER_update1);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(updateParam, BasicConfig.MANAGER_update1, "第二轮宝箱时长配置失败", response.body().asString()));
Assert.assertTrue(data, network.message(updateParam, BasicConfig.MANAGER_update1, "停留时长2分钟现金红包配置失败", response.body().asString()));
}
@Test(description = "获取第轮宝箱配置详情", priority = 5)
public void 获取第轮宝箱配置详情() {
@Test(description = "获取第2轮宝箱配置详情", priority = 5)
public void 获取第2轮宝箱配置详情() {
Map<String, Object> detailParam = new HashMap<>();
detailParam.put("treasureConfId",this.ConfId.get(1).getTreasureConfId());
Response response = network.getResponse(detailParam, BasicConfig.MANAGER_detail1);
Object data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(detailParam, BasicConfig.MANAGER_detail1, "获取第二轮宝箱配置详情失败", response.body().asString()));
Assert.assertNotNull(data, network.message(detailParam, BasicConfig.MANAGER_detail1, "获取第2轮宝箱配置详情失败", response.body().asString()));
}
@Test(description = "查询奖品列表", priority = 6)
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);
List<WelfareList>list = JsonUtil.parseResponseToPageBean(response, WelfareList.class);
System.out.println(list);
this.id = list;
Assert.assertNotNull(list, network.message(getListParam, BasicConfig.MANAGER_getList4Admin, "查询奖品列表失败", response.body().asString()));
}
@Test(description = "停留时长3分钟随机抽奖码", priority = 6)
public void 停留时长3分钟随机抽奖码() {
@Test(description = "停留时长3分钟实物奖品", priority = 7)
public void 停留时长3分钟实物奖品() {
Map<String, Object> updateParam = new HashMap<>();
updateParam.put("treasureConfId",this.ConfId.get(2).getTreasureConfId());
updateParam.put("boxConfType",1);
updateParam.put("boxConfType",3);
updateParam.put("openCondition",3);
TreasureCode treasureCode =new TreasureCode();
......@@ -116,22 +139,23 @@ public class TreasureTime implements AdminAuthorization {
treasureCode.setRuleType(1);
updateParam.put("treasureCode",treasureCode);
TreasureRed treasureRed =new TreasureRed();
treasureRed.setRedTotalAmount(100);
treasureRed.setRuleType(1);
treasureRed.setTotalNum(3);
treasureRed.setFixedNum(30);
updateParam.put("treasureRed",treasureRed);
TreasureAward treasureAward =new TreasureAward();
treasureAward.setAwardName("萌娃锦鲤");
treasureAward.setBizConfId(0);
treasureAward.setIsLimit(2);
treasureAward.setTotalNum(1);
treasureAward.setWelfareId(this.id.get(5).getId());
updateParam.put("treasureAward",treasureAward);
Response response = network.postResponse(updateParam, BasicConfig.MANAGER_update1);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(updateParam, BasicConfig.MANAGER_update1, "第轮宝箱时长配置失败", response.body().asString()));
Assert.assertTrue(data, network.message(updateParam, BasicConfig.MANAGER_update1, "第3轮宝箱时长配置失败", response.body().asString()));
}
@Test(description = "获取第三轮宝箱配置详情", priority = 7)
@Test(description = "获取第三轮宝箱配置详情", priority = 8)
public void 获取第三轮宝箱配置详情() {
Map<String, Object> detailParam = new HashMap<>();
detailParam.put("treasureConfId",this.ConfId.get(2).getTreasureConfId());
......@@ -142,39 +166,20 @@ public class TreasureTime implements AdminAuthorization {
}
@Test(description = "查询奖品列表", priority = 8)
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);
List<WelfareList>list = JsonUtil.parseResponseToPageBean(response, WelfareList.class);
System.out.println(list);
this.id = list;
Assert.assertNotNull(list, network.message(getListParam, BasicConfig.MANAGER_getList4Admin, "查询奖品列表失败", response.body().asString()));
}
@Test(description = "停留时长4分钟随机抽奖码", priority = 9)
public void 停留时长4分钟随机抽奖码() {
Map<String, Object> updateParam = new HashMap<>();
updateParam.put("treasureConfId",this.ConfId.get(3).getTreasureConfId());
updateParam.put("boxConfType",1);
updateParam.put("openCondition",3);
updateParam.put("openCondition",4);
TreasureCode treasureCode =new TreasureCode();
treasureCode.setFixedNum(1);
treasureCode.setMaxNum(6);
treasureCode.setRuleType(1);
treasureCode.setRuleType(2);
updateParam.put("treasureCode",treasureCode);
TreasureAward treasureAward =new TreasureAward();
treasureAward.setWelfareId(this.id.get(5).getId());
treasureAward.setTotalNum(-1);
updateParam.put("treasureAward",treasureAward);
Response response = network.postResponse(updateParam, BasicConfig.MANAGER_update1);
boolean data =response.jsonPath().getBoolean("data");
......
......@@ -212,9 +212,7 @@ public class Limited implements AdminAuthorization {
boolean openResult=response.jsonPath().getBoolean("data.openResult");
System.out.println(openResult);
Assert.assertTrue(openResult, network.message(params, BasicConfig.MOBILE_QuesParticipate, "参与失败", response.body().asString()));
boolean result=response.jsonPath().getBoolean("data.result");
System.out.println(result);
System.out.println("访客A领取答题红包_答题正确 timestamp:"+new Date().getTime());
Assert.assertTrue(result, network.message(params, BasicConfig.MOBILE_QuesParticipate, "答题失败", response.body().asString()));
......
......@@ -318,8 +318,8 @@ public class LiveVistorRed implements AdminAuthorization {
}
/*访客端-访客A获取直播间参数-getShareSign*/
@Test(description = "访客A获取直播间参数", priority = 19)
public void 访客A获取直播间参数()
@Test(description = "访客H获取直播间参数", priority = 19)
public void 访客H获取直播间参数()
{
visitorAuth9();
Map<String, Object> params = new HashMap<>();
......@@ -334,8 +334,8 @@ public class LiveVistorRed implements AdminAuthorization {
}
/*访客端-访客B查询被助力者访客A的信息*/
@Test(description = "访客B查询被助力者访客A的信息", priority = 20)
public void 访客B查询被助力者访客A的信息()
@Test(description = "访客I查询被助力者访客H的信息", priority = 20)
public void 访客I查询被助力者访客H的信息()
{
visitorAuth8();
Map<String, Object> params = new HashMap<>();
......@@ -348,23 +348,25 @@ public class LiveVistorRed implements AdminAuthorization {
}
/*访客端-访客B帮访客A助力*/
@Test(description = "访客B帮访客A助力", priority = 21)
public void 访客B帮访客A助力()
@Test(description = "访客I帮访客H助力", priority = 21)
public void 访客I帮访客H助力()
{
visitorAuth8();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareSign", red_sharesign);
params.put("confRedPacketId", confId_Red);
Response response = network.postResponse(params, BasicConfig.MOBILE_RedLuckHelp);
boolean data = response.jsonPath().getBoolean("success");
System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedLuckHelp, "帮好友助力失败", response.body().asString()));
}
ThreadSleepUtils.sleep(2000);
Map<String, Object> assistParam = new HashMap<>();
assistParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
assistParam.put("shareSign",red_sharesign);
assistParam.put("shareType",5);
assistParam.put("confId",confId_Red);
Response response = network.postResponse(assistParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(assistParam, BasicConfig.MOBILE_assist, "访客D给访客B助力失败", response.body().asString()));
}
/*访客端-访客B获取直播间参数-getShareSign*/
@Test(description = "访客B获取直播间参数", priority = 22)
public void 访客B获取直播间参数()
@Test(description = "访客I获取直播间参数", priority = 22)
public void 访客I获取直播间参数()
{
visitorAuth8();
Map<String, Object> params = new HashMap<>();
......@@ -378,9 +380,9 @@ public class LiveVistorRed implements AdminAuthorization {
Assert.assertNotNull(red_sharesign, network.message(params, BasicConfig.MOBILE_GETSHARESIGN, "获取直播间参数失败", response.body().asString()));
}
/*访客端-访客A查询被助力者访客B的信息*/
@Test(description = "访客A查询被助力者访客B的信息", priority = 23)
public void 访客A查询被助力者访客B的信息()
@Test(description = "访客H查询被助力者访客I的信息", priority = 23)
public void 访客H查询被助力者访客I的信息()
{
visitorAuth9();
Map<String, Object> params = new HashMap<>();
......@@ -393,21 +395,22 @@ public class LiveVistorRed implements AdminAuthorization {
}
/*访客端-访客A帮访客B助力*/
@Test(description = "访客A帮访客B助力", priority = 24)
public void 访客A帮访客B助力()
@Test(description = "访客H帮访客I助力", priority = 24)
public void 访客H帮访客I助力()
{
visitorAuth9();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareSign", red_sharesign);
params.put("confRedPacketId", confId_Red);
Response response = network.postResponse(params, BasicConfig.MOBILE_RedLuckHelp);
boolean data = response.jsonPath().getBoolean("success");
System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedLuckHelp, "帮好友助力失败", response.body().asString()));
ThreadSleepUtils.sleep(2000);
Map<String, Object> assistParam = new HashMap<>();
assistParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
assistParam.put("shareSign",red_sharesign);
assistParam.put("shareType",5);
assistParam.put("confId",confId_Red);
Response response = network.postResponse(assistParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(assistParam, BasicConfig.MOBILE_assist, "访客D给访客B助力失败", response.body().asString()));
}
/*被助力者A-手气王助力详情信息查询*/
@Test(description = "红包详情助力信息", priority = 25)
public void 红包详情助力信息()
......@@ -423,8 +426,8 @@ public class LiveVistorRed implements AdminAuthorization {
}
/*被助力者B-手气王助力详情信息查询*/
@Test(description = "被助力者B-红包详情助力信息", priority = 26)
public void 被助力者B红包详情助力信息()
@Test(description = "被助力者I-红包详情助力信息", priority = 26)
public void 被助力者I红包详情助力信息()
{
visitorAuth8();
Map<String, Object> params = new HashMap<>();
......@@ -464,8 +467,8 @@ public class LiveVistorRed implements AdminAuthorization {
}
/*查询访客端访客B红包状态*/
@Test(description = "查询访客端访客B红包状态", priority = 29)
public void 查询访客端访客B红包状态()
@Test(description = "查询访客端访客I红包状态", priority = 29)
public void 查询访客端访客I红包状态()
{
visitorAuth8();
Map<String, Object> params = new HashMap<>();
......@@ -478,8 +481,8 @@ public class LiveVistorRed implements AdminAuthorization {
/*访客A开手气王红包*/
@Test(description = "访客A开手气王红包", priority = 30)
public void 访客A开手气王红包()
@Test(description = "访客H开手气王红包", priority = 30)
public void 访客H开手气王红包()
{
visitorAuth9();
ThreadSleepUtils.sleep(63000);
......@@ -493,8 +496,8 @@ public class LiveVistorRed implements AdminAuthorization {
}
/*访客B开手气王红包*/
@Test(description = "访客B开手气王红包", priority = 31)
public void 访客B开手气王红包()
@Test(description = "访客I开手气王红包", priority = 31)
public void 访客I开手气王红包()
{
visitorAuth8();
Map<String, Object> params = new HashMap<>();
......@@ -567,8 +570,8 @@ public class LiveVistorRed implements AdminAuthorization {
/*访客B领红包轮询结果*/
@Test(description = "访客B领手气王红包轮询结果", priority = 36)
public void 访客B领手气王红包轮询结果()
@Test(description = "访客I领手气王红包轮询结果", priority = 36)
public void 访客I领手气王红包轮询结果()
{
visitorAuth8();
Map<String, Object> params = new HashMap<>();
......
......@@ -32,7 +32,6 @@ public class Treasure implements AdminAuthorization {
}
public List<WelfareList> id;
public String ConfId;
public String token;
public String shareSign;
public JSONObject treasureConf;
......@@ -162,22 +161,35 @@ public class Treasure implements AdminAuthorization {
}
//邀请链路
@Test(description = "访客H分享直播间", priority = 8)
public void 访客H分享直播间() {
@Test(description = "访客H获取分享加密串", priority = 8)
public void 访客H获取分享加密串() {
visitorAuth9();
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 2);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_GETSHARESIGN);
HashMap data = signRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.shareSign = (String)data.get("shareSign");
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_GETSHARESIGN, "分享失败", signRes.body().asString()));
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "访客H与访客B邀请关系绑定", priority = 9)
@Test(description = "根据分享类型获取分享内容", priority = 9)
public void 根据分享类型获取分享内容() {
visitorAuth2();
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareType",7);
Response response = network.getResponse(infoParam, BasicConfig.MOBILE_helpInfo);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(infoParam, BasicConfig.MOBILE_helpInfo, "根据分享类型获取分享内容", response.body().asString()));
}
@Test(description = "访客H与访客B邀请关系绑定", priority = 10)
public void 访客H与访客B邀请关系绑定() {
visitorAuth2();
Map<String, Object> bindingParam = new HashMap<>();
......@@ -189,46 +201,76 @@ public class Treasure implements AdminAuthorization {
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客B获取绑定结果和绑定凭证", priority = 10)
@Test(description = "访客B获取绑定结果和绑定凭证", priority = 11)
public void 访客B获取绑定结果和绑定凭证() {
visitorAuth2();
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
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 = 12)
public void 未登录查询分享人头像昵称() {
visitorAuth2();
Map<String, Object> simpleParam = new HashMap<>();
simpleParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
simpleParam.put("shareSign",shareSign);
simpleParam.put("shareType",7);
simpleParam.put("confId",ConfId);
Response response = network.getResponse(simpleParam, BasicConfig.MOBILE_simple);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String)data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
Assert.assertNotNull(data, network.message(simpleParam, BasicConfig.MOBILE_simple, "未登录查询分享人头像昵称失败", response.body().asString()));
}
@Test(description = "访客B根据绑定凭证发放抽奖码", priority = 11)
public void 访客B根据绑定凭证发放抽奖码() {
@Test(description = "已登录查询分享人头像昵称", priority = 13)
public void 已登录查询分享人头像昵称() {
visitorAuth2();
ThreadSleepUtils.sleep(2000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",7);
infoParam.put("confId",ConfId);
Response response = network.getResponse(infoParam, BasicConfig.MOBILE_info);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(infoParam, BasicConfig.MOBILE_info, "已登录查询分享人头像昵称失败", response.body().asString()));
}
@Test(description = "用户B给用户H助力", priority = 14)
public void 用户B给用户H助力() {
visitorAuth2();
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",7);
infoParam.put("confId",ConfId);
Response response = network.postResponse(infoParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户B给用户H助力失败", response.body().asString()));
}
@Test(description = "访客B获取直播所有的订阅消息模板", priority = 12)
@Test(description = "访客B获取直播所有的订阅消息模板", priority = 15)
public void 获取B直播所有的订阅消息模板() {
visitorAuth2();
Map<String, Object> sycParam = new HashMap<>();
sycParam.put("appid","wx4d7276f866bd24c8");
sycParam.put("appId","wx4d7276f866bd24c8");
Response sycRes = network.postResponse(sycParam, BasicConfig.USER_wxIdAllList);
Object data = sycRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(sycParam, BasicConfig.USER_wxIdAllList, "获取订阅消息失败", sycRes.body().asString()));
}
@Test(description = "访客B预约直播间", priority = 13)
@Test(description = "访客B预约直播间", priority = 16)
public void 访客B预约直播间() {
visitorAuth2();
Map<String, Object> sycParam = new HashMap<>();
......@@ -245,7 +287,7 @@ public class Treasure implements AdminAuthorization {
Assert.assertNotNull(data, network.message(sycParam, BasicConfig.USER_SYCAPPOINTMENT, "预约失败", sycRes.body().asString()));
}
@Test(description = "访客B关注直播间", priority = 14)
@Test(description = "访客B关注直播间", priority = 17)
public void 访客B关注直播间() {
visitorAuth2();
Map<String, Object> subscribeParam = new HashMap<>();
......@@ -260,7 +302,7 @@ public class Treasure implements AdminAuthorization {
Assert.assertTrue(data, network.message(subscribeParam, BasicConfig.USER_SUBSCRIBE, "关注失败", subscribeRes.body().asString()));
}
@Test(description = "访客B关注状态查询", priority = 15)
@Test(description = "访客B关注状态查询", priority = 18)
public void 访客B关注状态查询() {
visitorAuth2();
Map<String, Object> findParam = new HashMap<>();
......@@ -272,7 +314,7 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客B保存海报获得抽奖码", priority = 16)
@Test(description = "访客B保存海报获得抽奖码", priority = 19)
public void 访客B保存海报获得抽奖码() {
visitorAuth2();
Map<String, Object> savePosterParam = new HashMap<>();
......@@ -284,7 +326,7 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "查询访客B抽奖码数量", priority = 17)
@Test(description = "查询访客B抽奖码数量", priority = 20)
public void 查询访客B抽奖码数量() {
visitorAuth2();
Map<String, Object> myCountParam = new HashMap<>();
......@@ -296,48 +338,47 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客K邀请关系绑定", priority = 18)
@Test(description = "访客K邀请关系绑定", priority = 21)
public void 访客K邀请关系绑定() {
visitorAuth11();
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");
Response response = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = response.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", response.body().asString()));
}
@Test(description = "访客K获取绑定结果和绑定凭证", priority = 19)
@Test(description = "访客K获取绑定结果和绑定凭证", priority = 22)
public void 访客K获取绑定结果和绑定凭证() {
visitorAuth11();
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String)data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "访客K根据绑定凭证发放抽奖码", priority = 20)
public void 访客K根据绑定凭证发放抽奖码() {
@Test(description = "用户K给用户H助力", priority = 23)
public void 用户K给用户H助力() {
visitorAuth11();
ThreadSleepUtils.sleep(2000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",7);
infoParam.put("confId",ConfId);
Response response = network.postResponse(infoParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户K给用户H助力失败", response.body().asString()));
}
@Test(description = "访客L邀请关系绑定", priority = 21)
@Test(description = "访客L邀请关系绑定", priority = 24)
public void 访客L邀请关系绑定() {
visitorAuth12();
Map<String, Object> bindingParam = new HashMap<>();
......@@ -349,36 +390,35 @@ public class Treasure implements AdminAuthorization {
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客L获取绑定结果和绑定凭证", priority = 22)
@Test(description = "访客L获取绑定结果和绑定凭证", priority = 25)
public void 访客L获取绑定结果和绑定凭证() {
visitorAuth12();
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String)data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "访客L根据绑定凭证发放抽奖码", priority = 23)
public void 访客L根据绑定凭证发放抽奖码() {
@Test(description = "用户L给用户H助力", priority = 26)
public void 用户L给用户H助力() {
visitorAuth12();
ThreadSleepUtils.sleep(2000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",7);
infoParam.put("confId",ConfId);
Response response = network.postResponse(infoParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户L给用户H助力失败", response.body().asString()));
}
@Test(description = "访客M邀请关系绑定", priority = 24)
@Test(description = "访客M邀请关系绑定", priority = 27)
public void 访客M邀请关系绑定() {
visitorAuth13();
Map<String, Object> bindingParam = new HashMap<>();
......@@ -390,35 +430,34 @@ public class Treasure implements AdminAuthorization {
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客M获取绑定结果和绑定凭证", priority = 25)
@Test(description = "访客M获取绑定结果和绑定凭证", priority = 28)
public void 访客M获取绑定结果和绑定凭证() {
visitorAuth13();
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String)data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "访客M根据绑定凭证发放抽奖码", priority = 26)
public void 访客M根据绑定凭证发放抽奖码() {
@Test(description = "用户M给用户H助力", priority = 29)
public void 用户M给用户H助力() {
visitorAuth13();
ThreadSleepUtils.sleep(2000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",7);
infoParam.put("confId",ConfId);
Response response = network.postResponse(infoParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户M给用户H助力失败", response.body().asString()));
}
@Test(description = "访客P邀请关系绑定", priority = 27)
@Test(description = "访客P邀请关系绑定", priority = 30)
public void 访客P邀请关系绑定() {
visitorAuth16();
Map<String, Object> bindingParam = new HashMap<>();
......@@ -430,35 +469,34 @@ public class Treasure implements AdminAuthorization {
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客P获取绑定结果和绑定凭证", priority = 28)
@Test(description = "访客P获取绑定结果和绑定凭证", priority = 31)
public void 访客P获取绑定结果和绑定凭证() {
visitorAuth16();
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String)data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "访客P根据绑定凭证发放抽奖码", priority = 29)
public void 访客P根据绑定凭证发放抽奖码() {
@Test(description = "用户P给用户H助力", priority = 32)
public void 用户P给用户H助力() {
visitorAuth16();
ThreadSleepUtils.sleep(2000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",7);
infoParam.put("confId",ConfId);
Response response = network.postResponse(infoParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户P给用户H助力失败", response.body().asString()));
}
@Test(description = "访客Q邀请关系绑定", priority = 30)
@Test(description = "访客Q邀请关系绑定", priority = 33)
public void 访客Q邀请关系绑定() {
visitorAuth17();
Map<String, Object> bindingParam = new HashMap<>();
......@@ -470,35 +508,34 @@ public class Treasure implements AdminAuthorization {
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客Q获取绑定结果和绑定凭证", priority = 31)
@Test(description = "访客Q获取绑定结果和绑定凭证", priority = 34)
public void 访客Q获取绑定结果和绑定凭证() {
visitorAuth17();
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String)data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "访客Q根据绑定凭证发放抽奖码", priority = 32)
public void 访客Q根据绑定凭证发放抽奖码() {
@Test(description = "用户Q给用户H助力", priority = 35)
public void 用户Q给用户H助力() {
visitorAuth17();
ThreadSleepUtils.sleep(2000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",7);
infoParam.put("confId",ConfId);
Response response = network.postResponse(infoParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户Q给用户H助力失败", response.body().asString()));
}
@Test(description = "访客H查询第1次参与详情的进度显示", priority = 33)
@Test(description = "访客H查询第1次参与详情的进度显示", priority = 36)
public void 访客H查询第1次参与详情的进度显示() {
visitorAuth9();
Map<String, Object> InfoParam = new HashMap<>();
......@@ -512,13 +549,14 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客H开启第1轮宝箱获得实物", priority = 34)
@Test(description = "访客H开启第1轮宝箱获得实物", priority = 37)
public void 访客H开启第1轮宝箱获得实物() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> openParam = new HashMap<>();
openParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
openParam.put("treasureConfId",ConfId);
openParam.put("openTimes", 1);
Response response = network.postResponse(openParam, BasicConfig.MANAGER_openTreasure);
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus);
......@@ -526,12 +564,13 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客H第1轮开宝箱参与详情", priority = 35)
@Test(description = "访客H第1轮开宝箱参与详情", priority = 38)
public void 访客H1轮开宝箱参与详情() {
visitorAuth9();
ThreadSleepUtils.sleep(2000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("treasureConfId",ConfId);
infoParam.put("openTimes", 1);
Response response = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType =response.jsonPath().getInt("data.treasureType");
System.out.println(treasureType);
......@@ -545,7 +584,7 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客H第2次参与详情的进度显示", priority = 36)
@Test(description = "访客H第2次参与详情的进度显示", priority = 39)
public void 访客H2次参与详情的进度显示() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
......@@ -559,13 +598,14 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客H开启第2轮宝箱降级抽奖码", priority = 37)
@Test(description = "访客H开启第2轮宝箱降级抽奖码", priority = 40)
public void 访客H开启第2轮宝箱降级抽奖码() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> openParam = new HashMap<>();
openParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
openParam.put("treasureConfId",ConfId);
openParam.put("openTimes", 2);
Response response = network.postResponse(openParam, BasicConfig.MANAGER_openTreasure);
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus);
......@@ -574,12 +614,13 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客H第2轮开宝箱参与详情", priority = 38)
@Test(description = "访客H第2轮开宝箱参与详情", priority = 41)
public void 访客H2轮开宝箱参与详情() {
visitorAuth9();
ThreadSleepUtils.sleep(2000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("treasureConfId",ConfId);
infoParam.put("openTimes", 2);
Response response = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType=response.jsonPath().getInt("data.treasureType");
System.out.println(treasureType);
......@@ -593,7 +634,7 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "宝箱实物中奖无限制", priority = 39)
@Test(description = "宝箱实物中奖无限制", priority = 42)
public void 宝箱实物中奖无限制() {
JSONObject treasureAward = treasureConf.getJSONObject("treasureAward");
treasureAward.put("winLimitCount",-1);//-1无限制,1限制1次
......@@ -604,7 +645,7 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客H第3次参与详情的进度显示", priority = 40)
@Test(description = "访客H第3次参与详情的进度显示", priority = 43)
public void 访客H3次参与详情的进度显示() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
......@@ -617,13 +658,14 @@ public class Treasure implements AdminAuthorization {
Assert.assertTrue(invitationNum>0, network.message(InfoParam, BasicConfig.MANAGER_treasureUserInfo, "查询第3次参与详情进度失败", response.body().asString()));
}
@Test(description = "访客H开启第3轮宝箱获得实物", priority = 41)
@Test(description = "访客H开启第3轮宝箱获得实物", priority = 44)
public void 访客H开启第3轮宝箱获得实物() {
visitorAuth9();
ThreadSleepUtils.sleep(3000);
Map<String, Object> openParam = new HashMap<>();
openParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
openParam.put("treasureConfId",ConfId);
openParam.put("openTimes", 3);
Response response = network.postResponse(openParam, BasicConfig.MANAGER_openTreasure);
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus);
......@@ -631,12 +673,13 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客H第3轮开宝箱参与详情", priority = 42)
@Test(description = "访客H第3轮开宝箱参与详情", priority = 45)
public void 访客H3轮开宝箱参与详情() {
visitorAuth9();
ThreadSleepUtils.sleep(2000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("treasureConfId",ConfId);
infoParam.put("openTimes", 3);
Response response = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType=response.jsonPath().getInt("data.treasureType");
System.out.println(treasureType);
......@@ -650,21 +693,20 @@ public class Treasure implements AdminAuthorization {
//B 用户邀请
@Test(description = "访客M分享直播间", priority = 43)
public void 访客M分享直播间() {
@Test(description = "访客M获取分享加密串", priority = 46)
public void 访客M获取分享加密串() {
visitorAuth13();
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 2);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_GETSHARESIGN);
HashMap data = signRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.shareSign = (String)data.get("shareSign");
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_GETSHARESIGN, "分享失败", signRes.body().asString()));
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "访客M与访客N邀请关系绑定", priority = 44)
@Test(description = "访客M与访客N邀请关系绑定", priority = 47)
public void 访客M与访客N邀请关系绑定() {
visitorAuth14();
Map<String, Object> bindingParam = new HashMap<>();
......@@ -676,34 +718,34 @@ public class Treasure implements AdminAuthorization {
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客N获取绑定结果和绑定凭证", priority = 45)
@Test(description = "访客N获取绑定结果和绑定凭证", priority = 48)
public void 访客N获取绑定结果和绑定凭证() {
visitorAuth14();
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String)data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "访客N根据绑定凭证发放抽奖码", priority = 46)
public void 访客N根据绑定凭证发放抽奖码() {
@Test(description = "访客N给访客M助力", priority = 49)
public void 访客N给访客M助力() {
visitorAuth14();
ThreadSleepUtils.sleep(2000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",7);
infoParam.put("confId",ConfId);
Response response = network.postResponse(infoParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "访客N给访客M助力失败", response.body().asString()));
}
@Test(description = "访客M与访客R邀请关系绑定", priority = 47)
@Test(description = "访客M与访客R邀请关系绑定", priority = 50)
public void 访客M与访客R邀请关系绑定() {
visitorAuth18();
Map<String, Object> bindingParam = new HashMap<>();
......@@ -715,35 +757,35 @@ public class Treasure implements AdminAuthorization {
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客R获取绑定结果和绑定凭证", priority = 48)
@Test(description = "访客R获取绑定结果和绑定凭证", priority = 51)
public void 访客R获取绑定结果和绑定凭证() {
visitorAuth18();
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String)data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "访客R根据绑定凭证发放抽奖码", priority = 49)
public void 访客R根据绑定凭证发放抽奖码() {
visitorAuth14();
ThreadSleepUtils.sleep(2000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
@Test(description = "访客R给访客M助力", priority = 52)
public void 访客R给访客M助力() {
visitorAuth18();
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",7);
infoParam.put("confId",ConfId);
Response response = network.postResponse(infoParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "访客R给访客M助力失败", response.body().asString()));
}
//验证实物奖品数量是否会超发
@Test(description = "访客H第4次参与详情的进度显示", priority = 50)
@Test(description = "访客H第4次参与详情的进度显示", priority = 53)
public void 访客H4次参与详情的进度显示() {
visitorAuth9();
Map<String, Object> InfoParam = new HashMap<>();
......@@ -756,7 +798,7 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客M第1次参与详情的进度显示", priority = 51)
@Test(description = "访客M第1次参与详情的进度显示", priority = 54)
public void 访客M1次参与详情的进度显示() {
visitorAuth13();
Map<String, Object> InfoParam = new HashMap<>();
......@@ -770,20 +812,22 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "开启第4轮宝箱实物是否超发", priority = 52)
public void 开启第4轮宝箱实物是否超发() {
@Test(description = "访客H和访客M开启第4轮宝箱实物是否超发", priority = 55)
public void 访客H和访客M开启第4轮宝箱实物是否超发() {
ThreadSleepUtils.sleep(3000);
Map<String, Object> openParam = new HashMap<>();
openParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
openParam.put("treasureConfId",ConfId);
visitorAuth9();
openParam.put("openTimes", 4);
Response response = network.postResponse(openParam, BasicConfig.MANAGER_openTreasure);
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus);
Assert.assertTrue(receiveStatus==0, network.message(openParam, BasicConfig.MANAGER_openTreasure, "开启第4轮宝箱失败", response.body().asString()));
visitorAuth13();
openParam.put("openTimes", 1);
Response response1 = network.postResponse(openParam, BasicConfig.MANAGER_openTreasure);
int receiveStatus1 =response1.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus1);
......@@ -792,12 +836,13 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "查询访客H第4轮开宝箱参与详情", priority = 53)
public void 查询访客H4轮开宝箱参与详情() {
@Test(description = "访客H和访客M第4轮开宝箱参与详情", priority = 56)
public void 访客H和访客M4轮开宝箱参与详情() {
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("treasureConfId", ConfId);
visitorAuth9();
infoParam.put("openTimes", 4);
ThreadSleepUtils.sleep(3000);
Response response = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType=response.jsonPath().getInt("data.treasureType");
......@@ -810,6 +855,7 @@ public class Treasure implements AdminAuthorization {
visitorAuth13();
infoParam.put("openTimes", 1);
Response responseB = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType1=responseB.jsonPath().getInt("data.treasureType");
System.out.println(treasureType1);
......@@ -823,7 +869,7 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "宝箱红包限制1次", priority = 54)
@Test(description = "宝箱红包限制1次", priority = 57)
public void 宝箱红包限制1() {
JSONObject treasureRed = treasureConf.getJSONObject("treasureRed");
......@@ -838,7 +884,7 @@ public class Treasure implements AdminAuthorization {
}
//访客A领取红包
@Test(description = "访客H第5次参与详情的进度显示", priority = 55)
@Test(description = "访客H第5次参与详情的进度显示", priority = 58)
public void 访客H5次参与详情的进度显示() {
visitorAuth9();
Map<String, Object> InfoParam = new HashMap<>();
......@@ -850,13 +896,14 @@ public class Treasure implements AdminAuthorization {
Assert.assertTrue(invitationNum>0, network.message(InfoParam, BasicConfig.MANAGER_treasureUserInfo, "查询第5次参与详情进度失败", response.body().asString()));
}
@Test(description = "访客H开启第5次宝箱获得红包", priority = 56)
@Test(description = "访客H开启第5次宝箱获得红包", priority = 59)
public void 访客H开启第5次宝箱获得红包() {
visitorAuth9();
ThreadSleepUtils.sleep(15000);
Map<String, Object> openParam = new HashMap<>();
openParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
openParam.put("treasureConfId",ConfId);
openParam.put("openTimes", 5);
Response response = network.postResponse(openParam, BasicConfig.MANAGER_openTreasure);
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus);
......@@ -865,12 +912,13 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客H第5轮开宝箱参与详情", priority = 57)
@Test(description = "访客H第5轮开宝箱参与详情", priority = 60)
public void 访客H5轮开宝箱参与详情() {
visitorAuth9();
ThreadSleepUtils.sleep(2000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("treasureConfId",ConfId);
infoParam.put("openTimes", 5);
Response response = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType=response.jsonPath().getInt("data.treasureType");
System.out.println(treasureType);
......@@ -884,7 +932,7 @@ public class Treasure implements AdminAuthorization {
//访客A降级抽奖码
@Test(description = "访客H第6次参与详情的进度显示", priority = 58)
@Test(description = "访客H第6次参与详情的进度显示", priority = 61)
public void 访客H6次参与详情的进度显示() {
visitorAuth9();
Map<String, Object> InfoParam = new HashMap<>();
......@@ -896,13 +944,14 @@ public class Treasure implements AdminAuthorization {
Assert.assertTrue(invitationNum>0, network.message(InfoParam, BasicConfig.MANAGER_treasureUserInfo, "查询第6次参与详情进度失败", response.body().asString()));
}
@Test(description = "访客H开启第6次宝箱降级抽奖码", priority = 59)
@Test(description = "访客H开启第6次宝箱降级抽奖码", priority = 62)
public void 访客H开启第6次宝箱降级抽奖码() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> openParam = new HashMap<>();
openParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
openParam.put("treasureConfId",ConfId);
openParam.put("openTimes", 6);
Response response = network.postResponse(openParam, BasicConfig.MANAGER_openTreasure);
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus);
......@@ -910,12 +959,13 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客H第6轮开宝箱参与详情", priority = 60)
@Test(description = "访客H第6轮开宝箱参与详情", priority = 63)
public void 访客H6轮开宝箱参与详情() {
visitorAuth9();
ThreadSleepUtils.sleep(2000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("treasureConfId",ConfId);
infoParam.put("openTimes", 6);
Response response = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType=response.jsonPath().getInt("data.treasureType");
System.out.println(treasureType);
......@@ -928,21 +978,21 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客N分享直播间", priority = 61)
public void 访客N分享直播间() {
@Test(description = "访客N获取分享加密串", priority = 64)
public void 访客N获取分享加密串() {
visitorAuth14();
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 2);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_GETSHARESIGN);
HashMap data = signRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.shareSign = (String)data.get("shareSign");
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_GETSHARESIGN, "分享失败", signRes.body().asString()));
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "访客N与访客O邀请关系绑定", priority = 62)
@Test(description = "访客N与访客O邀请关系绑定", priority = 65)
public void 访客N与访客O邀请关系绑定() {
visitorAuth15();
Map<String, Object> bindingParam = new HashMap<>();
......@@ -954,36 +1004,36 @@ public class Treasure implements AdminAuthorization {
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客O获取绑定结果和绑定凭证", priority = 63)
@Test(description = "访客O获取绑定结果和绑定凭证", priority = 66)
public void 访客O获取绑定结果和绑定凭证() {
visitorAuth15();
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);
HashMap data = tokenRes.jsonPath().getJsonObject("data");
System.out.println(data);
this.token = (String)data.get("token");
System.out.println(token);
Assert.assertNotNull(this.token, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
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 = "访客O根据绑定凭证发放抽奖码", priority = 64)
public void 访客O根据绑定凭证发放抽奖码() {
@Test(description = "访客O给访客N助力", priority = 67)
public void 访客O给访客N助力() {
visitorAuth15();
ThreadSleepUtils.sleep(2000);
Map<String, Object> codeParam = new HashMap<>();
codeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
codeParam.put("token", token);
Response codeRes = network.getResponse(codeParam, BasicConfig.MOBILE_Code);
boolean success = codeRes.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(codeParam, BasicConfig.MOBILE_Code, "发放抽奖码失败", codeRes.body().asString()));
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign);
infoParam.put("shareType",7);
infoParam.put("confId",ConfId);
Response response = network.postResponse(infoParam, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "访客O给访客N助力失败", response.body().asString()));
}
//访客M和N同时抢红包
@Test(description = "访客M参与详情的进度显示", priority = 65)
@Test(description = "访客M参与详情的进度显示", priority = 68)
public void 访客M参与详情的进度显示() {
visitorAuth13();
Map<String, Object> InfoParam = new HashMap<>();
......@@ -996,7 +1046,7 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客N参与详情的进度显示", priority = 66)
@Test(description = "访客N参与详情的进度显示", priority = 69)
public void 访客N参与详情的进度显示() {
visitorAuth14();
Map<String, Object> InfoParam = new HashMap<>();
......@@ -1010,19 +1060,21 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客M和访客N同时开启宝箱验证红包是否超发", priority = 67)
@Test(description = "访客M和访客N同时开启宝箱验证红包是否超发", priority = 70)
public void 访客M和访客N同时开启宝箱验证红包是否超发() {
Map<String, Object> openParam = new HashMap<>();
openParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
openParam.put("treasureConfId",ConfId);
visitorAuth13();
openParam.put("openTimes", 2);
Response response = network.postResponse(openParam, BasicConfig.MANAGER_openTreasure);
int receiveStatus =response.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus);
Assert.assertTrue(receiveStatus==0, network.message(openParam, BasicConfig.MANAGER_openTreasure, "开启第4轮宝箱失败", response.body().asString()));
visitorAuth14();
openParam.put("openTimes", 1);
Response response1 = network.postResponse(openParam, BasicConfig.MANAGER_openTreasure);
int receiveStatus1 =response1.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus1);
......@@ -1032,12 +1084,13 @@ public class Treasure implements AdminAuthorization {
@Test(description = "访客M和访客N第7轮开宝箱参与详情", priority = 68)
@Test(description = "访客M和访客N第7轮开宝箱参与详情", priority = 71)
public void 访客M和访客N7轮开宝箱参与详情() {
ThreadSleepUtils.sleep(3000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("treasureConfId",ConfId);
visitorAuth13();
infoParam.put("openTimes", 2);
Response response = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType=response.jsonPath().getInt("data.treasureType");
System.out.println(treasureType);
......@@ -1049,6 +1102,7 @@ public class Treasure implements AdminAuthorization {
visitorAuth14();
infoParam.put("openTimes", 1);
Response response1 = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType1=response1.jsonPath().getInt("data.treasureType");
System.out.println(treasureType1);
......@@ -1060,7 +1114,7 @@ public class Treasure implements AdminAuthorization {
}
@Test(description = "访客H宝箱领取记录", priority = 69)
@Test(description = "访客H宝箱领取记录", priority = 72)
public void 访客H宝箱领取记录() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
......
......@@ -38,18 +38,25 @@ public class BasicConfig {
public static String VISITORKEY11 ="LEH7epeHVDJWzhZ6DiexTHnsaP1qQtqg4bchCs73vvVo9tdZjkmmjNMWkCsgrygU4cJaXfwzr7j51EK9Xcxdt2YdXnQjU";
//直播访客 (饺子)ID:97
public static String VISITORKEY12 ="5MgSyboxqzAQZZJEsTf43nVX38FgyAUo2fAxaP2wGJUTHcnhCNQ6xm4rZ8nMSjRk2BTsYwRhe1kABXuFmTA7JsepCEpa";
//直播访客 (大妹子保险)ID:102
public static String VISITORKEY13 ="LEH7epeHVDJWzhZ6DiexTHnsaP1qN9UZzYqpqzJA2Rdew611Z1Jx5JYQdByks4WNm9sPEYEcPjPWGB332v28BWjXfbFHf";
//直播访客 (光头强)ID:173
public static String VISITORKEY14 ="LEH7epeHVDJWzhZ6DiexTHnsaP1qN9UaB5Y7kQYL8TWRUMmAdzUP34yhV8w3PVg4uV5rxYeuetNdSU1HkUJ84QzXYYSF1";
//直播访客 (少侠)ID:79
public static String VISITORKEY15 ="5MgSyboxqzAQZZJEsTf43nVX38FgxYNfSo46ZMTRoniw9Rwh4vcC4373uQZR8B4f7re8nYAH3ePzUamTSWp57TLkhYGM";
//直播访客 (大妹子)ID:299
public static String VISITORKEY13 ="LEH7epeHVDJWzhZ6DiexTHnsaN9w9oWNN5DjmEBUV6rxQBX1gPqEDy6fBAMhJF4ZNUHR681CqgJaAwkQttsd8aB5WdCDf";
//直播访客 (光头强)ID:540
public static String VISITORKEY14 ="LEH7epeHVDJWzhZ6DiexTHnsaN9w9oWNUSEzLEnhXW7GvsDSbF1XDBJeeBRLp1u37nEXDs6aRhV7i8uxwJSKdaMFDutDp";
//直播访客 (少侠)ID:788
public static String VISITORKEY15 ="LEH7epeHVDJWzhZ6DiexTHnsaN9w9oWNQGsjS7kCzWj4MRh8UEgj65qMf774qQKtXQCskA56o29SkFTd6Zvc82mKjQ2P1";
//直播访客 (抬头有飞碟)ID:99
public static String VISITORKEY16 ="5MgSyboxqzAQZZJEsTf43nVX38FgxYNfT62QtXBfd44D2QpfhS1MHjzggYiRmLtzAqHLps4SB7m5PsqQQYkjS7hcPHSu";
//直播访客 (枫城)ID:77
public static String VISITORKEY17 ="5MgSyboxqzAQZZJEsTf43nVX38FgxYNfR7C5mkWn1EaJAymDPCSQyz3eaqsq7Wn47NU1cUqKXMHSEEbHfhXiv9Bq6XCc";
//直播访客 (小老弟来了)ID:94
public static String VISITORKEY18 ="5MgSyboxqzAQZZJEsTf43nVX38FgxYNfQ9pD69dnWxFV6NvpU2hiZ9J5kVEeFYdcviUxqNs5i37hvQEzCtzqhr7ywbwq";
//直播访客 (小老弟来了)ID:726
public static String VISITORKEY18 ="LEH7epeHVDJWzhZ6DiexTHnsaN9w9oXAbLLH4y37kY1Bh1zjcGqq8H65TzBAApa8c4h8PYXwogLPa8swFPNEpBqgqBRPH";
//直播访客 (林国芸)ID:786
public static String visitorAuth19 ="LEH7epeHVDJWzhZ6DiexTHnsaN9w9oXAUTTB6fYfPQ57LstgL84LnTWTZRadaM23vPXd7x2Q8Dos7RdCpWYg9AcJeUDz5";
//直播访客 (孙心桂)ID:785
public static String visitorAuth20 ="LEH7epeHVDJWzhZ6DiexTHnsaN9w9oXATWauEgZhrnVmFDGYrbyvfbCiHrAsmpMp7LRpUYvHTCCVYrfQJZZZeAGXs5q9B";
//直播访客 (谢翊美)ID:791
public static String visitorAuth21 ="LEH7epeHVDJWzhZ6DiexTHnsaN9w9oX4LYmRiH4EYLayw7oTtnaZ4YpLUcVaMTnAUuz5jSPcnRQgDm7R2XRS6AQgJqtta";
//***********************************************************************
// 基础线代理人 TKU
......@@ -91,13 +98,26 @@ public class BasicConfig {
public static final String MANAGER_detail_1 = MANAGER_HOST + "/kjy/manager/red/guess/detail";
public static final String MANAGER_del_1 = MANAGER_HOST + "/kjy/manager/red/guess/delete";
//助播端
public static final String MOBILE_guessList = MOBILE_HOST + "/conf/live/red/guess/list";
public static final String MOBILE_saveOrUpdate2 = MOBILE_HOST + "/conf/live/red/guess/saveOrUpdate";
public static final String MOBILE_detail1 = MOBILE_HOST + "/conf/live/red/guess/detail";
public static final String MOBILE_startOrEnd = MOBILE_HOST + "/conf/live/red/guess/startOrEnd";
public static final String MOBILE_saveOrUpdate = MOBILE_HOST + "/conf/pre/red/guess/saveOrUpdate";
public static final String MOBILE_findDetail = MOBILE_HOST + "/conf/pre/red/findDetail";
public static final String MOBILE_list = MOBILE_HOST + "/conf/pre/red/guess/list";
public static final String MOBILE_detail = MOBILE_HOST + "/conf/pre/red/guess/detail";
public static final String MOBILE_delete = MOBILE_HOST + "/conf/pre/red/guess/delete";
public static final String MOBILE_confDetail = MOBILE_HOST + "/clue/guess/number/red/confDetail";
public static final String MOBILE_userDetail = MOBILE_HOST + "/clue/guess/number/red/userDetail";
public static final String MOBILE_guess = MOBILE_HOST + "/clue/guess/number/red/guess";
public static final String MOBILE_open= MOBILE_HOST + "/clue/guess/number/red/open";
public static final String MOBILE_result = MOBILE_HOST + "/clue/guess/number/red/result";
// public static final String MOBILE_ = MOBILE_HOST + "";
// public static final String MOBILE_ = MOBILE_HOST + "";
// public static final String MOBILE_ = MOBILE_HOST + "";
// *************** 宝箱裂变 ***************
public static final String MANAGER_getList4Admin = MANAGER_HOST + "/kjy/manager/welfare/pre/conf/getList4Admin";
......@@ -114,10 +134,25 @@ public class BasicConfig {
public static final String MANAGER_participateList = MOBILE_HOST + "/kjy/live/treasure/participateList";
// *************** 宝箱停留时长 ***************
// *************** 助力分享 ***************
public static final String MOBILE_sign = MOBILE_HOST + "/kjy/live/share/help/sign";
public static final String MOBILE_simple = MOBILE_HOST + "/kjy/live/help/simple";
public static final String MOBILE_info = MOBILE_HOST + "/kjy/live/help/info";
public static final String MOBILE_helpInfo = MOBILE_HOST + "/kjy/live/share/help/info";
public static final String MOBILE_assist = MOBILE_HOST + "/kjy/live/help/assist";
// *************** 时长宝箱 ***************
public static final String MANAGER_list1 = MANAGER_HOST + "/kjy/manager/treasure/time/conf/list";
public static final String MANAGER_detail1 = MANAGER_HOST + "/kjy/manager/treasure/time/conf/detail";
public static final String MANAGER_update1 = MANAGER_HOST + "/kjy/manager/treasure/time/conf/update";
public static final String MOBILE_timeDetail = MOBILE_HOST + "/kjy/live/treasure/time/detail";
public static final String MOBILE_joinDetail = MOBILE_HOST + "/kjy/live/treasure/time/joinDetail/simple";
public static final String MOBILE_finish = MOBILE_HOST + "/kjy/live/treasure/time/finish";
public static final String MOBILE_joinDetail1 = MOBILE_HOST + "/kjy/live/treasure/time/joinDetail";
public static final String MOBILE_treasureOpen = MOBILE_HOST + "/kjy/live/treasure/time/open";
public static final String MOBILE_joinResult = MOBILE_HOST + "/kjy/live/treasure/time/joinResult";
// *************** 代理人指定中奖 ***************
......@@ -190,9 +225,11 @@ public class BasicConfig {
public static final String MANAGER_rewardList = MANAGER_HOST + "/kjy/manager/live/ques/reward/list";
public static final String MANAGER_delete = MANAGER_HOST + "/kjy/manager/live/ques/reward/delete";
public static final String MANAGER_update = MANAGER_HOST + "/kjy/manager/live/ques/reward/update";
public static final String MANAGER_TreasureBenefits = MANAGER_HOST + "/kjy/manager/treasure/time/conf/list";
public static final String MANAGER_TreasureDetail = MANAGER_HOST + "/kjy/manager/treasure/time/conf/detail";
public static final String MANAGER_TreasureConUpdate = MANAGER_HOST + "/kjy/manager/treasure/time/conf/update";
//小程序分享
public static final String MANAGER_saveOrUpdateMpShare = MANAGER_HOST + "/kjy/manager/live/share/saveOrUpdateMpShare";
public static final String MANAGER_ = MANAGER_HOST + "";
// public static final String MANAGER_ = MANAGER_HOST + "";
// *************** 代理人 ***************
//代理人列表//
......@@ -238,6 +275,8 @@ public class BasicConfig {
public static final String MOBILE_Code = MOBILE_HOST + "/clue/invitation/code";
public static final String MOBILE_MyLotteryCode = MOBILE_HOST + "/kjy/live/lottery/myLotteryCode";
//投票
public static final String MOBILE_ChoiceCurrentDetail = MOBILE_HOST + "/conf/live/choice/currentDetail";
public static final String MOBILE_AddChoice = MOBILE_HOST + "/conf/live/choice/addChoice";
......
......@@ -3,6 +3,7 @@ package com.kjj.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.kjj.bean.manager.GuessList;
import groovy.json.JsonBuilder;
import io.restassured.response.Response;
......
......@@ -19,6 +19,12 @@
</classes>
</test>
<test preserve-order="true" name="小程序分享">
<classes>
<class name="com.kjj.cases.live.manager.Share"/>
</classes>
</test>
<test preserve-order="true" name="获取抽奖码校验">
<classes>
<class name="com.kjj.cases.live.LotteryCode.LotteryCode"/>
......@@ -37,7 +43,6 @@
</classes>
</test>
<test preserve-order="true" name="宝箱时长">
<classes>
<class name="com.kjj.cases.live.manager.TreasureTime"/>
......@@ -102,6 +107,7 @@
</classes>
</test>
<test preserve-order="true" name="助播-开启直播">
<classes>
<class name="com.kjj.cases.live.anchor.OpenLive"/>
......@@ -119,6 +125,13 @@
<class name="com.kjj.cases.live.lottery.Lottery"/>
</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.FreeReward.FreeReward"/>
......@@ -171,6 +184,12 @@
</classes>
</test>
<test preserve-order="true" name="直播中时长宝箱">
<classes>
<class name="com.kjj.cases.live.lottery.TreasureTime"/>
</classes>
</test>
<test preserve-order="true" name="助播-结束直播">
<classes>
<class name="com.kjj.cases.live.anchor.CloseLive"/>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment