Commit 7f0d770b authored by xiamengchen's avatar xiamengchen

Merge branch 'master' into feat/20211014-xmc

parents c615f189 0936b8b4
......@@ -81,7 +81,7 @@ public interface Authorization {
}
//访客A(志勇)授权,代理人指定中奖用户,ID:107
default void visitorAuth() {
default void visitorAuth1() {
network.agentCookies.put("authKey", visitorAuth);
System.out.println("用户AUTH_KEY:" + visitorAuth);
}
......
......@@ -15,7 +15,7 @@ public class Potential implements Authorization {
public String bizConfId;
@BeforeClass
public void setUp() { visitorAuth(); }
public void setUp() { visitorAuth1(); }
@Test(description = "直播间名片", priority =1)
public void 直播间名片() {
......
......@@ -5,17 +5,14 @@ import com.alibaba.fastjson.JSONObject;
import com.kjj.bean.manager.EvaluationDetail;
import com.kjj.bean.resources.*;
import com.kjj.cases.admin.Authorization;
import com.kjj.cases.live.liveConfig.EvaluationConf;
import com.kjj.cases.live.liveConfig.LiveMaterial;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.BaseUtils;
import com.kjj.utils.IdMakeUtil;
import com.kjj.utils.JsonUtil;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.*;
......@@ -71,7 +68,7 @@ public class LiveVisitors implements Authorization
public void 访客端权益列表()
{
ThreadSleepUtils.sleep(3000);
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_Resource);
......@@ -111,7 +108,7 @@ public class LiveVisitors implements Authorization
@Test(description = "访客端表单资料查询", priority = 4)
public ResourceForm 访客端系统表单资料查询()
{
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("confId",confId_form);
Response response = network.getResponse(params, BasicConfig.MOBILE_Form);
......@@ -126,7 +123,7 @@ public class LiveVisitors implements Authorization
@Test(description = "访客端表单资料提交", priority = 5)
public void 访客端系统表单资料提交()
{
visitorAuth();
visitorAuth1();
ResourceForm list = 访客端系统表单资料查询();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_form);
......@@ -168,7 +165,7 @@ public class LiveVisitors implements Authorization
@Test(description = "访客端免费领资料查询", priority = 7)
public void 访客端免费领资料查询()
{
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_free);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -182,7 +179,7 @@ public class LiveVisitors implements Authorization
@Test(description = "访客端免费领资料领取", priority = 8)
public void 访客端免费领资料领取()
{
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_free);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -212,7 +209,7 @@ public class LiveVisitors implements Authorization
/*访客端参与测试权益*/
@Test(description = "访客端获取测试权益详情", priority = 10)
public void 访客端获取测试权益详情() {
visitorAuth();
visitorAuth1();
ThreadSleepUtils.sleep(3000);
Map<String, Object> evaDetailPar = new HashMap<>();
evaDetailPar.put("confId", confId_eva);
......@@ -311,7 +308,7 @@ public class LiveVisitors implements Authorization
@Test(description = "访客领取关联测试表单", priority = 16)
public void 访客领取关联测试表单() {
visitorAuth();
visitorAuth1();
ResourceForm list = 访客端系统表单资料查询();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_formWithEva);
......@@ -337,7 +334,7 @@ public class LiveVisitors implements Authorization
@Test(description = "访客端获取关联测试表单权益详情", priority = 17)
public void 访客端获取关联测试表单权益详情() {
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("confId",confId_formWithEva);
Response response = network.getResponse(params, BasicConfig.MOBILE_Form);
......@@ -356,7 +353,7 @@ public class LiveVisitors implements Authorization
@Test(description = "访客端获取关联测试免费领权益详情", priority = 18)
public void 访客端获取关联测试免费领权益详情() {
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_freeWithEva);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -377,7 +374,7 @@ public class LiveVisitors implements Authorization
@Test(description = "领取关联测试免费领", priority = 19)
public void 领取关联测试免费领() {
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_freeWithEva);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -392,7 +389,7 @@ public class LiveVisitors implements Authorization
@Test(description = "访客端链接资料查询", priority = 20)
public void 访客端链接小程序资料查询()
{
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_link);
Response response = network.getResponse(params, BasicConfig.MOBILE_Link1);
......@@ -406,7 +403,7 @@ public class LiveVisitors implements Authorization
@Test(description = "访客端链接资料领取", priority = 21)
public void 访客端链接小程序资料领取()
{
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("confId", confId_link);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -533,7 +530,7 @@ public class LiveVisitors implements Authorization
public void 访客获取贴片信息()
{
ThreadSleepUtils.sleep(1000);
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_pasterInfo);
......
......@@ -3,11 +3,13 @@ import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.ThreadSleepUtils;
import com.sun.org.apache.xalan.internal.xsltc.trax.XSLTCSource;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
......@@ -23,7 +25,7 @@ public class OpenLive implements Authorization {
@Test(description = "结束直直播中或断流中的场次", priority = 1)
public void 结束直直播中或断流中的场次() {
int totalCount2 = 0;
long liveid = 0L;
long liveId = 0L;
Map<String, Object> ConfDetailParam = new HashMap<>();
ConfDetailParam.put("companyId", 101);
ConfDetailParam.put("liveStatus", 3);
......@@ -41,16 +43,16 @@ public class OpenLive implements Authorization {
totalCount2 = ConfDetailRes.jsonPath().getInt("data.totalCount");
if (totalCount2 == 1) {
System.out.println("有一场直播正在直播中");
liveid = ConfDetailRes.jsonPath().getLong("data.list.get(0).id");
liveId = ConfDetailRes.jsonPath().getLong("data.list.get(0).id");
}
}else{
System.out.println("有一场直播正在断流中");
liveid = ConfDetailRes.jsonPath().getLong("data.list.get(0).id");
liveId = ConfDetailRes.jsonPath().getLong("data.list.get(0).id");
}
if(totalCount1 == 1 || totalCount2 == 1){
adminAuth();
Map<String, Object> closeParam = new HashMap<>();
closeParam.put("liveid", liveid);
closeParam.put("liveid", liveId);
closeParam.put("cid", 101);
Response closeRes = network.postResponse(closeParam, BasicConfig.ANCHOR_CLOSE);
Object data = closeRes.jsonPath().getJsonObject("data");
......@@ -82,4 +84,52 @@ public class OpenLive implements Authorization {
Assert.assertNotNull(data, network.message(openParam, BasicConfig.ANCHOR_OPEN, "开启直播失败", openRes.body().asString()));
ThreadSleepUtils.sleep(10000);
}
public void connectSuccess() {
Map<String, Object> connectSuccessParam = new HashMap<>();
connectSuccessParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(connectSuccessParam, BasicConfig.USER_connectSuccess);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", response.body().asString()));
}
@Test(description = "用户到场", priority = 3)
public void 用户到场() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
agentAuth();
connectSuccess();
visitorAuth1();
connectSuccess();
visitorAuth2();
connectSuccess();
visitorAuth3();
connectSuccess();
visitorAuth4();
connectSuccess();
visitorAuth5();
connectSuccess();
visitorAuth6();
connectSuccess();
visitorAuth7();
connectSuccess();
visitorAuth8();
connectSuccess();
visitorAuth9();
connectSuccess();
visitorAuth10();
connectSuccess();
visitorAuth11();
connectSuccess();
}
}
......@@ -105,7 +105,7 @@ public class Choice implements Authorization {
public void 访客端获取正在答题中的选择题()
{
ThreadSleepUtils.sleep(5000);
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_GetChoiceQuestion);
......@@ -122,7 +122,7 @@ public class Choice implements Authorization {
@Test(description = "访客端提交答案", priority = 6)
public void 访客端提交答案()
{
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("answerId", answerid);
......@@ -137,7 +137,7 @@ public class Choice implements Authorization {
@Test(description = "访客端获取答案的数量", priority = 7)
public void 访客端获取答案的数量()
{
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("questionId", questionid);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......
......@@ -3,7 +3,6 @@ package com.kjj.cases.live.customer;
import com.kjj.cases.admin.Authorization;
import com.kjj.cases.live.agent.Agent;
import com.kjj.cases.live.anchor.LiveVisitors;
import com.kjj.cases.live.liveConfig.LiveMaterial;
import com.kjj.cases.live.lottery.Lottery;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
......@@ -21,7 +20,7 @@ public class AfterLive implements Authorization {
private String encodeLiveId;
@BeforeClass
public void SetUp(){ visitorAuth(); }
public void SetUp(){ visitorAuth1(); }
// 获取访客直播结束页样式
@Test(description = "获取访客直播结束页样式", priority = 1)
......
......@@ -28,7 +28,8 @@ public class PersonalPage implements Authorization {
private String sourceRecordId; // 资料领取记录id
@BeforeClass
public void setUp(){visitorAuth();
public void setUp(){
visitorAuth1();
BaseUtils.ssoLogin();
}
......
......@@ -25,90 +25,6 @@ public class FlipCard implements Authorization {
/**
* 翻牌集字活动配置
*/
/*
@Test(description = "保存翻牌配置", priority = 1)
public void 保存翻牌配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("amount", 1000);
Params.put("helpNum", 1);
Params.put("num",2);
Params.put("showAmount",1000);
Params.put("showMaxAmount",1000);
Params.put("poolType",1);
Params.put("openSceneType",1);
Params.put("freeNum",1);
Response response = network.postResponse(Params, BasicConfig.MANAGER_flipWord);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_flipWord, "保存翻牌配置失败", response.body().asString()));
}
@Test(description = "查看直播翻牌配置详情", priority = 2)
public void 查看直播翻牌配置详情() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(Params, BasicConfig.MANAGER_wordDetail);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(Params, BasicConfig.MANAGER_wordDetail, "查看直播翻牌配置详情失败", response.body().asString()));
}
@Test(description = "开启翻牌配置", priority = 3)
public void 开启翻牌配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("confStatus",2);
Response response = network.postResponse(Params, BasicConfig.MANAGER_wordSwitchStatus);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_wordSwitchStatus, "开启翻牌配置失败", response.body().asString()));
}
@Test(description = "查看直播配置", priority = 4)
public void 查看直播配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(Params, BasicConfig.MANAGER_getConfDetail);
boolean flipWordConfBuildStatus = response.jsonPath().getBoolean("data.flipWordConfBuildStatus");
System.out.println(flipWordConfBuildStatus);
Assert.assertTrue(flipWordConfBuildStatus, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未配置翻牌", response.body().asString()));
boolean flipWordConfStatus = response.jsonPath().getBoolean("data.flipWordConfStatus");
System.out.println(flipWordConfStatus);
Assert.assertTrue(flipWordConfStatus, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未开启翻牌", response.body().asString()));
}
@Test(description = "查询翻牌集字配置状态", priority = 5)
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_status);
System.out.println(response.body().asString());
int confStatus = response.jsonPath().getInt("data.confStatus");
Assert.assertTrue(confStatus==2, network.message(params, BasicConfig.MOBILE_status, "未开启", response.body().asString()));
}
@Test(description = "查询翻牌集字配置详情", priority = 6)
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_wordConf);
System.out.println(response.body().asString());
String redConfId = response.jsonPath().getString("data.redConfId");
this.redConfId=redConfId;
Assert.assertNotNull(redConfId, network.message(params, BasicConfig.MOBILE_wordConf, "查询直播翻牌配置详情失败", response.body().asString()));
}
*/
@Test(description = "保存翻牌配置", priority = 1)
public void 保存翻牌配置() {
Map<String, Object> Params = new HashMap<>();
......@@ -208,16 +124,15 @@ public class FlipCard implements Authorization {
visitorAuth9();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareType",2);
params.put("shareType",1);
Response signRes = network.getResponse(params, BasicConfig.MOBILE_sign);
String data = signRes.jsonPath().getString("data");
this.shareSign = data;
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(params, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "根据分享类型获取分享内容", priority = 8)
@Test(description = "根据分享类型获取分享内容", priority = 7)
public void 根据分享类型获取分享内容() {
visitorAuth9();
Map<String, Object> params = new HashMap<>();
......@@ -230,50 +145,7 @@ public class FlipCard implements Authorization {
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_helpInfo, "根据分享类型获取分享内容", response.body().asString()));
}
@Test(description = "访客邀请关系绑定", priority = 9)
public void 访客邀请关系绑定() {
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
visitorAuth22();
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
visitorAuth25();
Response response = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success1 = response.jsonPath().getJsonObject("success");
System.out.println(success1);
Assert.assertTrue(success1, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", response.body().asString()));
}
@Test(description = "获取绑定结果和绑定凭证", priority = 10)
public void 获取绑定结果和绑定凭证() {
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
visitorAuth22();
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
visitorAuth25();
Response response = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
Integer type1 = response.jsonPath().getInt("data.type");
System.out.println(type1);
Assert.assertTrue(type1==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", response.body().asString()));
}
@Test(description = "已登录查询分享人头像昵称", priority = 11)
@Test(description = "已登录查询分享人头像昵称", priority = 8)
public void 已登录查询分享人头像昵称() {
Map<String, Object> infoParam = new HashMap<>();
......@@ -297,14 +169,13 @@ public class FlipCard implements Authorization {
}
@Test(description = "访客H获得助力", priority = 12)
@Test(description = "访客H获得助力", priority = 9)
public void 访客H获得助力() {
Map<String, Object> params = new HashMap<>();
visitorAuth22();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareType",12);
Response response=network.getResponse(params,BasicConfig.MOBILE_popupDetail);
// System.out.println(response.body().asString());
String helpImg=response.jsonPath().getString("data.currentPopup.helpImg");
Assert.assertNotNull(helpImg,network.message(params,BasicConfig.MOBILE_popupDetail,"助力弹窗为null",response.body().asString()));
......@@ -329,7 +200,7 @@ public class FlipCard implements Authorization {
}
@Test(description = "访客S分享直播间", priority = 13)
@Test(description = "访客S分享直播间", priority = 10)
public void 访客S分享直播间() {
visitorAuth22();
Map<String, Object> params = new HashMap<>();
......@@ -343,7 +214,7 @@ public class FlipCard implements Authorization {
}
@Test(description = "访客S获得助力", priority = 14)
@Test(description = "访客S获得助力", priority = 11)
public void 访客S获得助力() {
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -357,7 +228,7 @@ public class FlipCard implements Authorization {
System.out.println(data);
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_assist, "用户H给用户S助力失败", response.body().asString()));
visitorAuth();
visitorAuth1();
Response assistRes = network.postResponse(params, BasicConfig.MOBILE_assist);
boolean data1 = assistRes.jsonPath().getBoolean("data");
System.out.println(data1);
......
......@@ -145,7 +145,6 @@ public class LiveGuess implements Authorization {
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");
......
package com.kjj.cases.live.liveConfig;
import com.alibaba.fastjson.JSON;
import com.kjj.bean.issue.SpokeList;
import com.kjj.bean.issue.Spolist;
import com.kjj.bean.issue.VoList;
......@@ -49,7 +48,7 @@ public class Comment implements Authorization {
//访客端
@Test(description = "访客A发表评论", priority = 2)
public void 访客A发表评论() {
visitorAuth();
visitorAuth1();
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("msg", "希望能好运");
......@@ -126,7 +125,7 @@ public class Comment implements Authorization {
@Test(description = "访客A获取历史所有评论", priority = 8)
public void 访客A获取历史所有评论() {
visitorAuth();
visitorAuth1();
sleep(20000);
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -146,7 +145,7 @@ public class Comment implements Authorization {
@Test(description = "访客A获取实时评论", priority = 9)
public void 访客A获取实时评论() {
visitorAuth();
visitorAuth1();
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("time", time);
......
package com.kjj.cases.live.liveConfig;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.BaseUtils;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.HashMap;
import java.util.Map;
import static com.kjj.config.BasicConfig.MOBILE_binding;
import static com.kjj.config.BasicConfig.MOBILE_sign;
import static com.kjj.utils.ThreadSleepUtils.sleep;
public class LiveBinding implements Authorization {
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
}
public String shareSign=null;
public void binding(String shareParam) {
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareParam);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
public void token() {
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
Integer type = tokenRes.jsonPath().getInt("data.type");
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
public String share() {
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType",1);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_sign);
String data = signRes.jsonPath().getString("data");
Assert.assertNotNull(data, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
return data;
}
/**
* 添加代理人绑定关系
*/
@Test(description = "代理人绑定", priority = 1)
public void 代理人绑定() {
agentAuth();
binding(this.shareSign);;
agentAuth1();
binding(this.shareSign);;
}
@Test(description = "代理人A分享直播间", priority = 2)
public void 代理人A分享直播间() {
agentAuth();
this.shareSign=share();
}
@Test(description = "代理人A与访客A邀请关系绑定", priority = 3)
public void 代理人A与访客A邀请关系绑定() {
visitorAuth1();
binding(this.shareSign);
token();
visitorAuth9();
binding(this.shareSign);;
token();
visitorAuth10();
binding(this.shareSign);;
token();
}
//不同团队代理人绑定邀请关系
@Test(description = "代理人B分享直播间", priority = 4)
public void 代理人B分享直播间() {
agentAuth1();
this.shareSign =share();
}
@Test(description = "访客I关系绑定", priority = 5)
public void 访客I关系绑定() {
visitorAuth8();
binding(this.shareSign);;
token();
}
//用户任务完成
@Test(description = "访客H分享直播间", priority = 6)
public void 访客H分享直播间() {
visitorAuth9();
this.shareSign =share();
}
@Test(description = "访客邀请关系绑定", priority = 7)
public void 访客邀请关系绑定() {
visitorAuth22();
binding(this.shareSign);;
token();
visitorAuth25();
binding(this.shareSign);;
token();
visitorAuth2();
binding(this.shareSign);;
token();
visitorAuth11();
binding(this.shareSign);;
token();
visitorAuth12();
binding(this.shareSign);;
token();
visitorAuth13();
binding(this.shareSign);;
token();
visitorAuth16();
binding(this.shareSign);;
token();
visitorAuth17();
binding(this.shareSign);;
token();
}
@Test(description = "访客J_分享直播间", priority = 8)
public void 访客J_分享直播间() {
visitorAuth10();
this.shareSign = share();
}
@Test(description = "邀请Xmz关系绑定", priority = 9)
public void 邀请Xmz关系绑定() {
visitorAuth26();
binding(this.shareSign);;
token();
}
@Test(description = "访客A_分享直播间", priority = 10)
public void 访客A_分享直播间() {
visitorAuth1();
this.shareSign =share();
}
@Test(description = "邀请C关系绑定", priority = 11)
public void 邀请C关系绑定() {
visitorAuth3();
binding(this.shareSign);;
token();
}
@Test(description = "访客B直播中分享直播间", priority = 12)
public void 访客B直播中分享直播间() {
visitorAuth2();
this.shareSign =share();
}
@Test(description = "幸运任务邀请D关系绑定", priority = 13)
public void 幸运任务邀请D关系绑定() {
visitorAuth4();
binding(this.shareSign);;
token();
visitorAuth5();
binding(this.shareSign);;
token();
visitorAuth6();
binding(this.shareSign);;
token();
visitorAuth7();
binding(this.shareSign);;
token();
}
@Test(description = "访客M获取分享加密串", priority = 14)
public void 访客M获取分享加密串() {
visitorAuth13();
this.shareSign =share();
}
@Test(description = "访客M与访客N邀请关系绑定", priority = 15)
public void 访客M与访客N邀请关系绑定() {
visitorAuth14();
binding(this.shareSign);;
token();
visitorAuth18();
binding(this.shareSign);;
token();
}
@Test(description = "访客N获取分享加密串", priority = 16)
public void 访客N获取分享加密串() {
visitorAuth14();
this.shareSign =share();
}
@Test(description = "访客N与访客O邀请关系绑定", priority = 17)
public void 访客N与访客O邀请关系绑定() {
visitorAuth15();
binding(this.shareSign);;
token();
}
}
......@@ -46,31 +46,9 @@ public class Lottery implements Authorization {
Assert.assertNotNull(list, network.message(getLiveAwardListParam, BasicConfig.USER_getLiveAwardList, "抽奖标记为false", getLiveAwardListRes.body().asString()));
}
@Test(description = "访客A到场", priority = 3)
public void 访客A到场() {
visitorAuth();
Map<String, Object> connectSuccessParam = new HashMap<>();
connectSuccessParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
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, "访客到场请求失败", response.body().asString()));
}
@Test(description = "访客B到场", priority = 4)
public void 访客B到场() {
visitorAuth2();
Map<String, Object> connectSuccessParam = new HashMap<>();
connectSuccessParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
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, "访客到场请求失败", response.body().asString()));
}
@Test(description = "访客A抽奖查询抽奖活动弹层", priority = 5)
public void 访客A抽奖查询抽奖活动弹层() {
visitorAuth();
visitorAuth1();
Map<String, Object> listLiveLotterParam = new HashMap<>();
listLiveLotterParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response listLiveLotterRes = network.getResponse(listLiveLotterParam, BasicConfig.USER_listLiveLottery);
......@@ -94,7 +72,7 @@ public class Lottery implements Authorization {
@Test(description = "查询第一轮正在抽奖的福利", priority = 7)
public void 查询第一轮正在抽奖的福利() {
visitorAuth();
visitorAuth1();
ThreadSleepUtils.sleep(1000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -150,7 +128,7 @@ public class Lottery implements Authorization {
@Test(description = "访客A查询抽奖是否结束", priority = 11)
public void 访客A查询抽奖是否结束() {
visitorAuth();
visitorAuth1();
ThreadSleepUtils.sleep(3000);
Map<String, Object> hasEndParam = new HashMap<>();
hasEndParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -178,7 +156,7 @@ public class Lottery implements Authorization {
@Test(description = "访客A查询是否中奖", priority = 13)
public void 访客A查询是否中奖() {
visitorAuth();
visitorAuth1();
ThreadSleepUtils.sleep(3000);
Map<String, Object> hasEndParam = new HashMap<>();
hasEndParam.put("confId", this.List_ConfId.get(0).getWelfareConfId());
......@@ -186,7 +164,7 @@ public class Lottery implements Authorization {
Response hasEndRes = network.getResponse(hasEndParam, BasicConfig.USER_result);
try {
Boolean data = hasEndRes.jsonPath().getBoolean("data.lottery");
Assert.assertTrue(data, network.message(hasEndParam, BasicConfig.USER_result, "访客查询中奖失败", hasEndRes.body().asString()));
Assert.assertTrue(data, network.message(hasEndParam, BasicConfig.USER_result, "访客中奖失败", hasEndRes.body().asString()));
} catch (Exception e) {
System.out.println("result = " + JSON.toJSONString(hasEndRes.jsonPath().get()));
throw e;
......@@ -203,7 +181,7 @@ public class Lottery implements Authorization {
Response hasEndRes = network.getResponse(hasEndParam, BasicConfig.USER_result);
try {
Boolean data = hasEndRes.jsonPath().getBoolean("data.lottery");
Assert.assertFalse(data, network.message(hasEndParam, BasicConfig.USER_result, "访客查询中奖失败", hasEndRes.body().asString()));
Assert.assertFalse(data, network.message(hasEndParam, BasicConfig.USER_result, "访客中奖失败", hasEndRes.body().asString()));
} catch (Exception e) {
System.out.println("result = " + JSON.toJSONString(hasEndRes.jsonPath().get()));
throw e;
......@@ -213,7 +191,7 @@ public class Lottery implements Authorization {
@Test(description = "查看第一轮抽奖榜单", priority = 15)
public void 查看第一轮抽奖榜单() {
visitorAuth();
visitorAuth1();
ThreadSleepUtils.sleep(1000);
Map<String, Object> pageListParam = new HashMap<>();
pageListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -230,7 +208,7 @@ public class Lottery implements Authorization {
@Test(description = "获取第一轮喜报", priority = 16)
public void 获取第一轮喜报() {
visitorAuth();
visitorAuth1();
ThreadSleepUtils.sleep(1000);
Map<String, Object> allLotteryNameParam = new HashMap<>();
allLotteryNameParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -244,7 +222,7 @@ public class Lottery implements Authorization {
@Test(description = "查询用户是否提交姓名", priority = 17)
public void 查询用户是否提交姓名() {
visitorAuth();
visitorAuth1();
ThreadSleepUtils.sleep(1000);
Map<String, Object> locationResultParam = new HashMap<>();
locationResultParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -257,7 +235,7 @@ public class Lottery implements Authorization {
@Test(description = "提交姓名", priority = 18)
public void 提交姓名() {
visitorAuth();
visitorAuth1();
Map<String, Object> submitInfoParam = new HashMap<>();
submitInfoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
submitInfoParam.put("confId", this.List_ConfId.get(0).getWelfareConfId());
......@@ -272,7 +250,7 @@ public class Lottery implements Authorization {
@Test(description = "访客A_分享直播间", priority = 19)
public void 访客A_分享直播间() {
visitorAuth();
visitorAuth1();
ThreadSleepUtils.sleep(1000);
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -282,49 +260,8 @@ public class Lottery implements Authorization {
this.shareSign = data;
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "邀请C关系绑定", priority = 20)
public void 邀请C关系绑定() {
visitorAuth3();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "邀请C绑定结果和绑定凭证", priority = 22)
public void 邀请C绑定结果和绑定凭证() {
visitorAuth3();
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "访客C到场", priority = 23)
public void 访客C到场() {
visitorAuth3();
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");
System.out.println(success);
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", connectSuccessoRes.body().asString()));
}
@Test(description = "访客C关注直播间", priority = 24)
public void 访客C关注直播间() {
visitorAuth3();
......@@ -351,7 +288,7 @@ public class Lottery implements Authorization {
//好运红包
@Test(description = "分享者访客A获取好运红包", priority = 26)
public void 分享者访客A获取好运红包() {
visitorAuth();
visitorAuth1();
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("scene",4);
......@@ -367,7 +304,7 @@ public class Lottery implements Authorization {
@Test(description = "访客A分享好运红包给访客B", priority = 27)
public void 访客A分享好运红包给访客B() {
visitorAuth();
visitorAuth1();
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Params.put("shareType",11);
......@@ -452,7 +389,7 @@ public class Lottery implements Authorization {
@Test(description = "访客A抽奖券列表", priority = 32)
public void 访客A抽奖券列表() {
visitorAuth();
visitorAuth1();
ThreadSleepUtils.sleep(3000);
Map<String, Object> myLotteryCodeParam = new HashMap<>();
myLotteryCodeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -466,7 +403,7 @@ public class Lottery implements Authorization {
@Test(description = "访客A抽奖码数量", priority = 33)
public void 访客A抽奖码数量() {
visitorAuth();
visitorAuth1();
ThreadSleepUtils.sleep(500);
Map<String, Object> myCountParam = new HashMap<>();
myCountParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -510,32 +447,6 @@ public class Lottery implements Authorization {
}
@Test(description = "幸运任务邀请D关系绑定", priority = 36)
public void 幸运任务邀请D关系绑定() {
visitorAuth4();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "幸运任务邀请D绑定结果和绑定凭证", priority = 37)
public void 幸运任务邀请D绑定结果和绑定凭证() {
visitorAuth4();
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
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给访客B助力", priority = 38)
public void 访客D给访客B助力() {
visitorAuth4();
......@@ -560,17 +471,6 @@ public class Lottery implements Authorization {
Assert.assertTrue(data, network.message(Params, BasicConfig.MOBILE_assist, "访客D给访客B助力失败", response.body().asString()));
}
@Test(description = "访客D到场", priority = 39)
public void 访客D到场() {
visitorAuth4();
Map<String, Object> connectSuccessParam = new HashMap<>();
connectSuccessParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
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, "访客到场请求失败", response.body().asString()));
}
@Test(description = "访客D关注直播间", priority = 40)
public void 访客D关注直播间() {
visitorAuth4();
......@@ -594,32 +494,6 @@ public class Lottery implements Authorization {
Assert.assertNotNull(data, network.message(myCountParam, BasicConfig.USER_myCount, "获取抽奖码数量失败", myCountRes.body().asString()));
}
@Test(description = "幸运任务邀请E关系绑定", priority = 42)
public void 幸运任务邀请E关系绑定() {
visitorAuth5();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "幸运任务邀请E绑定结果和绑定凭证", priority = 43)
public void 幸运任务邀请E绑定结果和绑定凭证() {
visitorAuth5();
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
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给访客B助力", priority = 44)
public void 访客E给访客B助力() {
visitorAuth5();
......@@ -635,17 +509,6 @@ public class Lottery implements Authorization {
Assert.assertTrue(data, network.message(assistParam, BasicConfig.MOBILE_assist, "访客E给访客B助力失败", response.body().asString()));
}
@Test(description = "访客E到场", priority = 45)
public void 访客E到场() {
visitorAuth5();
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");
System.out.println(success);
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", connectSuccessoRes.body().asString()));
}
@Test(description = "访客E关注直播间", priority = 46)
public void 访客E关注直播间() {
visitorAuth5();
......@@ -670,31 +533,6 @@ public class Lottery implements Authorization {
}
@Test(description = "幸运任务邀请F关系绑定", priority = 48)
public void 幸运任务邀请F关系绑定() {
visitorAuth6();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "幸运任务邀请F绑定结果和绑定凭证", priority = 49)
public void 幸运任务邀请F绑定结果和绑定凭证() {
visitorAuth6();
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "访客F给访客B助力", priority = 50)
public void 访客F给访客B助力() {
visitorAuth6();
......@@ -710,25 +548,6 @@ public class Lottery implements Authorization {
Assert.assertTrue(data, network.message(assistParam, BasicConfig.MOBILE_assist, "访客F给访客B助力失败", response.body().asString()));
}
@Test(description = "访客F到场", priority = 51)
public void 访客F到场() {
Map<String, Object> connectSuccessParam = new HashMap<>();
connectSuccessParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
visitorAuth6();
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, "访客到场请求失败", response.body().asString()));
agentAuth();
Response connectRes = network.getResponse(connectSuccessParam, BasicConfig.USER_connectSuccess);
boolean success1 = connectRes.jsonPath().getBoolean("success");
System.out.println(success1);
Assert.assertTrue(success1, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", connectRes.body().asString()));
}
@Test(description = "访客F关注直播间", priority = 52)
public void 访客F关注直播间() {
visitorAuth6();
......@@ -753,32 +572,6 @@ public class Lottery implements Authorization {
}
@Test(description = "幸运任务邀请G关系绑定", priority = 54)
public void 幸运任务邀请G关系绑定() {
visitorAuth7();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "幸运任务邀请G绑定结果和绑定凭证", priority = 55)
public void 幸运任务邀请G绑定结果和绑定凭证() {
visitorAuth7();
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "访客G给访客B助力", priority = 56)
public void 访客G给访客B助力() {
visitorAuth7();
......@@ -794,17 +587,6 @@ public class Lottery implements Authorization {
Assert.assertTrue(data, network.message(assistParam, BasicConfig.MOBILE_assist, "访客G给访客B助力失败", response.body().asString()));
}
@Test(description = "访客G到场", priority = 57)
public void 访客G到场() {
visitorAuth7();//黑名单用户
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");
System.out.println(success);
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", connectSuccessoRes.body().asString()));
}
@Test(description = "访客G关注直播间", priority = 58)
public void 访客G关注直播间() {
......@@ -1133,17 +915,6 @@ public class Lottery implements Authorization {
//第4轮团队指定份数
@Test(description = "不在指定团队访客H到场", priority = 77)
public void 访客H到场() {
visitorAuth9();
Map<String, Object> connectSuccessParam = new HashMap<>();
connectSuccessParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
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, "访客到场请求失败", response.body().asString()));
}
@Test(description = "访客H关注直播间", priority = 78)
public void 访客H关注直播间() {
visitorAuth9();
......@@ -1169,17 +940,6 @@ public class Lottery implements Authorization {
}
@Test(description = "不在指定团队访客I到场", priority = 80)
public void 访客I到场() {
visitorAuth8();
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");
System.out.println(success);
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", connectSuccessoRes.body().asString()));
}
@Test(description = "访客I关注直播间", priority = 81)
public void 访客I关注直播间() {
visitorAuth8();
......@@ -1204,18 +964,6 @@ public class Lottery implements Authorization {
}
@Test(description = "指定团队访客J到场", priority = 83)
public void 访客J到场() {
visitorAuth10();
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");
System.out.println(success);
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", connectSuccessoRes.body().asString()));
}
@Test(description = "访客J关注直播间", priority = 84)
public void 访客J关注直播间() {
visitorAuth10();
......@@ -1324,7 +1072,7 @@ public class Lottery implements Authorization {
Response hasEndResA = network.getResponse(hasEndParam, BasicConfig.USER_result);
boolean dataA = getData(hasEndResA);
visitorAuth();
visitorAuth1();
Response hasEndResC = network.getResponse(hasEndParam, BasicConfig.USER_result);
boolean dataC = getData(hasEndResC);
......@@ -1450,7 +1198,7 @@ public class Lottery implements Authorization {
Response hasEndResA = network.getResponse(hasEndParam, BasicConfig.USER_result);
boolean dataA = getDataLottery(hasEndResA);
visitorAuth();
visitorAuth1();
Response hasEndResC = network.getResponse(hasEndParam, BasicConfig.USER_result);
boolean dataC = getData(hasEndResC);
......
......@@ -25,7 +25,7 @@ public class RelativeLottery implements Authorization {
@BeforeClass
public void setUp(){
visitorAuth9();
visitorAuth10();
}
@Test(description = "查询亲友配置开启状态", priority = 1)
......@@ -42,7 +42,7 @@ public class RelativeLottery implements Authorization {
@Test(description = "仅一度用户可以领取抽奖券", priority = 2)
public void 仅一度用户可以领取抽奖券() {
visitorAuth9();
visitorAuth10();
Map<String, Object> getLiveAwardListParam = new HashMap<>();
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(getLiveAwardListParam, MOBILE_confLottery);
......@@ -52,7 +52,7 @@ public class RelativeLottery implements Authorization {
int receiverInfoList = response.jsonPath().getInt("data.userDetail.receiverInfoList.size()");
int lotteryNum = response.jsonPath().getInt("data.confDetail.lotteryNum");
Assert.assertEquals(isAcceptable, 1,network.message(getLiveAwardListParam, MOBILE_confLottery, "一度用户没有亲友券领取资格", response.body().asString()));
Assert.assertEquals(userAcceptStatus, 1,network.message(getLiveAwardListParam, MOBILE_confLottery, "一度用户已领取亲友券", response.body().asString()));
Assert.assertEquals(userAcceptStatus, 0,network.message(getLiveAwardListParam, MOBILE_confLottery, "一度用户未预约已领取亲友券", response.body().asString()));
Assert.assertEquals(receiverInfoList, 0,network.message(getLiveAwardListParam, MOBILE_confLottery, "亲友配置券已接受人数错误", response.body().asString()));
Assert.assertEquals(lotteryNum, 3,network.message(getLiveAwardListParam, MOBILE_confLottery, "亲友配置券数量错误", response.body().asString()));
confId = response.jsonPath().getString("data.confDetail.id");
......@@ -66,19 +66,35 @@ public class RelativeLottery implements Authorization {
Assert.assertEquals(isAcceptable, 0,network.message(getLiveAwardListParam, MOBILE_confLottery, "非一度用户有亲友券领取资格", response.body().asString()));
}
@Test(description = "访客J预约直播间", priority = 3)
public void 访客J预约直播间() {
visitorAuth10();
Map<String, Object> sycParam = new HashMap<>();
sycParam.put("bizId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
sycParam.put("bizType", 1);
List<Long> markIds1 = new ArrayList<>();
markIds1.add(142L);
markIds1.add(143L);
markIds1.add(140L);
sycParam.put("markIds", markIds1);
Response sycRes = network.postResponse(sycParam, BasicConfig.USER_SYCAPPOINTMENT);
Object data = sycRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(sycParam, BasicConfig.USER_SYCAPPOINTMENT, "预约失败", sycRes.body().asString()));
}
@Test(description = "访客H收下抽奖券", priority = 3)
public void 访客H收下抽奖券() {
visitorAuth9();
@Test(description = "访客H收下抽奖券", priority = 4)
public void 访客J收下抽奖券() {
visitorAuth10();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response bindingRes = network.postResponse(bindingParam, MOBILE_acceptLottery);
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, MOBILE_acceptLottery, "绑定失败", bindingRes.body().asString()));
Assert.assertTrue(success, network.message(bindingParam, MOBILE_acceptLottery, "收下亲友券失败", bindingRes.body().asString()));
}
@Test(description = "访客H_分享直播间", priority = 5)
public void 访客H_分享直播间() {
@Test(description = "访客J_分享直播间", priority = 5)
public void 访客J_分享直播间() {
sleep(1000);
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -103,8 +119,8 @@ public class RelativeLottery implements Authorization {
Assert.assertEquals(mpShareTitle,"亲友抽奖券分享文案", network.message(params, BasicConfig.MOBILE_helpInfo, "根据分享类型获取分享内容", response.body().asString()));
}
@Test(description = "访客H_获取小程序分享码", priority = 7)
public void 访客H_获取小程序分享码() {
@Test(description = "访客J_获取小程序分享码", priority = 7)
public void 访客J_获取小程序分享码() {
sleep(1000);
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -120,8 +136,8 @@ public class RelativeLottery implements Authorization {
Assert.assertNotNull(qrCodeUrl, network.message(signParam, MOBILE_codeDetailLottery, "分享失败", response.body().asString()));
}
@Test(description = "访客H获取直播所有的订阅消息模板", priority = 8)
public void 访客H获取直播所有的订阅消息模板() {
@Test(description = "访客J获取直播所有的订阅消息模板", priority = 8)
public void 访客J获取直播所有的订阅消息模板() {
visitorAuth9();
Map<String, Object> sycParam = new HashMap<>();
sycParam.put("appid","wx4d7276f866bd24c8");
......@@ -131,30 +147,6 @@ public class RelativeLottery implements Authorization {
Assert.assertNotNull(data, network.message(sycParam, BasicConfig.USER_wxIdAllList, "获取订阅消息失败", sycRes.body().asString()));
}
@Test(description = "邀请Xmz关系绑定", priority = 9)
public void 邀请Xmz关系绑定() {
visitorAuth26();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign);
Response bindingRes = network.postResponse(bindingParam, MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "查询访客Xmz绑定结果和绑定凭证", priority = 10)
public void 查询访客Xmz绑定结果和绑定凭证() {
visitorAuth26();
sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
boolean success = tokenRes.jsonPath().getJsonObject("success");
Integer type = tokenRes.jsonPath().getInt("data.type");
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "访客A预约直播间", priority = 11)
public void 访客A预约直播间() {
visitorAuth26();
......@@ -172,8 +164,8 @@ public class RelativeLottery implements Authorization {
Assert.assertNotNull(data, network.message(sycParam, BasicConfig.USER_SYCAPPOINTMENT, "预约失败", sycRes.body().asString()));
}
@Test(description = "访客Xmz给访客H助力", priority = 12)
public void 访客Xmz给访客H助力() {
@Test(description = "访客Xmz给访客J助力", priority = 12)
public void 访客Xmz给访客J助力() {
visitorAuth26();
sleep(2000);
//获取授权配置助力弹窗
......@@ -198,13 +190,15 @@ public class RelativeLottery implements Authorization {
@Test(description = "查询亲友券被领取1张", priority = 13)
public void 查询亲友券被领取1() {
visitorAuth9();
visitorAuth10();
Map<String, Object> getLiveAwardListParam = new HashMap<>();
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(getLiveAwardListParam, MOBILE_confLottery);
System.out.println(response.body().asString());
int userAcceptStatus = response.jsonPath().getInt("data.userDetail.userAcceptStatus");
int receiverInfoList = response.jsonPath().getInt("data.userDetail.receiverInfoList.size()");
String nickname = response.jsonPath().getString("data.userDetail.receiverInfoList.get(0).nickname");
Assert.assertEquals(userAcceptStatus, 1,network.message(getLiveAwardListParam, MOBILE_confLottery, "一度用户未领取亲友券", response.body().asString()));
Assert.assertEquals(receiverInfoList, 1,network.message(getLiveAwardListParam, MOBILE_confLottery, "亲友配置券已接受人数错误", response.body().asString()));
Assert.assertEquals(nickname, "小米粥",network.message(getLiveAwardListParam, MOBILE_confLottery, "亲友配置券领取人错误", response.body().asString()));
}
......
......@@ -16,47 +16,9 @@ import java.util.Map;
public class LotteryCode implements Authorization {
public String shareSign;
@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_sign);
String data = signRes.jsonPath().getString("data");
this.shareSign = data;
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "代理人A与访客A邀请关系绑定", priority = 2)
public void 代理人A与访客A邀请关系绑定() {
visitorAuth();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客A获取绑定结果和绑定凭证", priority = 3)
public void 访客A获取绑定结果和绑定凭证() {
visitorAuth();
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "访客A获取直播所有的订阅消息模板", priority = 4)
@Test(description = "访客A获取直播所有的订阅消息模板", priority = 1)
public void 访客A获取直播所有的订阅消息模板() {
visitorAuth();
visitorAuth1();
Map<String, Object> sycParam = new HashMap<>();
sycParam.put("appid","wx4d7276f866bd24c8");
Response sycRes = network.postResponse(sycParam, BasicConfig.USER_wxIdAllList);
......@@ -65,9 +27,9 @@ public class LotteryCode implements Authorization {
Assert.assertNotNull(data, network.message(sycParam, BasicConfig.USER_wxIdAllList, "获取订阅消息失败", sycRes.body().asString()));
}
@Test(description = "访客A预约直播间", priority = 5)
@Test(description = "访客A预约直播间", priority = 2)
public void 访客A预约直播间() {
visitorAuth();
visitorAuth1();
Map<String, Object> sycParam = new HashMap<>();
sycParam.put("bizId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
sycParam.put("bizType", 1);
......@@ -82,9 +44,9 @@ public class LotteryCode implements Authorization {
Assert.assertNotNull(data, network.message(sycParam, BasicConfig.USER_SYCAPPOINTMENT, "预约失败", sycRes.body().asString()));
}
@Test(description = "访客A关注直播间", priority = 6)
@Test(description = "访客A关注直播间", priority = 3)
public void 访客A关注直播间() {
visitorAuth();
visitorAuth1();
Map<String, Object> subscribeParam = new HashMap<>();
subscribeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
List<Long> markIds2 = new ArrayList<>();
......@@ -97,9 +59,9 @@ public class LotteryCode implements Authorization {
Assert.assertTrue(data, network.message(subscribeParam, BasicConfig.USER_SUBSCRIBE, "关注失败", subscribeRes.body().asString()));
}
@Test(description = "访客A查询关注状态", priority = 7)
@Test(description = "访客A查询关注状态", priority = 4)
public void 访客A查询关注状态() {
visitorAuth();
visitorAuth1();
Map<String, Object> findParam = new HashMap<>();
findParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response findRes = network.getResponse(findParam, BasicConfig.USER_FIND);
......@@ -109,9 +71,9 @@ public class LotteryCode implements Authorization {
}
@Test(description = "访客A保存海报获得抽奖码", priority = 8)
@Test(description = "访客A保存海报获得抽奖码", priority = 5)
public void 访客A保存海报获得抽奖码() {
visitorAuth();
visitorAuth1();
Map<String, Object> savePosterParam = new HashMap<>();
savePosterParam.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response savePosterRes = network.postResponse(savePosterParam, BasicConfig.USER_savePoster);
......@@ -121,9 +83,9 @@ public class LotteryCode implements Authorization {
}
@Test(description = "访客A抽奖码数量", priority = 9)
@Test(description = "访客A抽奖码数量", priority = 6)
public void 访客A抽奖码数量() {
visitorAuth();
visitorAuth1();
Map<String, Object> myCountParam = new HashMap<>();
myCountParam.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response myCountRes = network.getResponse(myCountParam, BasicConfig.USER_myCount);
......@@ -133,9 +95,9 @@ public class LotteryCode implements Authorization {
}
@Test(description = "访客A查询抽奖券列表", priority = 10)
@Test(description = "访客A查询抽奖券列表", priority = 7)
public void 访客A查询抽奖券列表() {
visitorAuth();
visitorAuth1();
ThreadSleepUtils.sleep(1000);
Map<String, Object> myLotteryCodeParam = new HashMap<>();
myLotteryCodeParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -145,104 +107,5 @@ public class LotteryCode implements Authorization {
Object data = myLotteryCodeRes.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(myLotteryCodeParam, BasicConfig.MOBILE_MyLotteryCode, "查询用户自己的抽奖券列表失败", myLotteryCodeRes.body().asString()));
}
@Test(description = "访客H关系绑定", priority = 11)
public void 访客H关系绑定() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客H绑定结果和绑定凭证", priority = 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);
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 = "访客J关系绑定", priority = 13)
public void 访客J关系绑定() {
visitorAuth10();
ThreadSleepUtils.sleep(1000);
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "中奖任务邀请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);
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 = 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_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 = "访客I关系绑定", priority = 16)
public void 访客I关系绑定() {
visitorAuth8();
ThreadSleepUtils.sleep(1000);
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign", shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "邀请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);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
}
......@@ -21,7 +21,7 @@ import static com.kjj.config.BasicConfig.visitorAuth;
public class SignIn implements Authorization {
@BeforeClass
public void setUp() { visitorAuth(); }
public void setUp() { visitorAuth1(); }
@Test(description = "访客签到", priority = 1)
public void 访客签到() {
......@@ -73,7 +73,7 @@ public class SignIn implements Authorization {
}
}
......
......@@ -2,14 +2,11 @@ package com.kjj.cases.live.question;
import com.alibaba.fastjson.JSON;
import com.kjj.bean.issue.QuestionList;
import com.kjj.bean.issue.SpokeList;
import com.kjj.bean.issue.Spolist;
import com.kjj.bean.issue.issuelist;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.JsonUtil;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.Test;
......@@ -74,7 +71,7 @@ public class Question implements Authorization {
@Test(description = "访客端查询问题列表", priority = 4)
public void 访客端查询问题列表()
{
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_QuesClueList);
......@@ -88,7 +85,7 @@ public class Question implements Authorization {
@Test(description = "访客端发起问题", priority = 5)
public void 访客端发起问题()
{
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("questionId", questionId);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -158,7 +155,7 @@ public class Question implements Authorization {
@Test(description = "访客端公告查询", priority = 10)
public void 访客端公告查询()
{
visitorAuth();
visitorAuth1();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_ClueNotice);
......
......@@ -8,7 +8,6 @@ import com.kjj.constants.LiveConstants;
import com.kjj.utils.BaseUtils;
import com.kjj.utils.IdMakeUtil;
import com.kjj.utils.JsonUtil;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
......@@ -107,7 +106,7 @@ public class SecondKill implements Authorization {
*/
@Test(description = "获取秒杀商品列表", priority = 7)
public void 获取秒杀商品列表() {
visitorAuth();
visitorAuth1();
Map<String, Object> goodsListPar = new HashMap<>();
goodsListPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response goodsListRes = network.getResponse(goodsListPar, BasicConfig.MOBILE_secondKill_getGoodsList);
......@@ -187,8 +186,8 @@ public class SecondKill implements Authorization {
// 切换访客
@Test(description = "查看当前秒杀商品", priority = 11)
public void 查看当前秒杀商品() {
visitorAuth();
sleep(3000);
visitorAuth1();
sleep(10000);
Map<String, Object> goodsFirstPar = new HashMap<>();
goodsFirstPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response goodsFirstRes = network.getResponse(goodsFirstPar, BasicConfig.MOBILE_secondKill_goodsFirst);
......@@ -225,6 +224,8 @@ public class SecondKill implements Authorization {
@Test(description = "代理人下单", priority = 13)
public void 代理人下单() {
agentAuth();
sleep(5000);
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", ConfSecondKill.skIdFirst);
......@@ -332,7 +333,7 @@ public class SecondKill implements Authorization {
*/
@Test(description = "正常用户下单", priority = 19)
public void 正常用户下单() {
visitorAuth();
visitorAuth1();
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", ConfSecondKill.skIdFirst);
......@@ -376,7 +377,7 @@ public class SecondKill implements Authorization {
@Test(description = "正常用户下单0元秒杀商品", priority = 21)
public void 正常用户下单0元秒杀商品() {
visitorAuth();
visitorAuth1();
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", ConfSecondKill.skIdThird);
......@@ -588,7 +589,7 @@ public class SecondKill implements Authorization {
@Test(description = "用户下单无库存秒杀失败", priority = 29)
public void 用户下单无库存秒杀() {
visitorAuth();
visitorAuth1();
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
orderPar.put("confId", ConfSecondKill.skIdSecond);
......@@ -751,7 +752,7 @@ public class SecondKill implements Authorization {
@Test(description = "用户成功支付", priority = 34)
public void 用户成功支付() {
visitorAuth();
visitorAuth1();
// 新建订单
Map<String, Object> orderPar = new HashMap<>();
orderPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......
......@@ -7,6 +7,7 @@ import com.kjj.bean.manager.TreasureCode;
import com.kjj.bean.manager.TreasureRed;
import com.kjj.bean.manager.WelfareList;
import com.kjj.cases.admin.Authorization;
import com.kjj.cases.live.liveConfig.LiveBinding;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.JsonUtil;
......@@ -27,11 +28,16 @@ import static com.kjj.utils.ThreadSleepUtils.sleep;
public class GoldenEgg implements Authorization {
@BeforeClass
public void setUp() { ssoLogin(); }
public void setUp() {
ssoLogin();
}
public String ConfId;
public String shareSign;
public JSONObject treasureConf;
public String interactConfId;
public LiveBinding liveBinding = new LiveBinding();
public List<WelfareList> id;
/**
* 添加代理人绑定关系
......@@ -39,58 +45,17 @@ public class GoldenEgg implements Authorization {
@Test(description = "代理人绑定", priority = 1)
public void 代理人绑定() {
agentAuth();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
/**
* 裂变宝箱配置
*/
public List<WelfareList> id;
@Test(description = "代理人A分享直播间", priority = 2)
public void 代理人A分享直播间() {
agentAuth();
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType",1);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_sign);
String data = signRes.jsonPath().getString("data");
this.shareSign = data;
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
liveBinding.binding(this.shareSign);
this.shareSign = liveBinding.share();
}
@Test(description = "代理人A与访客A邀请关系绑定", priority = 3)
@Test(description = "代理人A与访客A邀请关系绑定", priority = 2)
public void 代理人A与访客A邀请关系绑定() {
visitorAuth();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
visitorAuth1();
liveBinding.binding(this.shareSign);;
liveBinding.token();
}
@Test(description = "访客A获取绑定结果和绑定凭证", priority = 4)
public void 访客A获取绑定结果和绑定凭证() {
visitorAuth();
sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "查询配置奖品列表", priority = 5)
@Test(description = "查询配置奖品列表", priority = 3)
public void 查询配置奖品列表() {
Map<String, Object> getListParam = new HashMap<>();
getListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -106,7 +71,7 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "创建砸金蛋配置", priority = 6)
@Test(description = "创建砸金蛋配置", priority = 4)
public void 创建砸金蛋配置() {
Map<String, Object> saveParam = new HashMap<>();
saveParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -147,7 +112,7 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "查询砸金蛋配置详情", priority = 7)
@Test(description = "查询砸金蛋配置详情", priority = 5)
public void 查询砸金蛋配置详情() {
Map<String, Object> confDetailParam = new HashMap<>();
confDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -159,7 +124,7 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "开启砸金蛋配置", priority = 8)
@Test(description = "开启砸金蛋配置", priority = 6)
public void 开启砸金蛋配置() {
Map<String, Object> switchStatusParam = new HashMap<>();
switchStatusParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -171,7 +136,7 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "查询砸金蛋配置状态", priority = 9)
@Test(description = "查询砸金蛋配置状态", priority = 7)
public void 查询宝箱配置状态() {
Map<String, Object> statusParam = new HashMap<>();
statusParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -184,9 +149,9 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "查询砸金蛋配置数据", priority = 10)
@Test(description = "查询砸金蛋配置数据", priority = 8)
public void 查询砸金蛋配置数据() {
visitorAuth();
visitorAuth1();
Map<String, Object> getLiveAwardListParam = new HashMap<>();
getLiveAwardListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(getLiveAwardListParam, BasicConfig.MOBILE_allLottery);
......@@ -203,7 +168,7 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "查询直播前砸金蛋配置详情", priority = 11)
@Test(description = "查询直播前砸金蛋配置详情", priority = 9)
public void 查询直播前砸金蛋配置详情() {
sleep(2000);
Map<String, Object> detailParam = new HashMap<>();
......@@ -216,7 +181,7 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "获取跑马灯数据", priority = 12)
@Test(description = "获取跑马灯数据", priority = 10)
public void 获取跑马灯数据() {
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("pageSize",10);
......@@ -227,31 +192,14 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "代理人A与访客A邀请关系绑定", priority = 13)
@Test(description = "代理人A与访客A邀请关系绑定", priority = 11)
public void 代理人A与访客G邀请关系绑定() {
visitorAuth7();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客A获取绑定结果和绑定凭证", priority = 14)
public void 访客G获取绑定结果和绑定凭证() {
visitorAuth7();
sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
System.out.println(tokenRes.body().asString());
Integer type = tokenRes.jsonPath().getInt("data.type");
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
liveBinding.binding(this.shareSign);;
liveBinding.token();
}
@Test(description = "黑名单用户仅不可砸中实物", priority = 15)
@Test(description = "黑名单用户仅不可砸中实物", priority = 12)
public void 黑名单用户仅不可砸中实物() {
visitorAuth7();
Map<String, Object> chooseAwardParam = new HashMap<>();
......@@ -272,14 +220,14 @@ public class GoldenEgg implements Authorization {
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "黑名单砸出非抽奖码", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "助力人数错误", response.body().asString()));
}
@Test(description = "第1个访客A砸金蛋砸出实物", priority = 16)
@Test(description = "第1个访客A砸金蛋砸出实物", priority = 13)
public void 1个访客A砸金蛋砸出实物() {
visitorAuth();
visitorAuth1();
sleep(2000);
Map<String, Object> chooseAwardParam = new HashMap<>();
chooseAwardParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -299,35 +247,19 @@ public class GoldenEgg implements Authorization {
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus,5, network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 3,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 3,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸出奖品非实物", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "助力人数错误", response.body().asString()));
interactConfId = response.jsonPath().getString("data.award.interactConfId");
}
@Test(description = "代理人A与访客B邀请关系绑定", priority = 17)
@Test(description = "代理人A与访客B邀请关系绑定", priority = 14)
public void 代理人A与访客B邀请关系绑定() {
visitorAuth7();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
liveBinding.binding(this.shareSign);;
liveBinding.token();
}
@Test(description = "访客B获取绑定结果和绑定凭证", priority = 18)
public void 访客B获取绑定结果和绑定凭证() {
visitorAuth7();
sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
System.out.println(tokenRes.body().asString());
Integer type = tokenRes.jsonPath().getInt("data.type");
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "第2个访客B砸金蛋砸出抽奖码", priority = 19)
@Test(description = "第2个访客B砸金蛋砸出抽奖码", priority = 15)
public void 2个访客B砸金蛋砸出抽奖码() {
visitorAuth2();
sleep(2000);
......@@ -349,11 +281,11 @@ public class GoldenEgg implements Authorization {
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus,5, network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList,0, network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸出奖品非抽奖码", response.body().asString()));
Assert.assertEquals(helperList,0, network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "助力人数错误", response.body().asString()));
}
@Test(description = "增加实物奖品数量", priority = 20)
@Test(description = "增加实物奖品数量", priority = 16)
public void 增加实物奖品数量() {
JSONObject treasureAward = treasureConf.getJSONObject("treasureAward");
treasureAward.put("totalNum",2);//-1无限制,1限制1次
......@@ -364,7 +296,7 @@ public class GoldenEgg implements Authorization {
Assert.assertTrue(data, network.message(treasureConf, BasicConfig.MANAGER_goldenEgg_saveOrUpdate, "增加实物奖品数量失败", response.body().asString()));
}
@Test(description = "实物奖品增加后数量变化", priority = 21)
@Test(description = "实物奖品增加后数量变化", priority = 17)
public void 实物奖品增加后数量变化() {
Map<String, Object> confDetailParam = new HashMap<>();
confDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -378,32 +310,14 @@ public class GoldenEgg implements Authorization {
Assert.assertEquals(receiveNum ,0, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品已领取错误", response.body().asString()));
}
@Test(description = "代理人A与访客C邀请关系绑定", priority = 22)
@Test(description = "代理人A与访客C邀请关系绑定", priority = 18)
public void 代理人A与访客C邀请关系绑定() {
visitorAuth3();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客C获取绑定结果和绑定凭证", priority = 23)
public void 访客C获取绑定结果和绑定凭证() {
visitorAuth3();
sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
System.out.println(tokenRes.body().asString());
Integer type = tokenRes.jsonPath().getInt("data.type");
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
liveBinding.binding(this.shareSign);;
liveBinding.token();
}
@Test(description = "第3个访客C砸金蛋砸出实物", priority = 24)
@Test(description = "第3个访客C砸金蛋砸出实物", priority = 19)
public void 3个访客C砸金蛋砸出实物() {
visitorAuth3();
Map<String, Object> chooseAwardParam = new HashMap<>();
......@@ -423,12 +337,12 @@ public class GoldenEgg implements Authorization {
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType,3, network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType,3, network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸出奖品非实物", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "助力人数错误", response.body().asString()));
}
@Test(description = "减少实物奖品数量", priority = 25)
@Test(description = "减少实物奖品数量", priority = 20)
public void 减少实物奖品数量() {
JSONObject treasureAward = treasureConf.getJSONObject("treasureAward");
treasureAward.put("totalNum",1);//-1无限制,1限制1次
......@@ -439,7 +353,7 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "第3个访客C砸金蛋超时", priority = 26)
@Test(description = "第3个访客C砸金蛋超时", priority = 21)
public void 3个访客C砸金蛋超时() {
visitorAuth3();
sleep(2000);
......@@ -460,7 +374,7 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "第3个访客C超时后重新砸蛋砸出实物奖品", priority = 27)
@Test(description = "第3个访客C超时后重新砸蛋砸出实物奖品", priority = 22)
public void 3个访客C超时后重新砸蛋砸出实物奖品() {
visitorAuth3();
sleep(2000);
......@@ -482,12 +396,12 @@ public class GoldenEgg implements Authorization {
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 3,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 3,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸出奖品非实物", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "助力人数错误", response.body().asString()));
}
@Test(description = "第3个访客C再次砸金蛋超时", priority = 28)
@Test(description = "第3个访客C再次砸金蛋超时", priority = 23)
public void 3个访客C再次砸金蛋超时() {
visitorAuth3();
sleep(2000);
......@@ -508,31 +422,14 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "代理人A与访客D邀请关系绑定", priority = 29)
@Test(description = "代理人A与访客D邀请关系绑定", priority = 24)
public void 代理人A与访客D邀请关系绑定() {
visitorAuth4();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
liveBinding.binding(this.shareSign);;
liveBinding.token();
}
@Test(description = "访客D获取绑定结果和绑定凭证", priority = 30)
public void 访客D获取绑定结果和绑定凭证() {
visitorAuth4();
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
System.out.println(tokenRes.body().asString());
Integer type = tokenRes.jsonPath().getInt("data.type");
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "第3个用户再次超时后访客D砸蛋砸出实物奖品", priority = 31)
@Test(description = "第3个用户再次超时后访客D砸蛋砸出实物奖品", priority = 25)
public void 3个用户再次超时后访客D砸蛋砸出实物奖品() {
visitorAuth4();
sleep(2000);
......@@ -555,35 +452,18 @@ public class GoldenEgg implements Authorization {
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 3,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 3,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸出奖品非实物", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "助力人数错误", response.body().asString()));
}
@Test(description = "代理人A与访客E邀请关系绑定", priority = 32)
@Test(description = "代理人A与访客E邀请关系绑定", priority = 26)
public void 代理人A与访客E邀请关系绑定() {
visitorAuth5();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
System.out.println(bindingRes.body().asString());
boolean success = bindingRes.jsonPath().getJsonObject("success");
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客E获取绑定结果和绑定凭证", priority = 33)
public void 访客E获取绑定结果和绑定凭证() {
visitorAuth5();
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
System.out.println(tokenRes.body().asString());
Integer type = tokenRes.jsonPath().getInt("data.type");
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
liveBinding.binding(this.shareSign);;
liveBinding.token();
}
@Test(description = "第5个用户E砸蛋砸出抽奖码", priority = 34)
@Test(description = "第5个用户E砸蛋砸出抽奖码", priority = 27)
public void 5个用户E砸蛋砸出抽奖码() {
visitorAuth5();
sleep(2000);
......@@ -605,51 +485,27 @@ public class GoldenEgg implements Authorization {
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸出奖品非抽奖码", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "助力人数错误", response.body().asString()));
}
@Test(description = "访客A获取分享加密串", priority = 35)
@Test(description = "访客A获取分享加密串", priority = 28)
public void 访客A获取分享加密串() {
visitorAuth();
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 15);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_sign);
System.out.println(signRes.body().asString());
String data = signRes.jsonPath().getString("data");
this.shareSign = data;
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
visitorAuth1();
this.shareSign = liveBinding.share();
}
@Test(description = "访客E与访客A邀请关系绑定", priority = 36)
@Test(description = "访客E与访客A邀请关系绑定", priority = 29)
public void 访客F与访客A邀请关系绑定() {
visitorAuth6();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
liveBinding.binding(this.shareSign);;
liveBinding.token();
}
@Test(description = "访客E获取绑定结果和绑定凭证", priority = 37)
public void 访客F获取绑定结果和绑定凭证() {
visitorAuth6();
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
@Test(description = "修改实物奖品数量为无限制", priority = 38)
@Test(description = "修改实物奖品数量为无限制", priority = 30)
public void 修改实物奖品数量为无限制() {
JSONObject treasureAward = treasureConf.getJSONObject("treasureAward");
treasureAward.put("totalNum",-1);
......@@ -660,7 +516,7 @@ public class GoldenEgg implements Authorization {
Assert.assertTrue(data, network.message(treasureConf, BasicConfig.MANAGER_goldenEgg_saveOrUpdate, "修改实物奖品为无限制失败", response.body().asString()));
}
@Test(description = "第5个访客F砸蛋砸出实物奖品", priority = 39)
@Test(description = "第5个访客F砸蛋砸出实物奖品", priority = 31)
public void 5个访客F砸蛋砸出实物奖品() {
visitorAuth6();
sleep(5000);
......@@ -682,12 +538,12 @@ public class GoldenEgg implements Authorization {
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 3,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 3,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸出奖品非实物", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "助力人数错误", response.body().asString()));
}
@Test(description = "修改红包概率为100%", priority = 40)
@Test(description = "修改红包概率为100%", priority = 32)
public void 修改红包概率为100() {
JSONObject treasureAward = treasureConf.getJSONObject("treasureAward");
JSONObject treasureRed = treasureConf.getJSONObject("treasureRed");
......@@ -699,7 +555,7 @@ public class GoldenEgg implements Authorization {
Assert.assertTrue(data, network.message(treasureConf, BasicConfig.MANAGER_goldenEgg_saveOrUpdate, "修改红包概率失败", response.body().asString()));
}
@Test(description = "黑名单用户G砸金蛋超时", priority = 41)
@Test(description = "黑名单用户G砸金蛋超时", priority = 33)
public void 黑名单用户G砸金蛋超时() {
visitorAuth7();
Map<String, Object> param = new HashMap<>();
......@@ -719,7 +575,7 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "黑名单用户G超时后仅能砸出抽奖码", priority = 42)
@Test(description = "黑名单用户G超时后仅能砸出抽奖码", priority = 34)
public void 黑名单用户G超时后仅能砸出抽奖码() {
visitorAuth7();
sleep(2000);
......@@ -741,36 +597,19 @@ public class GoldenEgg implements Authorization {
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "黑名单砸出奖品非抽奖码", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "助力人数错误", response.body().asString()));
}
@Test(description = "访客I与访客A邀请关系绑定", priority = 43)
@Test(description = "访客I与访客A邀请关系绑定", priority = 35)
public void 访客I与访客A邀请关系绑定() {
visitorAuth8();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客F获取绑定结果和绑定凭证", priority = 44)
public void 访客I获取绑定结果和绑定凭证() {
visitorAuth8();
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
liveBinding.binding(this.shareSign);;
liveBinding.token();
}
@Test(description = "第6个访客F砸出红包", priority = 45)
@Test(description = "第6个访客F砸出红包", priority = 36)
public void 6个访客F砸出红包() {
visitorAuth8();
sleep(2000);
......@@ -792,36 +631,19 @@ public class GoldenEgg implements Authorization {
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 2,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 2,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸出奖品非红包", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "助力人数错误", response.body().asString()));
}
@Test(description = "访客H与访客A邀请关系绑定", priority = 46)
@Test(description = "访客H与访客A邀请关系绑定", priority = 37)
public void 访客H与访客A邀请关系绑定() {
visitorAuth9();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客H获取绑定结果和绑定凭证", priority = 47)
public void 访客H获取绑定结果和绑定凭证() {
visitorAuth9();
ThreadSleepUtils.sleep(2000);
Map<String, Object> tokenParam = new HashMap<>();
tokenParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response tokenRes = network.getResponse(tokenParam, BasicConfig.MOBILE_Token);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
liveBinding.binding(this.shareSign);;
liveBinding.token();
}
@Test(description = "第7个访客H砸出抽奖码", priority = 48)
@Test(description = "第7个访客H砸出抽奖码", priority = 38)
public void 7个访客H砸出抽奖码() {
visitorAuth9();
sleep(2000);
......@@ -843,11 +665,11 @@ public class GoldenEgg implements Authorization {
int treasureType =response.jsonPath().getInt("data.treasureType");
int helperList =response.jsonPath().getInt("data.helperList.size()");
Assert.assertEquals(receiveStatus, 5,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金蛋失败", response.body().asString()));
Assert.assertEquals(treasureType, 1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "砸金出奖品非抽奖码", response.body().asString()));
Assert.assertEquals(helperList, 0,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "助力人数错误", response.body().asString()));
}
@Test(description = "砸金蛋进行中数量变化", priority = 49)
@Test(description = "砸金蛋进行中数量变化", priority = 39)
public void 砸金蛋进行中数量变化() {
Map<String, Object> confDetailParam = new HashMap<>();
confDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -868,7 +690,7 @@ public class GoldenEgg implements Authorization {
Assert.assertEquals(receiveNum ,0, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品已领取错误", response.body().asString()));
}
@Test(description = "用户B给用户A助力", priority = 50)
@Test(description = "用户B给用户A助力", priority = 40)
public void 用户B给用户A助力() {
visitorAuth2();
Map<String, Object> Params = new HashMap<>();
......@@ -890,9 +712,9 @@ public class GoldenEgg implements Authorization {
Assert.assertTrue(data, network.message(Params, BasicConfig.MOBILE_assist, "用户B给用户H助力失败", response.body().asString()));
}
@Test(description = "访客A实物兑奖成功", priority = 51)
@Test(description = "访客A实物兑奖成功", priority = 41)
public void 访客A实物兑奖成功() {
visitorAuth();
visitorAuth1();
sleep(2000);
Map<String, Object> param = new HashMap<>();
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -905,20 +727,13 @@ public class GoldenEgg implements Authorization {
Assert.assertEquals(helperList,1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "邀请头像数量错误", response.body().asString()));
}
@Test(description = "访客B获取分享加密串", priority = 52)
@Test(description = "访客B获取分享加密串", priority = 42)
public void 访客B获取分享加密串() {
visitorAuth2();
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 15);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_sign);
String data = signRes.jsonPath().getString("data");
this.shareSign = data;
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
this.shareSign = liveBinding.share();
}
@Test(description = "用户C给用户B助力", priority = 53)
@Test(description = "用户C给用户B助力", priority = 43)
public void 用户C给用户B助力() {
visitorAuth3();
Map<String, Object> Params = new HashMap<>();
......@@ -940,7 +755,7 @@ public class GoldenEgg implements Authorization {
Assert.assertTrue(data, network.message(Params, BasicConfig.MOBILE_assist, "用户B给用户H助力失败", response.body().asString()));
}
@Test(description = "访客B抽奖码兑奖成功", priority = 54)
@Test(description = "访客B抽奖码兑奖成功", priority = 44)
public void 访客B抽奖码兑奖成功() {
visitorAuth2();
sleep(2000);
......@@ -955,20 +770,13 @@ public class GoldenEgg implements Authorization {
Assert.assertEquals(helperList,1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "邀请头像数量错误", response.body().asString()));
}
@Test(description = "访客F获取分享加密串", priority = 55)
@Test(description = "访客F获取分享加密串", priority = 45)
public void 访客F获取分享加密串() {
visitorAuth8();
Map<String, Object> signParam = new HashMap<>();
signParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
signParam.put("shareType", 15);
Response signRes = network.getResponse(signParam, BasicConfig.MOBILE_sign);
String data = signRes.jsonPath().getString("data");
this.shareSign = data;
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
this.shareSign = liveBinding.share();
}
@Test(description = "用户D给用户F助力", priority = 56)
@Test(description = "用户D给用户F助力", priority = 46)
public void 用户D给用户F助力() {
visitorAuth5();
Map<String, Object> Params = new HashMap<>();
......@@ -990,7 +798,7 @@ public class GoldenEgg implements Authorization {
Assert.assertTrue(data, network.message(Params, BasicConfig.MOBILE_assist, "用户B给用户H助力失败", response.body().asString()));
}
@Test(description = "访客F红包兑奖成功", priority = 57)
@Test(description = "访客F红包兑奖成功", priority = 47)
public void 访客F红包兑奖成功() {
visitorAuth8();
sleep(2000);
......@@ -1005,7 +813,7 @@ public class GoldenEgg implements Authorization {
Assert.assertEquals(helperList,1,network.message(param, BasicConfig.MOBILE_goldenEgg_joinInfo, "邀请头像数量错误", response.body().asString()));
}
@Test(description = "砸金蛋已领取数量变化", priority = 58)
@Test(description = "砸金蛋已领取数量变化", priority = 48)
public void 砸金蛋已领取数量变化() {
Map<String, Object> confDetailParam = new HashMap<>();
confDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -1027,9 +835,9 @@ public class GoldenEgg implements Authorization {
Assert.assertEquals(receiveNum ,1, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "实物奖品已领取错误", response.body().asString()));
}
@Test(description = "查询用户是否未提交收货地址", priority = 59)
@Test(description = "查询用户是否未提交收货地址", priority = 49)
public void 查询用户是否未提交收货地址() {
visitorAuth();
visitorAuth1();
ThreadSleepUtils.sleep(1000);
Map<String, Object> locationResultParam = new HashMap<>();
locationResultParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -1040,9 +848,9 @@ public class GoldenEgg implements Authorization {
Assert.assertNotNull(winnerRegion, network.message(locationResultParam, BasicConfig.USER_locationResult, "查询用户是否提交收货地址失败", locationResultRes.body().asString()));
}
@Test(description = "提交收货地址", priority = 60)
@Test(description = "提交收货地址", priority = 50)
public void 提交收货地址() {
visitorAuth();
visitorAuth1();
ArrayList<String> region = new ArrayList<>();
region.add("浙江省");
region.add("杭州市");
......@@ -1061,9 +869,9 @@ public class GoldenEgg implements Authorization {
ThreadSleepUtils.sleep(3000);
}
@Test(description = "查询用户是否提交收货地址", priority = 61)
@Test(description = "查询用户是否提交收货地址", priority = 51)
public void 查询用户是否提交收货地址() {
visitorAuth();
visitorAuth1();
ThreadSleepUtils.sleep(1000);
Map<String, Object> locationResultParam = new HashMap<>();
locationResultParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -1073,7 +881,7 @@ public class GoldenEgg implements Authorization {
Object winnerRegion = locationResultRes.jsonPath().getJsonObject("data.winnerRegion");
Assert.assertNotNull(winnerRegion, network.message(locationResultParam, BasicConfig.USER_locationResult, "查询用户是否提交收货地址失败", locationResultRes.body().asString()));
}
@Test(description = "获取直播配置详情", priority = 62)
@Test(description = "获取直播配置详情", priority = 52)
public void 获取直播配置详情() {
adminAuth();
Map<String, Object> ConfDetailParam = new HashMap<>();
......@@ -1085,7 +893,7 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "开始直播", priority = 63)
@Test(description = "开始直播", priority = 53)
public void 开启直播() {
Map<String, Object> openParam = new HashMap<>();
openParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -1096,7 +904,7 @@ public class GoldenEgg implements Authorization {
Assert.assertNotNull(data, network.message(openParam, BasicConfig.ANCHOR_OPEN, "开启直播失败", openRes.body().asString()));
ThreadSleepUtils.sleep(10000);
}
@Test(description = "结束直播", priority = 64)
@Test(description = "结束直播", priority = 54)
public void 结束直播() {
Map<String, Object> closeParam = new HashMap<>();
closeParam.put("liveid", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......
......@@ -416,7 +416,6 @@ public class TimeRed implements Authorization {
ThreadSleepUtils.sleep(3000);
Response redRes = network.postResponse(Params, BasicConfig.ANCHOR_redOpen);
boolean data1 = redRes.jsonPath().getBoolean("data");
System.out.println(data1);
Assert.assertTrue(data1, network.message(Params, BasicConfig.ANCHOR_redOpen, "访客I开启第4轮红包失败", redRes.body().asString()));
}
......@@ -430,9 +429,7 @@ public class TimeRed implements Authorization {
ThreadSleepUtils.sleep(3000);
Response response = network.getResponse(Params, BasicConfig.ANCHOR_openState);
Object data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Integer state = response.jsonPath().getInt("data.state");
System.out.println(state);
Assert.assertTrue(state==2, network.message(Params, BasicConfig.ANCHOR_openState, "访客H未领取第4轮红包", response.body().asString()));
visitorAuth8();
......@@ -499,7 +496,6 @@ public class TimeRed implements Authorization {
ThreadSleepUtils.sleep(3000);
Response response = network.postResponse(Params, BasicConfig.ANCHOR_redOpen);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.ANCHOR_redOpen, "访客H开启第4轮红包失败", response.body().asString()));
visitorAuth8();
......
......@@ -189,31 +189,6 @@ public class Treasure implements Authorization {
}
@Test(description = "访客H与访客B邀请关系绑定", priority = 10)
public void 访客H与访客B邀请关系绑定() {
visitorAuth2();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客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);
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 未登录查询分享人头像昵称() {
......@@ -346,30 +321,6 @@ public class Treasure implements Authorization {
}
@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 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, "绑定失败", response.body().asString()));
}
@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);
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给用户H助力", priority = 23)
public void 用户K给用户H助力() {
visitorAuth11();
......@@ -384,32 +335,6 @@ public class Treasure implements Authorization {
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户K给用户H助力失败", response.body().asString()));
}
@Test(description = "访客L邀请关系绑定", priority = 24)
public void 访客L邀请关系绑定() {
visitorAuth12();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客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);
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给用户H助力", priority = 26)
public void 用户L给用户H助力() {
visitorAuth12();
......@@ -424,32 +349,6 @@ public class Treasure implements Authorization {
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户L给用户H助力失败", response.body().asString()));
}
@Test(description = "访客M邀请关系绑定", priority = 27)
public void 访客M邀请关系绑定() {
visitorAuth13();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客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);
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给用户H助力", priority = 29)
public void 用户M给用户H助力() {
visitorAuth13();
......@@ -464,31 +363,6 @@ public class Treasure implements Authorization {
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户M给用户H助力失败", response.body().asString()));
}
@Test(description = "访客P邀请关系绑定", priority = 30)
public void 访客P邀请关系绑定() {
visitorAuth16();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客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);
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给用户H助力", priority = 32)
public void 用户P给用户H助力() {
visitorAuth16();
......@@ -503,31 +377,6 @@ public class Treasure implements Authorization {
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "用户P给用户H助力失败", response.body().asString()));
}
@Test(description = "访客Q邀请关系绑定", priority = 33)
public void 访客Q邀请关系绑定() {
visitorAuth17();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客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);
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给用户H助力", priority = 35)
public void 用户Q给用户H助力() {
visitorAuth17();
......@@ -713,30 +562,6 @@ public class Treasure implements Authorization {
this.shareSign = data;
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "访客M与访客N邀请关系绑定", priority = 47)
public void 访客M与访客N邀请关系绑定() {
visitorAuth14();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客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);
Integer type = tokenRes.jsonPath().getInt("data.type");
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
......@@ -754,30 +579,6 @@ public class Treasure implements Authorization {
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "访客N给访客M助力失败", response.body().asString()));
}
@Test(description = "访客M与访客R邀请关系绑定", priority = 50)
public void 访客M与访客R邀请关系绑定() {
visitorAuth18();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客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);
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给访客M助力", priority = 52)
public void 访客R给访客M助力() {
visitorAuth18();
......@@ -1051,31 +852,6 @@ public class Treasure implements Authorization {
this.shareSign = data;
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(signParam, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "访客N与访客O邀请关系绑定", priority = 69)
public void 访客N与访客O邀请关系绑定() {
visitorAuth15();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
bindingParam.put("shareSign",shareSign);
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客O获取绑定结果和绑定凭证", priority = 70)
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);
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给访客N助力", priority = 71)
......@@ -1190,18 +966,4 @@ public class Treasure implements Authorization {
Assert.assertTrue(dataList.size()==6, network.message(openParam, BasicConfig.MANAGER_participateList, "查询领取列表失败", response.body().asString()));
}
/**
* 添加代理人绑定关系
*/
@Test(description = "代理人绑定", priority = 77)
public void 代理人绑定() {
agentAuth();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
}
......@@ -60,6 +60,7 @@ public class NetworkUtils {
if (!Objects.equals(response.statusCode(),200)){
System.out.println("请求状态码错误,path=【"+path+"】 code=【"+response.statusCode()+"】");
}
System.out.println(response.body().asString());
return response;
}
......@@ -73,6 +74,7 @@ public class NetworkUtils {
if (!Objects.equals(response.statusCode(),200)){
System.out.println("请求状态码错误,path=【"+path+"】 code=【"+response.statusCode()+"】");
}
System.out.println(response.body().asString());
return response;
}
......@@ -85,6 +87,7 @@ public class NetworkUtils {
if (!Objects.equals(response.statusCode(),200)){
System.out.println("请求状态码错误,path=【"+path+"】 code=【"+response.statusCode()+"】");
}
System.out.println(response.body().asString());
return response;
}
......@@ -99,6 +102,7 @@ public class NetworkUtils {
if (!Objects.equals(response.statusCode(),200)){
System.out.println("请求状态码错误,path=【"+path+"】 code=【"+response.statusCode()+"】");
}
System.out.println(response.body().asString());
return response;
}
......@@ -111,6 +115,7 @@ public class NetworkUtils {
if (!Objects.equals(response.statusCode(),200)){
System.out.println("请求状态码错误,path=【"+path+"】 code=【"+response.statusCode()+"】");
}
System.out.println(response.body().asString());
return response;
}
......
......@@ -35,6 +35,12 @@
<class name="com.kjj.cases.live.secondKill.ConfSecondKill"/>
</classes>
</test>
<test preserve-order="true" name="绑定关系绑定">
<classes>
<class name="com.kjj.cases.live.liveConfig.LiveBinding"/>
</classes>
</test>
<test preserve-order="true" name="配置代理人邀约奖励">
<classes>
<class name="com.kjj.cases.live.inviteReward.ManagerRewardConf"/>
......@@ -121,6 +127,12 @@
</classes>
</test>
<test preserve-order="true" name="访客签到">
<classes>
<class name="com.kjj.cases.live.lotteryCode.SignIn"/>
</classes>
</test>
<test preserve-order="true" name="评论及回复">
<classes>
<class name="com.kjj.cases.live.liveConfig.Comment"/>
......@@ -132,12 +144,6 @@
</classes>
</test>
<test preserve-order="true" name="访客签到">
<classes>
<class name="com.kjj.cases.live.lotteryCode.SignIn"/>
</classes>
</test>
<test preserve-order="true" name="直播中抽奖">
<classes>
<class name="com.kjj.cases.live.lottery.Lottery"/>
......
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