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; ...@@ -16,11 +16,19 @@ import org.testng.annotations.Test;
import java.util.*; import java.util.*;
import static com.kjj.utils.BaseUtils.connectSuccess;
public class Answer implements Authorization { public class Answer implements Authorization {
@BeforeClass @BeforeClass
public void setUp() { public void setUp() {
BaseUtils.ssoLogin(); BaseUtils.ssoLogin();
visitorAuth20();
connectSuccess();
agentAuth2();
connectSuccess();
} }
public int id; public int id;
...@@ -561,7 +569,7 @@ public class Answer implements Authorization { ...@@ -561,7 +569,7 @@ public class Answer implements Authorization {
@Test(description = "领取有奖答题福利-访客A答题正确", priority = 30) @Test(description = "领取有奖答题福利-访客A答题正确", priority = 30)
public void 访客A领取有奖答题福利() public void 访客A领取有奖答题福利()
{ {
visitorAuth3(); visitorAuth20();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("quesConfId", this.quesConfId.get(2).getQuesConfId()); params.put("quesConfId", this.quesConfId.get(2).getQuesConfId());
...@@ -582,7 +590,7 @@ public class Answer implements Authorization { ...@@ -582,7 +590,7 @@ public class Answer implements Authorization {
@Test(description = "查询访客A领取有奖答题福利结果", priority = 31) @Test(description = "查询访客A领取有奖答题福利结果", priority = 31)
public void 查询访客A领取有奖答题福利结果() public void 查询访客A领取有奖答题福利结果()
{ {
visitorAuth3(); visitorAuth20();
ThreadSleepUtils.sleep(3000); ThreadSleepUtils.sleep(3000);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
...@@ -757,7 +765,7 @@ public class Answer implements Authorization { ...@@ -757,7 +765,7 @@ public class Answer implements Authorization {
@Test(description = "访客查询第二轮答题福利", priority = 40) @Test(description = "访客查询第二轮答题福利", priority = 40)
public void 访客查询第二轮答题福利() public void 访客查询第二轮答题福利()
{ {
visitorAuth3(); visitorAuth20();
ThreadSleepUtils.sleep(3000); ThreadSleepUtils.sleep(3000);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
...@@ -776,7 +784,7 @@ public class Answer implements Authorization { ...@@ -776,7 +784,7 @@ public class Answer implements Authorization {
@Test(description = "访客A第二轮领取有奖答题福利-答题正确", priority = 41) @Test(description = "访客A第二轮领取有奖答题福利-答题正确", priority = 41)
public void 访客A第二轮领取有奖答题福利() public void 访客A第二轮领取有奖答题福利()
{ {
visitorAuth3(); visitorAuth20();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("quesConfId", this.quesConfId.get(3).getQuesConfId()); params.put("quesConfId", this.quesConfId.get(3).getQuesConfId());
...@@ -795,7 +803,7 @@ public class Answer implements Authorization { ...@@ -795,7 +803,7 @@ public class Answer implements Authorization {
@Test(description = "查询访客A第二轮有奖答题福利类型结果", priority = 42) @Test(description = "查询访客A第二轮有奖答题福利类型结果", priority = 42)
public void 查询访客A第二轮有奖答题福利类型结果() public void 查询访客A第二轮有奖答题福利类型结果()
{ {
visitorAuth3(); visitorAuth20();
ThreadSleepUtils.sleep(3000); ThreadSleepUtils.sleep(3000);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
...@@ -1155,7 +1163,7 @@ public class Answer implements Authorization { ...@@ -1155,7 +1163,7 @@ public class Answer implements Authorization {
@Test(description = "领取有奖答题福利类型-访客A答题正确", priority = 61) @Test(description = "领取有奖答题福利类型-访客A答题正确", priority = 61)
public void 访客A领取有奖答题福利类型() public void 访客A领取有奖答题福利类型()
{ {
visitorAuth3(); visitorAuth20();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("quesConfId", this.quesConfId.get(5).getQuesConfId()); params.put("quesConfId", this.quesConfId.get(5).getQuesConfId());
...@@ -1173,7 +1181,7 @@ public class Answer implements Authorization { ...@@ -1173,7 +1181,7 @@ public class Answer implements Authorization {
@Test(description = "访客A领取有奖答题福利结果", priority = 62) @Test(description = "访客A领取有奖答题福利结果", priority = 62)
public void 访客A领取有奖答题福利结果() public void 访客A领取有奖答题福利结果()
{ {
visitorAuth3(); visitorAuth20();
ThreadSleepUtils.sleep(3000); ThreadSleepUtils.sleep(3000);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
...@@ -1314,7 +1322,7 @@ public class Answer implements Authorization { ...@@ -1314,7 +1322,7 @@ public class Answer implements Authorization {
@Test(description = "访客查询第四轮答题福利", priority = 70) @Test(description = "访客查询第四轮答题福利", priority = 70)
public void 代理人查询第四轮答题福利() public void 代理人查询第四轮答题福利()
{ {
adminAuth(); agentAuth2();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_QuesDetail); Response response = network.getResponse(params, BasicConfig.MOBILE_QuesDetail);
...@@ -1334,7 +1342,7 @@ public class Answer implements Authorization { ...@@ -1334,7 +1342,7 @@ public class Answer implements Authorization {
} }
@Test(description = "代理人第四轮领取答题福利-答题正确",priority = 71) @Test(description = "代理人第四轮领取答题福利-答题正确",priority = 71)
public void 代理人第四轮领取答题福利(){ public void 代理人第四轮领取答题福利(){
agentAuth(); agentAuth2();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("quesConfId", this.quesConfId.get(7).getQuesConfId()); params.put("quesConfId", this.quesConfId.get(7).getQuesConfId());
...@@ -1349,7 +1357,7 @@ public class Answer implements Authorization { ...@@ -1349,7 +1357,7 @@ public class Answer implements Authorization {
@Test(description = "查询代理人第四轮有奖答题福利类型结果",priority = 72) @Test(description = "查询代理人第四轮有奖答题福利类型结果",priority = 72)
public void 查询代理人第四轮有奖答题福利类型结果(){ public void 查询代理人第四轮有奖答题福利类型结果(){
//验证管理后台配置实物奖品允许代理人参与并获奖 //验证管理后台配置实物奖品允许代理人参与并获奖
agentAuth(); agentAuth2();
ThreadSleepUtils.sleep(3000); ThreadSleepUtils.sleep(3000);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......
...@@ -158,6 +158,14 @@ public class LiveBinding implements Authorization { ...@@ -158,6 +158,14 @@ public class LiveBinding implements Authorization {
visitorAuth30(); visitorAuth30();
binding(this.shareSign);; binding(this.shareSign);;
token(); token();
visitorAuth20();
binding(this.shareSign);;
token();
visitorAuth21();
binding(this.shareSign);;
token();
} }
@Test(description = "访客J_分享直播间", priority = 8) @Test(description = "访客J_分享直播间", priority = 8)
......
...@@ -275,6 +275,7 @@ public class GoldenEgg implements Authorization { ...@@ -275,6 +275,7 @@ public class GoldenEgg implements Authorization {
boolean data =response.jsonPath().getBoolean("data"); boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString())); Assert.assertTrue(data, network.message(chooseAwardParam, BasicConfig.MOBILE_goldenEgg_open, "砸金蛋失败", response.body().asString()));
sleep(2000);
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); param.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
param.put("treasureConfId",ConfId); param.put("treasureConfId",ConfId);
......
...@@ -533,6 +533,7 @@ public class Treasure implements Authorization { ...@@ -533,6 +533,7 @@ public class Treasure implements Authorization {
@Test(description = "访客H第3轮开宝箱参与详情", priority = 45) @Test(description = "访客H第3轮开宝箱参与详情", priority = 45)
public void 访客H3轮开宝箱参与详情() { public void 访客H3轮开宝箱参与详情() {
//直播有整体限制单个客户仅能中奖实物一次
visitorAuth9(); visitorAuth9();
ThreadSleepUtils.sleep(2000); ThreadSleepUtils.sleep(2000);
Map<String, Object> infoParam = new HashMap<>(); Map<String, Object> infoParam = new HashMap<>();
...@@ -541,7 +542,7 @@ public class Treasure implements Authorization { ...@@ -541,7 +542,7 @@ public class Treasure implements Authorization {
Response response = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo); Response response = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType=response.jsonPath().getInt("data.treasureType"); int treasureType=response.jsonPath().getInt("data.treasureType");
System.out.println(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"); int receiveStatus=response.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus); System.out.println(receiveStatus);
...@@ -593,8 +594,6 @@ public class Treasure implements Authorization { ...@@ -593,8 +594,6 @@ public class Treasure implements Authorization {
Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "访客R给访客M助力失败", response.body().asString())); Assert.assertTrue(data, network.message(infoParam, BasicConfig.MOBILE_assist, "访客R给访客M助力失败", response.body().asString()));
} }
//验证实物奖品数量是否会超发
@Test(description = "访客H第4次参与详情的进度显示", priority = 53) @Test(description = "访客H第4次参与详情的进度显示", priority = 53)
public void 访客H4次参与详情的进度显示() { public void 访客H4次参与详情的进度显示() {
visitorAuth9(); visitorAuth9();
...@@ -657,7 +656,7 @@ public class Treasure implements Authorization { ...@@ -657,7 +656,7 @@ public class Treasure implements Authorization {
Response response = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo); Response response = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType=response.jsonPath().getInt("data.treasureType"); int treasureType=response.jsonPath().getInt("data.treasureType");
System.out.println(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"); int receiveStatus=response.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus); System.out.println(receiveStatus);
...@@ -669,7 +668,7 @@ public class Treasure implements Authorization { ...@@ -669,7 +668,7 @@ public class Treasure implements Authorization {
Response responseB = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo); Response responseB = network.getResponse(infoParam, BasicConfig.MANAGER_participateInfo);
int treasureType1=responseB.jsonPath().getInt("data.treasureType"); int treasureType1=responseB.jsonPath().getInt("data.treasureType");
System.out.println(treasureType1); 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"); int receiveStatus1=responseB.jsonPath().getInt("data.receiveStatus");
System.out.println(receiveStatus1); System.out.println(receiveStatus1);
......
...@@ -32,9 +32,9 @@ public class JmeterAccountFile { ...@@ -32,9 +32,9 @@ public class JmeterAccountFile {
public static void otoCookieMaker() { public static void otoCookieMaker() {
OtoTokenCookie otoTokenCookie = new OtoTokenCookie(); OtoTokenCookie otoTokenCookie = new OtoTokenCookie();
otoTokenCookie.setExpiredTime(System.currentTimeMillis() + 86400*1000*150L); 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 json = JSON.toJSONString(otoTokenCookie);
String otoToken = BlowfishUtils.encryptBlowfish(json,"02a16fs1b6a3"); 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