Commit 48487484 authored by 龚小红's avatar 龚小红

Merge branch 'Feature/20220420-gxh' into 'master'

修改中奖逻辑,一个客户一场直播仅能实物中奖1次的逻辑

See merge request test-group/kejiji!250
parents aad4f3a3 0f125bdd
......@@ -16,11 +16,19 @@ import org.testng.annotations.Test;
import java.util.*;
import static com.kjj.utils.BaseUtils.connectSuccess;
public class Answer implements Authorization {
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
visitorAuth20();
connectSuccess();
agentAuth2();
connectSuccess();
}
public int id;
......@@ -561,7 +569,7 @@ public class Answer implements Authorization {
@Test(description = "领取有奖答题福利-访客A答题正确", priority = 30)
public void 访客A领取有奖答题福利()
{
visitorAuth3();
visitorAuth20();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("quesConfId", this.quesConfId.get(2).getQuesConfId());
......@@ -582,7 +590,7 @@ public class Answer implements Authorization {
@Test(description = "查询访客A领取有奖答题福利结果", priority = 31)
public void 查询访客A领取有奖答题福利结果()
{
visitorAuth3();
visitorAuth20();
ThreadSleepUtils.sleep(3000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -757,7 +765,7 @@ public class Answer implements Authorization {
@Test(description = "访客查询第二轮答题福利", priority = 40)
public void 访客查询第二轮答题福利()
{
visitorAuth3();
visitorAuth20();
ThreadSleepUtils.sleep(3000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -776,7 +784,7 @@ public class Answer implements Authorization {
@Test(description = "访客A第二轮领取有奖答题福利-答题正确", priority = 41)
public void 访客A第二轮领取有奖答题福利()
{
visitorAuth3();
visitorAuth20();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("quesConfId", this.quesConfId.get(3).getQuesConfId());
......@@ -795,7 +803,7 @@ public class Answer implements Authorization {
@Test(description = "查询访客A第二轮有奖答题福利类型结果", priority = 42)
public void 查询访客A第二轮有奖答题福利类型结果()
{
visitorAuth3();
visitorAuth20();
ThreadSleepUtils.sleep(3000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -1155,7 +1163,7 @@ public class Answer implements Authorization {
@Test(description = "领取有奖答题福利类型-访客A答题正确", priority = 61)
public void 访客A领取有奖答题福利类型()
{
visitorAuth3();
visitorAuth20();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("quesConfId", this.quesConfId.get(5).getQuesConfId());
......@@ -1173,7 +1181,7 @@ public class Answer implements Authorization {
@Test(description = "访客A领取有奖答题福利结果", priority = 62)
public void 访客A领取有奖答题福利结果()
{
visitorAuth3();
visitorAuth20();
ThreadSleepUtils.sleep(3000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -1314,7 +1322,7 @@ public class Answer implements Authorization {
@Test(description = "访客查询第四轮答题福利", priority = 70)
public void 代理人查询第四轮答题福利()
{
adminAuth();
agentAuth2();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_QuesDetail);
......@@ -1334,7 +1342,7 @@ public class Answer implements Authorization {
}
@Test(description = "代理人第四轮领取答题福利-答题正确",priority = 71)
public void 代理人第四轮领取答题福利(){
agentAuth();
agentAuth2();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("quesConfId", this.quesConfId.get(7).getQuesConfId());
......@@ -1349,7 +1357,7 @@ public class Answer implements Authorization {
@Test(description = "查询代理人第四轮有奖答题福利类型结果",priority = 72)
public void 查询代理人第四轮有奖答题福利类型结果(){
//验证管理后台配置实物奖品允许代理人参与并获奖
agentAuth();
agentAuth2();
ThreadSleepUtils.sleep(3000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......
......@@ -158,6 +158,14 @@ public class LiveBinding implements Authorization {
visitorAuth30();
binding(this.shareSign);;
token();
visitorAuth20();
binding(this.shareSign);;
token();
visitorAuth21();
binding(this.shareSign);;
token();
}
@Test(description = "访客J_分享直播间", priority = 8)
......
......@@ -275,6 +275,7 @@ public class GoldenEgg implements Authorization {
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString()));
sleep(2000);
Map<String, Object> param = new HashMap<>();
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId);
......
......@@ -533,6 +533,7 @@ public class Treasure implements Authorization {
@Test(description = "访客H第3轮开宝箱参与详情", priority = 45)
public void 访客H3轮开宝箱参与详情() {
//直播有整体限制单个客户仅能中奖实物一次
visitorAuth9();
ThreadSleepUtils.sleep(2000);
Map<String, Object> infoParam = new HashMap<>();
......@@ -541,7 +542,7 @@ public class Treasure implements Authorization {
Response response = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType=response.jsonPath().getInt("data.treasureType");
System.out.println(treasureType);
Assert.assertTrue(treasureType==3, network.message(infoParam, BasicConfig.MANAGER_participateInfo, "类型非实物", response.body().asString()));
Assert.assertTrue(treasureType==1, network.message(infoParam, BasicConfig.MANAGER_participateInfo, "类型非抽奖码", response.body().asString()));
int receiveStatus=response.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus);
......@@ -593,8 +594,6 @@ public class Treasure implements Authorization {
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "访客R给访客M助力失败", response.body().asString()));
}
//验证实物奖品数量是否会超发
@Test(description = "访客H第4次参与详情的进度显示", priority = 53)
public void 访客H4次参与详情的进度显示() {
visitorAuth9();
......@@ -657,7 +656,7 @@ public class Treasure implements Authorization {
Response response = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType=response.jsonPath().getInt("data.treasureType");
System.out.println(treasureType);
Assert.assertTrue(treasureType==3, network.message(infoParam, BasicConfig.MANAGER_participateInfo, "类型非实物", response.body().asString()));
Assert.assertTrue(treasureType==1, network.message(infoParam, BasicConfig.MANAGER_participateInfo, "类型非抽奖码", response.body().asString()));
int receiveStatus=response.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus);
......@@ -669,7 +668,7 @@ public class Treasure implements Authorization {
Response responseB = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType1=responseB.jsonPath().getInt("data.treasureType");
System.out.println(treasureType1);
Assert.assertTrue(treasureType1==1, network.message(infoParam, BasicConfig.MANAGER_participateInfo, "类型非抽奖码", response.body().asString()));
Assert.assertTrue(treasureType1==3, network.message(infoParam, BasicConfig.MANAGER_participateInfo, "类型非实物", response.body().asString()));
int receiveStatus1=responseB.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus1);
......
......@@ -17,11 +17,19 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.kjj.utils.BaseUtils.connectSuccess;
public class TreasureTime implements Authorization {
@BeforeClass
public void setUp() {
BaseUtils.ssoLogin();
visitorAuth21();
connectSuccess();
visitorAuth22();
connectSuccess();
}
public List<CondDetail> treasureConfId ;
......@@ -29,7 +37,7 @@ public class TreasureTime implements Authorization {
@Test(description = "获取宝箱配置详情", priority = 1)
public void 获取宝箱配置详情() {
visitorAuth9();
visitorAuth21();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_timeDetail);
......@@ -41,7 +49,7 @@ public class TreasureTime implements Authorization {
@Test(description = "获取宝箱参与情况", priority = 2)
public void 获取宝箱参与情况() {
visitorAuth9();
visitorAuth21();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_joinDetail);
......@@ -55,7 +63,7 @@ public class TreasureTime implements Authorization {
@Test(description = "完成第1个观看任务", priority = 3)
public void 完成第1个观看任务() {
visitorAuth9();
visitorAuth21();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("treasureConfId",this.treasureConfId.get(0).getTreasureConfId());
......@@ -68,7 +76,7 @@ public class TreasureTime implements Authorization {
@Test(description = "获取第1个宝箱参与情况", priority = 4)
public void 获取第1个宝箱参与情况() {
visitorAuth9();
visitorAuth21();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -83,7 +91,7 @@ public class TreasureTime implements Authorization {
@Test(description = "访客H开启第1个宝箱", priority = 5)
public void 开启第1个宝箱() {
visitorAuth9();
visitorAuth21();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -97,7 +105,7 @@ public class TreasureTime implements Authorization {
@Test(description = "查询第1个宝箱中奖结果", priority = 6)
public void 查询第1个宝箱中奖结果() {
visitorAuth9();
visitorAuth21();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -127,14 +135,14 @@ public class TreasureTime implements Authorization {
boolean data=response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_finish, "访客H获取宝箱参与情况失败", response.body().asString()));
visitorAuth9();
visitorAuth21();
ThreadSleepUtils.sleep(1000);
Response response1 = network.postResponse(params, BasicConfig.MOBILE_finish);
boolean data1=response.jsonPath().getBoolean("data");
Assert.assertTrue(data1, network.message(params, BasicConfig.MOBILE_finish, "访客H获取宝箱参与情况失败", response1.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Response response2 = network.postResponse(params, BasicConfig.MOBILE_finish);
boolean data2=response.jsonPath().getBoolean("data");
......@@ -156,7 +164,7 @@ public class TreasureTime implements Authorization {
boolean finishFlag=treasureList.get(1).isFinishFlag();
Assert.assertTrue(finishFlag, network.message(params, BasicConfig.MOBILE_joinDetail1, "访客H获取第2个宝箱参与情况失败", response.body().asString()));
visitorAuth9();
visitorAuth21();
ThreadSleepUtils.sleep(1000);
Response response1 = network.getResponse(params, BasicConfig.MOBILE_joinDetail1);
List<CondDetail> treasureList1 = JsonUtil.parseResponseToListBean(response1, CondDetail.class,"condDetail");
......@@ -164,7 +172,7 @@ public class TreasureTime implements Authorization {
Assert.assertTrue(finishFlag1, network.message(params, BasicConfig.MOBILE_joinDetail1, "访客H获取第2个宝箱参与情况失败", response.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Response response2 = network.getResponse(params, BasicConfig.MOBILE_joinDetail1);
List<CondDetail> treasureList2 = JsonUtil.parseResponseToListBean(response2, CondDetail.class,"condDetail");
......@@ -188,7 +196,7 @@ public class TreasureTime implements Authorization {
System.out.println(data);
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_treasureOpen, "访客H获取宝箱参与情况失败", response.body().asString()));
visitorAuth9();
visitorAuth21();
ThreadSleepUtils.sleep(1000);
Response response1 = network.postResponse(params, BasicConfig.MOBILE_treasureOpen);
boolean data1=response1.jsonPath().getBoolean("data");
......@@ -196,7 +204,7 @@ public class TreasureTime implements Authorization {
Assert.assertTrue(data1, network.message(params, BasicConfig.MOBILE_treasureOpen, "访客H获取宝箱参与情况失败", response1.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Response response2 = network.postResponse(params, BasicConfig.MOBILE_treasureOpen);
boolean data2=response2.jsonPath().getBoolean("data");
......@@ -221,16 +229,16 @@ public class TreasureTime implements Authorization {
Integer receiveStatus=response.jsonPath().getInt("data.receiveStatus");
Assert.assertTrue(receiveStatus==2, network.message(params, BasicConfig.MOBILE_joinResult, "领取失败", response.body().asString()));
visitorAuth9();
visitorAuth21();
ThreadSleepUtils.sleep(1000);
response = network.getResponse(params, BasicConfig.MOBILE_joinResult);
treasureType=response.jsonPath().getInt("data.treasureType");
Assert.assertTrue(treasureType==2, network.message(params, BasicConfig.MOBILE_joinResult, "中奖结果非抽奖码类型", response.body().asString()));
Assert.assertTrue(treasureType==2, network.message(params, BasicConfig.MOBILE_joinResult, "中奖结果非实物类型", response.body().asString()));
receiveStatus=response.jsonPath().getInt("data.receiveStatus");
Assert.assertTrue(receiveStatus==2, network.message(params, BasicConfig.MOBILE_joinResult, "领取失败", response.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
visitorAuth22();
ThreadSleepUtils.sleep(1000);
response = network.getResponse(params, BasicConfig.MOBILE_joinResult);
treasureType=response.jsonPath().getInt("data.treasureType");
......@@ -257,7 +265,7 @@ public class TreasureTime implements Authorization {
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_finish, "访客H获取宝箱参与情况失败", response.body().asString()));
visitorAuth9();
visitorAuth21();
ThreadSleepUtils.sleep(1000);
Response response1 = network.postResponse(params, BasicConfig.MOBILE_finish);
Object data1=response1.jsonPath().getJsonObject("data");
......@@ -265,7 +273,7 @@ public class TreasureTime implements Authorization {
Assert.assertNotNull(data1, network.message(params, BasicConfig.MOBILE_finish, "访客H获取宝箱参与情况失败", response1.body().asString()));
//实物发完降级抽奖码
visitorAuth13();
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Response response2 = network.postResponse(params, BasicConfig.MOBILE_finish);
Object data2=response2.jsonPath().getJsonObject("data");
......@@ -291,7 +299,7 @@ public class TreasureTime implements Authorization {
System.out.println(finishFlag);
Assert.assertTrue(finishFlag, network.message(params, BasicConfig.MOBILE_joinDetail1, "访客H获取第3个宝箱参与情况失败", response.body().asString()));
visitorAuth9();
visitorAuth21();
ThreadSleepUtils.sleep(1000);
Response response1 = network.getResponse(params, BasicConfig.MOBILE_joinDetail1);
List<CondDetail> treasureList1 = JsonUtil.parseResponseToListBean(response1, CondDetail.class,"condDetail");
......@@ -300,7 +308,7 @@ public class TreasureTime implements Authorization {
Assert.assertTrue(finishFlag1, network.message(params, BasicConfig.MOBILE_joinDetail1, "访客H获取第3个宝箱参与情况失败", response.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Response response2 = network.getResponse(params, BasicConfig.MOBILE_joinDetail1);
List<CondDetail> treasureList2 = JsonUtil.parseResponseToListBean(response2, CondDetail.class,"condDetail");
......@@ -324,7 +332,7 @@ public class TreasureTime implements Authorization {
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_treasureOpen, "访客H获取宝箱参与情况失败", response.body().asString()));
visitorAuth9();
visitorAuth21();
ThreadSleepUtils.sleep(1000);
Response response1 = network.postResponse(params, BasicConfig.MOBILE_treasureOpen);
Object data1=response1.jsonPath().getJsonObject("data");
......@@ -332,7 +340,7 @@ public class TreasureTime implements Authorization {
Assert.assertNotNull(data1, network.message(params, BasicConfig.MOBILE_treasureOpen, "访客H获取宝箱参与情况失败", response1.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Response response2 = network.postResponse(params, BasicConfig.MOBILE_treasureOpen);
Object data2=response2.jsonPath().getJsonObject("data");
......@@ -357,7 +365,7 @@ public class TreasureTime implements Authorization {
Integer receiveStatus=response.jsonPath().getInt("data.receiveStatus");
Assert.assertTrue(receiveStatus==2, network.message(params, BasicConfig.MOBILE_joinResult, "领取失败", response.body().asString()));
visitorAuth9();
visitorAuth21();
ThreadSleepUtils.sleep(1000);
response = network.getResponse(params, BasicConfig.MOBILE_joinResult);
treasureType=response.jsonPath().getInt("data.treasureType");
......@@ -366,7 +374,7 @@ public class TreasureTime implements Authorization {
Assert.assertTrue(receiveStatus==2, network.message(params, BasicConfig.MOBILE_joinResult, "领取失败", response.body().asString()));
//红包发完降级抽奖码
visitorAuth13();
visitorAuth22();
ThreadSleepUtils.sleep(1000);
response = network.getResponse(params, BasicConfig.MOBILE_joinResult);
treasureType=response.jsonPath().getInt("data.treasureType");
......@@ -382,7 +390,7 @@ public class TreasureTime implements Authorization {
@Test(description = "完成第4个观看任务", priority = 15)
public void 完成第4个观看任务() {
visitorAuth9();
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -397,7 +405,7 @@ public class TreasureTime implements Authorization {
@Test(description = "获取第4个宝箱参与情况", priority = 16)
public void 获取第4个宝箱参与情况() {
visitorAuth9();
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -411,7 +419,7 @@ public class TreasureTime implements Authorization {
@Test(description = "开启第4个宝箱", priority = 17)
public void 开启第4个宝箱() {
visitorAuth9();
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -425,7 +433,7 @@ public class TreasureTime implements Authorization {
@Test(description = "查询第4个宝箱中奖结果", priority = 18)
public void 查询第4个宝箱中奖结果() {
visitorAuth9();
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......
......@@ -32,9 +32,9 @@ public class JmeterAccountFile {
public static void otoCookieMaker() {
OtoTokenCookie otoTokenCookie = new OtoTokenCookie();
otoTokenCookie.setExpiredTime(System.currentTimeMillis() + 86400*1000*150L);
otoTokenCookie.setPhoneNumber("15869195130");
otoTokenCookie.setPhoneNumber("17830855590");
otoTokenCookie.setLoginId(IdMakeUtil.encodingId(46L, IdConvertBase64Enum.DEF));
otoTokenCookie.setLoginId(IdMakeUtil.encodingId(2L, IdConvertBase64Enum.DEF));
String json = JSON.toJSONString(otoTokenCookie);
String otoToken = BlowfishUtils.encryptBlowfish(json,"02a16fs1b6a3");
......
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