Commit 5051cc72 authored by 张艳玲's avatar 张艳玲

新增裂变宝箱配置

parent 6e08856a
package com.kjj.cases.live.user; package com.kjj.cases.live.LotteryCode;
import com.kjj.cases.live.admin.AdminAuthorization; import com.kjj.cases.live.admin.AdminAuthorization;
import com.kjj.config.BasicConfig; import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants; import com.kjj.constants.LiveConstants;
......
...@@ -4,7 +4,7 @@ import static com.kjj.config.BasicConfig.*; ...@@ -4,7 +4,7 @@ import static com.kjj.config.BasicConfig.*;
/** /**
* 管理员授权 * 管理员授权
* @author 嘿保险,ID:907 * @author 吉吉,ID:907
*/ */
public interface AdminAuthorization { public interface AdminAuthorization {
...@@ -26,7 +26,7 @@ public interface AdminAuthorization { ...@@ -26,7 +26,7 @@ public interface AdminAuthorization {
} }
/** /**
* 代理人(小疙瘩人寿)授权,ID:815 * 代理人(小疙瘩人寿)授权,ID:995
*/ */
default void agentAuth1(){ default void agentAuth1(){
// 创建用户 并传到network里 // 创建用户 并传到network里
...@@ -51,7 +51,7 @@ public interface AdminAuthorization { ...@@ -51,7 +51,7 @@ public interface AdminAuthorization {
} }
/** /**
* 访客C(刘超)授权,用户,用户ID:811 * 访客C(刘超)授权,地域指定用户ID:811
*/ */
default void visitorAuth3() { default void visitorAuth3() {
network.agentCookies.put("authKey", VISITORKEY3); network.agentCookies.put("authKey", VISITORKEY3);
...@@ -59,7 +59,7 @@ public interface AdminAuthorization { ...@@ -59,7 +59,7 @@ public interface AdminAuthorization {
} }
/** /**
* 访客D(李执)授权,用户ID:89 * 访客D(李执)授权,地域指定用户ID:89
*/ */
default void visitorAuth4() { default void visitorAuth4() {
network.agentCookies.put("authKey", VISITORKEY4); network.agentCookies.put("authKey", VISITORKEY4);
...@@ -74,7 +74,7 @@ public interface AdminAuthorization { ...@@ -74,7 +74,7 @@ public interface AdminAuthorization {
} }
/** /**
* 访客F(新强)授权,区域指定中奖用户,ID:82 * 访客F(新强)授权,用户ID:82
*/ */
default void visitorAuth6() { default void visitorAuth6() {
network.agentCookies.put("authKey", VISITORKEY6); network.agentCookies.put("authKey", VISITORKEY6);
...@@ -97,7 +97,7 @@ public interface AdminAuthorization { ...@@ -97,7 +97,7 @@ public interface AdminAuthorization {
System.out.println("用户AUTH_KEY:" + VISITORKEY8); System.out.println("用户AUTH_KEY:" + VISITORKEY8);
} }
/** /**
* 访客H(嘿保险)授权,ID:907 * 访客H(吉吉)非实名用户授权,ID:907
*/ */
default void visitorAuth9() { default void visitorAuth9() {
network.agentCookies.put("authKey", VISITORKEY9); network.agentCookies.put("authKey", VISITORKEY9);
...@@ -105,13 +105,77 @@ public interface AdminAuthorization { ...@@ -105,13 +105,77 @@ public interface AdminAuthorization {
} }
/** /**
* 访客H(日落)授权,ID:703 * 访客J(日落)授权,ID:703
*/ */
default void visitorAuth10() { default void visitorAuth10() {
network.agentCookies.put("authKey", VISITORKEY10); network.agentCookies.put("authKey", VISITORKEY10);
System.out.println("用户AUTH_KEY:" + VISITORKEY10); System.out.println("用户AUTH_KEY:" + VISITORKEY10);
} }
/**
* 访客K(沈小四)授权,ID:108
*/
default void visitorAuth11() {
network.agentCookies.put("authKey", VISITORKEY11);
System.out.println("用户AUTH_KEY:" + VISITORKEY11);
}
/**
* 访客L(饺子)授权,ID:97
*/
default void visitorAuth12() {
network.agentCookies.put("authKey", VISITORKEY12);
System.out.println("用户AUTH_KEY:" + VISITORKEY12);
}
/**
* 访客M(大妹子保险)非实名用户授权,ID:102
*/
default void visitorAuth13() {
network.agentCookies.put("authKey", VISITORKEY13);
System.out.println("用户AUTH_KEY:" + VISITORKEY13);
}
/**
* 访客N(光头强)非实名用户授权,ID:173
*/
default void visitorAuth14() {
network.agentCookies.put("authKey", VISITORKEY14);
System.out.println("用户AUTH_KEY:" + VISITORKEY14);
}
/**
* 访客O(少侠)授权,ID:79
*/
default void visitorAuth15() {
network.agentCookies.put("authKey", VISITORKEY15);
System.out.println("用户AUTH_KEY:" + VISITORKEY15);
}
/**
* 访客P(抬头有飞碟)授权,ID:99
*/
default void visitorAuth16() {
network.agentCookies.put("authKey", VISITORKEY16);
System.out.println("用户AUTH_KEY:" + VISITORKEY16);
}
/**
* 访客Q(枫城)授权,ID:77
*/
default void visitorAuth17() {
network.agentCookies.put("authKey", VISITORKEY17);
System.out.println("用户AUTH_KEY:" + VISITORKEY17);
}
/**
* 访客R(小老弟来了)非实名用户授权,ID:94
*/
default void visitorAuth18() {
network.agentCookies.put("authKey", VISITORKEY18);
System.out.println("用户AUTH_KEY:" + VISITORKEY18);
}
} }
...@@ -1351,7 +1351,7 @@ public class Lottery implements AdminAuthorization { ...@@ -1351,7 +1351,7 @@ public class Lottery implements AdminAuthorization {
} }
//团队分配定中奖 //团队分配定中奖
@Test(description = "普通抽奖轮次访客是否中奖", priority = 95) @Test(description = "普通抽奖轮次访客是否中奖", priority = 95)
public void 普通抽奖轮次访客是否中奖() { public void 普通抽奖轮次访客是否中奖() {
ThreadSleepUtils.sleep(3000); ThreadSleepUtils.sleep(3000);
......
package com.kjj.cases.live.manager;
import com.kjj.bean.manager.*;
import com.kjj.cases.live.admin.AdminAuthorization;
import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants;
import com.kjj.utils.BaseUtils;
import com.kjj.utils.JsonUtil;
import io.restassured.response.Response;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Treasure implements AdminAuthorization {
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
}
public List<WelfareList> id;
@Test(description = "查询奖品列表", priority = 1)
public void 查询奖品列表() {
Map<String, Object> getListParam = new HashMap<>();
getListParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
getListParam.put("companyId", 101);
getListParam.put("pageIndex", 1);
getListParam.put("pageSize", 20);
getListParam.put("welfareType", 6);
Response response = network.getResponse(getListParam, BasicConfig.MANAGER_getList4Admin);
List<WelfareList>list = JsonUtil.parseResponseToPageBean(response, WelfareList.class);
System.out.println(list);
this.id = list;
Assert.assertNotNull(list, network.message(getListParam, BasicConfig.MANAGER_getList4Admin, "查询奖品列表失败", response.body().asString()));
}
@Test(description = "新增宝箱裂变配置", priority = 2)
public void 新增宝箱裂变配置() {
Map<String, Object> saveParam = new HashMap<>();
saveParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
saveParam.put("openCondition", 1);
saveParam.put("openNum", 1);
TreasureAward treasureAward =new TreasureAward();
treasureAward.setWelfareId(this.id.get(0).getId());
treasureAward.setAwardName("宝箱锦鲤");
treasureAward.setTreasureProbability(2000);
treasureAward.setTreasureType(3);
treasureAward.setRuleType(1);
treasureAward.setTotalNum(10);
treasureAward.setWinLimitCount(-1);
saveParam.put("treasureAward",treasureAward);
TreasureRed treasureRed =new TreasureRed();
treasureRed.setRedTotalAmount(100);
treasureRed.setRuleType(2);
treasureRed.setTotalNum(3);
treasureRed.setTreasureProbability(4000);
treasureRed.setTreasureType(2);
treasureRed.setWinLimitCount(1);
treasureRed.setShowAmount(200);
saveParam.put("treasureRed",treasureRed);
TreasureCode treasureCode =new TreasureCode();
treasureCode.setFixedNum(1);
treasureCode.setMaxNum(3);
treasureCode.setRuleType(2);
treasureCode.setTreasureProbability(4000);
treasureCode.setTreasureType(1);
saveParam.put("treasureCode",treasureCode);
saveParam.put("treasurePeriod",3);
Response response = network.postResponse(saveParam, BasicConfig.MANAGER_saveTreasureConf);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(saveParam, BasicConfig.MANAGER_saveTreasureConf, "新增宝箱裂变配置失败", response.body().asString()));
}
@Test(description = "查询宝箱配置详情", priority = 3)
public void 查询宝箱配置详情() {
Map<String, Object> confDetailParam = new HashMap<>();
confDetailParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(confDetailParam, BasicConfig.MANAGER_confDetail);
System.out.println(response);
Integer openCondition =response.jsonPath().getInt("data.openCondition");
System.out.println(openCondition);
Assert.assertTrue(openCondition>0, network.message(confDetailParam, BasicConfig.MANAGER_confDetail, "查询宝箱配置详情失败", response.body().asString()));
}
@Test(description = "开启宝箱", priority = 4)
public void 开启宝箱() {
Map<String, Object> switchStatusParam = new HashMap<>();
switchStatusParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
switchStatusParam.put("confStatus", 1);
Response response = network.postResponse(switchStatusParam, BasicConfig.MANAGER_switchStatus);
boolean data =response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertTrue(data, network.message(switchStatusParam, BasicConfig.MANAGER_switchStatus, "开启宝箱失败", response.body().asString()));
}
}
This diff is collapsed.
This diff is collapsed.
...@@ -3,7 +3,7 @@ package com.kjj.config; ...@@ -3,7 +3,7 @@ package com.kjj.config;
public class BasicConfig { public class BasicConfig {
public static int apiCount; //接口数量统计 public static int apiCount; //接口数量统计
// 是否开启钉钉机器人推送 // 是否开启钉钉机器人推送
public static final boolean isPushReport =true; //true public static final boolean isPushReport =false; //true
// 代理人微信昵称 // 代理人微信昵称
public static final String WECHAT_NAME = "吉吉"; //true public static final String WECHAT_NAME = "吉吉"; //true
// 代理人的openid(固定) // 代理人的openid(固定)
......
...@@ -19,13 +19,20 @@ ...@@ -19,13 +19,20 @@
</classes> </classes>
</test> </test>
<test preserve-order="true" name="宝箱裂变配置"> <test preserve-order="true" name="获取抽奖码校验">
<classes> <classes>
<class name="com.kjj.cases.live.manager.Treasure"/> <class name="com.kjj.cases.live.LotteryCode.LotteryCode"/>
</classes> </classes>
</test> </test>
<test preserve-order="true" name="宝箱时长"> <test preserve-order="true" name="宝箱裂变">
<classes>
<class name="com.kjj.cases.live.treasure.Treasure"/>
</classes>
</test>
<test preserve-order="true" name="宝箱时长">
<classes> <classes>
<class name="com.kjj.cases.live.manager.TreasureTime"/> <class name="com.kjj.cases.live.manager.TreasureTime"/>
</classes> </classes>
...@@ -75,17 +82,6 @@ ...@@ -75,17 +82,6 @@
</classes> </classes>
</test> </test>
<test preserve-order="true" name="代理人分享直播间">
<classes>
<class name="com.kjj.cases.live.agent.Agent"/>
</classes>
</test>
<test preserve-order="true" name="访客券码领取">
<classes>
<class name="com.kjj.cases.live.user.User"/>
</classes>
</test>
<test preserve-order="true" name="指定中奖"> <test preserve-order="true" name="指定中奖">
<classes> <classes>
...@@ -106,11 +102,11 @@ ...@@ -106,11 +102,11 @@
</classes> </classes>
</test> </test>
<test preserve-order="true" name="访客签到"> <test preserve-order="true" name="访客签到">
<classes> <classes>
<class name="com.kjj.cases.live.user.SignIn"/> <class name="com.kjj.cases.live.LotteryCode.SignIn"/>
</classes> </classes>
</test> </test>
<test preserve-order="true" name="直播中抽奖"> <test preserve-order="true" name="直播中抽奖">
<classes> <classes>
...@@ -168,6 +164,7 @@ ...@@ -168,6 +164,7 @@
<class name="com.kjj.cases.live.question.Question"/> <class name="com.kjj.cases.live.question.Question"/>
</classes> </classes>
</test> </test>
<test preserve-order="true" name="助播-结束直播"> <test preserve-order="true" name="助播-结束直播">
<classes> <classes>
<class name="com.kjj.cases.live.anchor.CloseLive"/> <class name="com.kjj.cases.live.anchor.CloseLive"/>
......
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