Commit 8b6429a8 authored by 龚小红's avatar 龚小红

Merge branch 'gifeature/20211015-gj' into 'master'

翻牌红包首邀+必得接口

See merge request test-group/kejiji!138
parents 511673dd 967b295e
......@@ -18,6 +18,7 @@ public class FlipCard implements Authorization {
public String redConfId;
public String shareSign;
public String shareSignV;
@BeforeClass
public void setUp() {
......@@ -29,9 +30,9 @@ public class FlipCard implements Authorization {
public void 保存翻牌配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
//Params.put("liveId",6441);
Params.put("freeNum",1);
Params.put("helpNum",1);
Params.put("firstInviteStatus",2);
Params.put("freeNum",3);
Params.put("helpNum",2);
List<RedLevelBean> RedLevels = new ArrayList<>();
RedLevelBean redLevel1 = new RedLevelBean();
redLevel1.setAmount(30); //红包金额为0.3
......@@ -65,13 +66,14 @@ public class FlipCard implements Authorization {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
//Params.put("liveId",6451);
Params.put("freeNum",1);
Params.put("helpNum",1);
Params.put("firstInviteStatus",2);
Params.put("freeNum",3);
Params.put("helpNum",2);
List<RedLevelBean> RedLevels = new ArrayList<>();
RedLevelBean redLevel1 = new RedLevelBean();
redLevel1.setAmount(50); //红包金额为0.5
redLevel1.setNum(1); //红包数量
RedLevels.add(redLevel1); //红包等级III
RedLevelBean redLevel3 = new RedLevelBean();
redLevel3.setAmount(50); //红包金额为0.5
redLevel3.setNum(1); //红包数量
RedLevels.add(redLevel3); //红包等级III
Params.put("stepReds",RedLevels);
Response response = network.postResponse(Params, BasicConfig.MANAGER_saveOrUpdateV2);
boolean data = response.jsonPath().getBoolean("data");
......@@ -118,8 +120,21 @@ public class FlipCard implements Authorization {
Assert.assertTrue(flipWordConfStatus, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未开启翻牌", response.body().asString()));
}
@Test(description = "翻牌集字配置详情",priority = 7)
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_confV2);
Object data = response.jsonPath().getJsonObject("data");
String titleImage = response.jsonPath().getString("data.titleImage");
int firstInviteStatus = response.jsonPath().getInt("data.firstInviteStatus");
Assert.assertNotNull(data, network.message(params,BasicConfig.MOBILE_confV2,"翻牌配置详情查询失败",response.body().asString()));
Assert.assertNull(titleImage, network.message(params,BasicConfig.MOBILE_confV2,"获取默认标题配图失败",response.body().asString()));
Assert.assertEquals(firstInviteStatus,2, network.message(params,BasicConfig.MOBILE_confV2,"获取首邀+必得配置失败",response.body().asString()));
}
//用户任务完成
@Test(description = "访客H分享直播间", priority = 7)
@Test(description = "访客H分享直播间", priority = 8)
public void 访客H分享直播间() {
visitorAuth9();
Map<String, Object> params = new HashMap<>();
......@@ -131,8 +146,7 @@ public class FlipCard implements Authorization {
Assert.assertNotNull(shareSign, network.message(params, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "根据分享类型获取分享内容", priority = 7)
@Test(description = "根据分享类型获取分享内容", priority = 9)
public void 根据分享类型获取分享内容() {
visitorAuth9();
Map<String, Object> params = new HashMap<>();
......@@ -144,8 +158,7 @@ public class FlipCard implements Authorization {
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_helpInfo, "根据分享类型获取分享内容", response.body().asString()));
}
@Test(description = "已登录查询分享人头像昵称", priority = 8)
@Test(description = "已登录查询分享人头像昵称", priority = 10)
public void 已登录查询分享人头像昵称() {
Map<String, Object> infoParam = new HashMap<>();
......@@ -168,9 +181,105 @@ public class FlipCard implements Authorization {
}
//预约,不增加翻牌机会
@Test(description = "翻牌集字_预约", priority = 11)
public void 翻牌集字_预约() {
@Test(description = "访客H获得助力", priority = 9)
public void 访客H获得助力() {
Map<String, Object> params = new HashMap<>();
params.put("bizType",1);
params.put("bizId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("markIds",Collections.singleton(144));
visitorAuth9();
ThreadSleepUtils.sleep(2000);
Response response = network.postResponse(params, BasicConfig.MOBILE_appointment);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_appointment, "预约失败", response.body().asString()));
visitorAuth22();
ThreadSleepUtils.sleep(2000);
Response appointmentRes = network.postResponse(params, BasicConfig.MOBILE_appointment);
boolean data1 = appointmentRes.jsonPath().getBoolean("data");
System.out.println(data1);
Assert.assertTrue(data1, network.message(params, BasicConfig.MOBILE_appointment, "预约失败", appointmentRes.body().asString()));
}
//关注,增加翻牌机会
@Test(description = "翻牌集字_关注", priority = 12)
public void 翻牌集字_关注(){
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
List list = new ArrayList<>();
list.add(146);
list.add(144);
params.put("markIds",list);
visitorAuth9();
ThreadSleepUtils.sleep(2000);
Response response = network.postResponse(params, BasicConfig.USER_SUBSCRIBE);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(params, BasicConfig.USER_SUBSCRIBE, "关注失败", response.body().asString()));
visitorAuth22();
ThreadSleepUtils.sleep(2000);
Response subscribeRes = network.postResponse(params, BasicConfig.USER_SUBSCRIBE);
boolean data1 = subscribeRes.jsonPath().getBoolean("data");
System.out.println(data1);
Assert.assertTrue(data1, network.message(params, BasicConfig.USER_SUBSCRIBE, "预约失败", subscribeRes.body().asString()));
}
//翻牌,关注和3次的免费次数
@Test(description = "翻牌", priority = 13)
public void 翻牌() {
for (int i =0;i<4;i++){
Map<String, Object> params = new HashMap<>();
params.put("turnType",1);//1-活动页翻牌,2-助力翻牌
params.put("pos",i);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
visitorAuth9();
Response response = network.postResponse(params, BasicConfig.MOBILE_turn);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_turn, "翻牌开启失败", response.body().asString()));
ThreadSleepUtils.sleep(5000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("turnType",1);
infoParam.put("pos",i);
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response infoRes = network.getResponse(params, BasicConfig.MOBILE_turnState);
Object data1 = infoRes.jsonPath().getJsonObject("data");
System.out.println(data1);
Assert.assertNotNull(data1, network.message(params, BasicConfig.MOBILE_turnState, "用户H翻牌参与详情查询失败", infoRes.body().asString()));
visitorAuth22();
Response turnRes = network.postResponse(params, BasicConfig.MOBILE_turn);
boolean data2 = turnRes.jsonPath().getBoolean("data");
System.out.println(data2);
Assert.assertTrue(data2, network.message(params, BasicConfig.MOBILE_turn, "翻牌开启失败", turnRes.body().asString()));
ThreadSleepUtils.sleep(5000);
Map<String, Object> turnStateParam = new HashMap<>();
turnStateParam.put("turnType",1);
turnStateParam.put("pos",i);
turnStateParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response turnStateParamRes = network.getResponse(params, BasicConfig.MOBILE_turnState);
Object data3 = turnStateParamRes.jsonPath().getJsonObject("data");
System.out.println(data3);
Assert.assertNotNull(data3, network.message(params, BasicConfig.MOBILE_turnState, "用户H翻牌参与详情查询失败", turnStateParamRes.body().asString()));
}
}
@Test(description = "访客H完成首邀助力", priority = 14)
public void 访客H完成首邀助力() {
Map<String, Object> params = new HashMap<>();
visitorAuth22();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -191,34 +300,25 @@ public class FlipCard implements Authorization {
System.out.println(data);
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_assist, "用户V给用户H助力失败", response.body().asString()));
visitorAuth25();
response = network.postResponse(params, BasicConfig.MOBILE_assist);
boolean data1 = response.jsonPath().getBoolean("data");
System.out.println(data1);
Assert.assertTrue(data1, network.message(params, BasicConfig.MOBILE_assist, "用户S给用户H助力失败", response.body().asString()));
}
@Test(description = "访客S分享直播间", priority = 10)
public void 访客S分享直播间() {
@Test(description = "访客V分享直播间", priority = 15)
public void 访客V分享直播间() {
visitorAuth22();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareType",2);
Response signRes = network.getResponse(params, BasicConfig.MOBILE_sign);
String data = signRes.jsonPath().getString("data");
shareSign = data;
System.out.println(shareSign);
Assert.assertNotNull(shareSign, network.message(params, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
shareSignV = data;
System.out.println(shareSignV);
Assert.assertNotNull(shareSignV, network.message(params, BasicConfig.MOBILE_sign, "分享失败", signRes.body().asString()));
}
@Test(description = "访客S获得助力", priority = 11)
public void 访客S获得助力() {
@Test(description = "访客V完成首邀助力", priority = 16)
public void 访客V完成首邀助力() {
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareSign",shareSign);
params.put("shareSign",shareSignV);
params.put("shareType",12);
//params.put("confId",this.redConfId);
......@@ -226,67 +326,48 @@ public class FlipCard implements Authorization {
Response response = network.postResponse(params, BasicConfig.MOBILE_assist);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_assist, "用户H给用户S助力失败", response.body().asString()));
visitorAuth1();
Response assistRes = network.postResponse(params, BasicConfig.MOBILE_assist);
boolean data1 = assistRes.jsonPath().getBoolean("data");
System.out.println(data1);
Assert.assertTrue(data1, network.message(params, BasicConfig.MOBILE_assist, "用户A给用户S助力失败", response.body().asString()));
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_assist, "用户H给用户V助力失败", response.body().asString()));
}
//签到
@Test(description = "用户签到", priority = 15)
public void 用户签到() {
@Test(description = "查询用户邀请详情",priority =17)
public void 查询用户邀请详情(){
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("markIds", Collections.singleton(149));
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
visitorAuth9();
Response response = network.postResponse(params, BasicConfig.MOBILE_checkIn);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(response.body().asString());
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_checkIn, "用户签到失败", response.body().asString()));
Response response = network.getResponse(params,BasicConfig.MOBILE_helpDetail);
int helpNum = response.jsonPath().getInt("data.helpNum");
Assert.assertTrue(helpNum==1, network.message(params, BasicConfig.MOBILE_tasks, "助力用户数为null", response.body().asString()));
visitorAuth22();
Response checkinRes = network.postResponse(params, BasicConfig.MOBILE_checkIn);
boolean data1 = checkinRes.jsonPath().getBoolean("data");
System.out.println(checkinRes.body().asString());
Assert.assertTrue(data1, network.message(params, BasicConfig.MOBILE_checkIn, "用户签到失败", checkinRes.body().asString()));
Response response22 = network.getResponse(params,BasicConfig.MOBILE_helpDetail);
int helpNum22 = response.jsonPath().getInt("data.helpNum");
Assert.assertTrue(helpNum22==1, network.message(params, BasicConfig.MOBILE_tasks, "助力用户数为null", response22.body().asString()));
}
@Test(description = "查询用户翻牌剩余次数", priority = 18)
public void 查询用户翻牌剩余次数() {
//预约
@Test(description = "翻牌集字_预约", priority = 16)
public void 翻牌集字_预约() {
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("bizType",1);
params.put("bizId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("markIds",Collections.singleton(144));
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
visitorAuth9();
ThreadSleepUtils.sleep(2000);
Response response = network.postResponse(params, BasicConfig.MOBILE_appointment);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_appointment, "预约失败", response.body().asString()));
Response response = network.getResponse(params, BasicConfig.MOBILE_record);
System.out.println(response.body().asString());
int leftNum =response.jsonPath().getJsonObject("data.leftNum");
//完成首邀后获得两次翻牌机会
Assert.assertTrue(leftNum==2, network.message(params, BasicConfig.MOBILE_record, "翻牌次数不足", response.body().asString()));
visitorAuth22();
ThreadSleepUtils.sleep(2000);
Response appointmentRes = network.postResponse(params, BasicConfig.MOBILE_appointment);
boolean data1 = appointmentRes.jsonPath().getBoolean("data");
System.out.println(data1);
Assert.assertTrue(data1, network.message(params, BasicConfig.MOBILE_appointment, "预约失败", appointmentRes.body().asString()));
Response recordRes= network.getResponse(params, BasicConfig.MOBILE_record);
System.out.println(recordRes.body().asString());
int leftNum1 =response.jsonPath().getJsonObject("data.leftNum");
//完成首邀后获得两次翻牌机会
Assert.assertTrue(leftNum1==2, network.message(params, BasicConfig.MOBILE_record, "翻牌次数不足", recordRes.body().asString()));
}
@Test(description = "用户完成任务情况", priority = 17)
@Test(description = "用户完成任务情况", priority = 19)
public void 用户完成任务情况() {
Map<String, Object> params = new HashMap<>();
......@@ -294,55 +375,32 @@ public class FlipCard implements Authorization {
visitorAuth9();
Response response = network.getResponse(params, BasicConfig.MOBILE_tasks);
System.out.println(response.body().asString());
boolean checkInStatus=response.jsonPath().getBoolean("data.checkInStatus");
Assert.assertTrue(checkInStatus, network.message(params, BasicConfig.MOBILE_tasks, "签到未完成", response.body().asString()));
boolean appointmentStatus=response.jsonPath().getBoolean("data.appointmentStatus");
Assert.assertTrue(appointmentStatus, network.message(params, BasicConfig.MOBILE_tasks, "预约失败", response.body().asString()));
int helpNum=response.jsonPath().getInt("data.helpNum");
Assert.assertTrue(helpNum==2, network.message(params, BasicConfig.MOBILE_tasks, "助力用户数为null", response.body().asString()));
Assert.assertTrue(helpNum==1, network.message(params, BasicConfig.MOBILE_tasks, "助力用户数为null", response.body().asString()));
boolean subscribeStatus = response.jsonPath().getBoolean("data.subscribeStatus");
Assert.assertTrue(subscribeStatus, network.message(params,BasicConfig.MOBILE_tasks,"关注失败", response.body().asString()));
visitorAuth22();
Response tasksRes = network.getResponse(params, BasicConfig.MOBILE_tasks);
System.out.println(tasksRes.body().asString());
boolean checkInStatus1=tasksRes.jsonPath().getBoolean("data.checkInStatus");
Assert.assertTrue(checkInStatus1, network.message(params, BasicConfig.MOBILE_tasks, "签到未完成", tasksRes.body().asString()));
boolean appointmentStatus1=tasksRes.jsonPath().getBoolean("data.appointmentStatus");
Assert.assertTrue(appointmentStatus1, network.message(params, BasicConfig.MOBILE_tasks, "预约失败", tasksRes.body().asString()));
int helpNum1=tasksRes.jsonPath().getInt("data.helpNum");
Assert.assertTrue(helpNum1==2, network.message(params, BasicConfig.MOBILE_tasks, "助力用户数为null", tasksRes.body().asString()));
Assert.assertTrue(helpNum1==1, network.message(params, BasicConfig.MOBILE_tasks, "助力用户数为null", tasksRes.body().asString()));
boolean subscribeStatus22 = tasksRes.jsonPath().getBoolean("data.subscribeStatus");
Assert.assertTrue(subscribeStatus22, network.message(params,BasicConfig.MOBILE_tasks,"关注失败", tasksRes.body().asString()));
}
@Test(description = "查询用户翻牌剩余次数", priority = 18)
public void 查询用户翻牌剩余次数() {
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
visitorAuth9();
Response response = network.getResponse(params, BasicConfig.MOBILE_record);
System.out.println(response.body().asString());
int leftNum =response.jsonPath().getJsonObject("data.leftNum");
Assert.assertTrue(leftNum==5, network.message(params, BasicConfig.MOBILE_record, "翻牌次数不足", response.body().asString()));
visitorAuth22();
Response recordRes= network.getResponse(params, BasicConfig.MOBILE_record);
System.out.println(recordRes.body().asString());
int leftNum1 =response.jsonPath().getJsonObject("data.leftNum");
Assert.assertTrue(leftNum1==5, network.message(params, BasicConfig.MOBILE_record, "翻牌次数不足", recordRes.body().asString()));
}
@Test(description = "翻牌", priority = 19)
public void 翻牌() {
for (int i =0;i<6;i++){
//用户H、V首邀后翻牌
@Test(description = "首邀翻牌", priority = 20)
public void 首邀翻牌() {
for (int i = 4; i < 6; i++) {
Map<String, Object> params = new HashMap<>();
params.put("turnType",1);//1-活动页翻牌,2-助力翻牌
params.put("pos",i);
params.put("turnType", 1);//1-活动页翻牌,2-助力翻牌
params.put("pos", i);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
visitorAuth9();
......@@ -353,8 +411,8 @@ public class FlipCard implements Authorization {
ThreadSleepUtils.sleep(5000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("turnType",1);
infoParam.put("pos",i);
infoParam.put("turnType", 1);
infoParam.put("pos", i);
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response infoRes = network.getResponse(params, BasicConfig.MOBILE_turnState);
Object data1 = infoRes.jsonPath().getJsonObject("data");
......@@ -369,20 +427,101 @@ public class FlipCard implements Authorization {
ThreadSleepUtils.sleep(5000);
Map<String, Object> turnStateParam = new HashMap<>();
turnStateParam.put("turnType",1);
turnStateParam.put("pos",i);
turnStateParam.put("turnType", 1);
turnStateParam.put("pos", i);
turnStateParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response turnStateParamRes = network.getResponse(params, BasicConfig.MOBILE_turnState);
Object data3 = turnStateParamRes.jsonPath().getJsonObject("data");
System.out.println(data3);
Assert.assertNotNull(data3, network.message(params, BasicConfig.MOBILE_turnState, "用户H翻牌参与详情查询失败", turnStateParamRes.body().asString()));
Assert.assertNotNull(data3, network.message(params, BasicConfig.MOBILE_turnState, "用户V翻牌参与详情查询失败", turnStateParamRes.body().asString()));
}
}
//管理后台红包等级I、II的"进行中"红包个数为1,用户弹出天降幸运任务即占一个红包库存
@Test(description = "获取进行中的红包个数",priority = 21)
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_detailV2);
Object stockNum1 = response.jsonPath().getJsonObject("data.stepReds.get(0).stockNum");
Object stockNum2 = response.jsonPath().getJsonObject("data.stepReds.get(1).stockNum");
Assert.assertEquals(stockNum1 ,1, network.message(Params,BasicConfig.MANAGER_detailV2,"访客H占用红包库存失败",response.body().asString()));
Assert.assertEquals(stockNum2 ,1, network.message(Params,BasicConfig.MANAGER_detailV2,"访客V占用红包库存失败",response.body().asString()));
}
@Test(description = "访客H获得第二次助力", priority = 22)
public void 访客H获得第二次助力() {
Map<String, Object> params = new HashMap<>();
visitorAuth25();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareSign",shareSign);
params.put("shareType",12);
Response response = network.postResponse(params, BasicConfig.MOBILE_assist);
boolean data1 = response.jsonPath().getBoolean("data");
System.out.println(data1);
Assert.assertTrue(data1, network.message(params, BasicConfig.MOBILE_assist, "用户S给用户H助力失败", response.body().asString()));
}
@Test(description = "访客V获得第二次助力", priority = 23)
public void 访客V获得第二次助力() {
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareSign",shareSignV);
params.put("shareType",12);
//params.put("confId",this.redConfId);
visitorAuth1();
Response assistRes = network.postResponse(params, BasicConfig.MOBILE_assist);
boolean data1 = assistRes.jsonPath().getBoolean("data");
System.out.println(data1);
Assert.assertTrue(data1, network.message(params, BasicConfig.MOBILE_assist, "用户A给用户V助力失败", assistRes.body().asString()));
}
//用户H、V天降幸运翻牌
@Test(description = "天降幸运翻牌", priority = 24)
public void 天降幸运翻牌() {
Map<String, Object> params = new HashMap<>();
params.put("turnType",1);//1-活动页翻牌,2-助力翻牌
params.put("pos",6);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
visitorAuth9();
Response response = network.postResponse(params, BasicConfig.MOBILE_turn);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_turn, "翻牌开启失败", response.body().asString()));
@Test(description = "用户参与翻牌详情", priority = 20)
ThreadSleepUtils.sleep(5000);
Map<String, Object> infoParam = new HashMap<>();
infoParam.put("turnType",1);
infoParam.put("pos",6);
infoParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response infoRes = network.getResponse(params, BasicConfig.MOBILE_turnState);
Object data1 = infoRes.jsonPath().getJsonObject("data");
System.out.println(data1);
Assert.assertNotNull(data1, network.message(params, BasicConfig.MOBILE_turnState, "用户H翻牌参与详情查询失败", infoRes.body().asString()));
visitorAuth22();
Response turnRes = network.postResponse(params, BasicConfig.MOBILE_turn);
boolean data2 = turnRes.jsonPath().getBoolean("data");
System.out.println(data2);
Assert.assertTrue(data2, network.message(params, BasicConfig.MOBILE_turn, "翻牌开启失败", turnRes.body().asString()));
ThreadSleepUtils.sleep(5000);
Map<String, Object> turnStateParam = new HashMap<>();
turnStateParam.put("turnType",1);
turnStateParam.put("pos",6);
turnStateParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response turnStateParamRes = network.getResponse(params, BasicConfig.MOBILE_turnState);
Object data3 = turnStateParamRes.jsonPath().getJsonObject("data");
System.out.println(data3);
Assert.assertNotNull(data3, network.message(params, BasicConfig.MOBILE_turnState, "用户V翻牌参与详情查询失败", turnStateParamRes.body().asString()));
}
@Test(description = "用户参与翻牌详情", priority = 25)
public void 用户参与翻牌详情() {
ThreadSleepUtils.sleep(1000);
......@@ -394,7 +533,10 @@ public class FlipCard implements Authorization {
int finishStatus=response.jsonPath().getInt("data.finishStatus");
Assert.assertTrue(finishStatus==2, network.message(params, BasicConfig.MOBILE_record, "未完成集字", response.body().asString()));
int flipNum=response.jsonPath().getInt("data.flipNum");
Assert.assertTrue(flipNum==5, network.message(params, BasicConfig.MOBILE_record, "翻牌次数不足5次", response.body().asString()));
Assert.assertTrue(flipNum==7, network.message(params, BasicConfig.MOBILE_record, "翻牌次数不足7次", response.body().asString()));
//获取天降幸运信息
Object luckyDetail = response.jsonPath().getJsonObject("data.luckyDetail");
Assert.assertNotNull(luckyDetail, network.message(params,BasicConfig.MOBILE_record,"天降幸运信息记录错误",response.body().asString()));
visitorAuth22();
......@@ -403,11 +545,25 @@ public class FlipCard implements Authorization {
int finishStatus1=recordRes.jsonPath().getInt("data.finishStatus");
Assert.assertTrue(finishStatus1==2, network.message(params, BasicConfig.MOBILE_record, "未完成集字", recordRes.body().asString()));
int flipNum1=recordRes.jsonPath().getInt("data.flipNum");
Assert.assertTrue(flipNum1==5, network.message(params, BasicConfig.MOBILE_record, "翻牌次数不足5次", recordRes.body().asString()));
Assert.assertTrue(flipNum1==7, network.message(params, BasicConfig.MOBILE_record, "翻牌次数不足7次", recordRes.body().asString()));
//获取天降幸运信息
Object luckyDetail22 = recordRes.jsonPath().getJsonObject("data.luckyDetail");
Assert.assertNotNull(luckyDetail22, network.message(params,BasicConfig.MOBILE_record,"天降幸运信息记录错误",recordRes.body().asString()));
}
@Test(description = "获取天降幸运信息", priority = 26)
public void 获取天降幸运信息(){
ThreadSleepUtils.sleep(1000);
Map<String,Object> params = new HashMap<>();
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params,BasicConfig.MOBILE_userLucky);
int luckyStatus = response.jsonPath().getInt("data.luckyStatus");
Assert.assertTrue(luckyStatus==2, network.message(params,BasicConfig.MOBILE_userLucky,"天降幸运状态错误",response.body().asString()));
int luckyCardCount = response.jsonPath().getInt("data.luckyCardCount");
Assert.assertTrue(luckyCardCount==1, network.message(params,BasicConfig.MOBILE_userLucky,"天降幸运状态错误",response.body().asString()));
}
@Test(description = "翻牌集字领取历史记录", priority = 21)
@Test(description = "翻牌集字领取历史记录", priority = 27)
public void 翻牌集字领取历史记录() {
ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>();
......@@ -431,7 +587,7 @@ public class FlipCard implements Authorization {
//开红包
@Test(description = "用户开红包资格查询", priority = 22)
@Test(description = "用户开红包资格查询", priority = 28)
public void 用户开红包资格查询() {
ThreadSleepUtils.sleep(5000);
......@@ -448,24 +604,9 @@ public class FlipCard implements Authorization {
System.out.println(finishRes.body().asString());
int status1 =finishRes.jsonPath().getInt("data.status");
Assert.assertTrue(status1==2, network.message(params, BasicConfig.MOBILE_finishStatus, "未完成集字", finishRes.body().asString()));
}
// @Test(description = "放弃开红包", priority = 23)
// public void 放弃开红包() {
// visitorAuth22();
// ThreadSleepUtils.sleep(1000);
// Map<String, Object> params = new HashMap<>();
// params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
// Response response = network.postResponse(params, BasicConfig.MOBILE_abort);
// System.out.println(response.body().asString());
// boolean data =response.jsonPath().getBoolean("data");
// Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_abort, "放弃开红包报异常", response.body().asString()));
//
// }
@Test(description = "开红包", priority = 24)
@Test(description = "开红包", priority = 29)
public void 开红包() {
visitorAuth9();
ThreadSleepUtils.sleep(1000);
......@@ -484,7 +625,7 @@ public class FlipCard implements Authorization {
Assert.assertTrue(data2, network.message(params, BasicConfig.MOBILE_redOpen, "开红包失败", response2.body().asString()));
}
@Test(description = "用户开红包状态查询", priority = 25)
@Test(description = "用户开红包状态查询", priority = 30)
public void 用户开红包状态查询() {
ThreadSleepUtils.sleep(3000);
Map<String, Object> params = new HashMap<>();
......@@ -510,7 +651,7 @@ public class FlipCard implements Authorization {
}
//开启不同等级的红包
@Test(description = "开红包结果", priority = 26)
@Test(description = "开红包结果", priority = 31)
public void 开红包结果() {
//红包等级I
visitorAuth9();
......@@ -537,15 +678,15 @@ public class FlipCard implements Authorization {
}
@Test(description = "翻牌集字配置详情",priority = 27)
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_confV2);
Object data = response.jsonPath().getJsonObject("data");
String titleImage = response.jsonPath().getString("data.titleImage");
Assert.assertNotNull(data, network.message(params,BasicConfig.MOBILE_confV2,"翻牌配置详情查询失败",response.body().asString()));
Assert.assertNull(titleImage, network.message(params,BasicConfig.MOBILE_confV2,"获取默认标题配图失败",response.body().asString()));
//验证管理后台发放的红包个数
@Test(description = "获取已发放的红包个数",priority = 32)
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_detailV2);
Object receiveNum1 = response.jsonPath().getJsonObject("data.stepReds.get(0).receiveNum");
Object receiveNum2 = response.jsonPath().getJsonObject("data.stepReds.get(1).receiveNum");
Assert.assertEquals(receiveNum1 ,1, network.message(Params,BasicConfig.MANAGER_detailV2,"访客H发放红包记录错误",response.body().asString()));
Assert.assertEquals(receiveNum2 ,1, network.message(Params,BasicConfig.MANAGER_detailV2,"访客V发放红包记录错误",response.body().asString()));
}
}
}
\ No newline at end of file
......@@ -266,13 +266,14 @@ public class BasicConfig {
public static final String MOBILE_finishStatus= MOBILE_HOST + "/kjy/live/flip/word/user/finishStatus";
public static final String MOBILE_redOpen= MOBILE_HOST + "/kjy/live/flip/word/red/open";
public static final String MOBILE_redOpenState= MOBILE_HOST + "/kjy/live/flip/word/red/open/state";
public static final String MOBILE_abort= MOBILE_HOST + "/kjy/live/flip/word/red/abort";
public static final String MOBILE_appointment= MOBILE_HOST + "/kjy/live/user/appointment";
public static final String MOBILE_tasks= MOBILE_HOST + "/kjy/live/flip/word/user/tasks";
public static final String MOBILE_record= MOBILE_HOST + "/kjy/live/flip/word/user/record";
public static final String MOBILE_turn= MOBILE_HOST + "/kjy/live/flip/word/turn";
public static final String MOBILE_turnState= MOBILE_HOST + "/kjy/live/flip/word/turn/state";
public static final String MOBILE_confV2= MOBILE_HOST +"/kjy/live/flip/word/conf/v2";
public static final String MOBILE_userLucky= MOBILE_HOST +"/kjy/live/flip/word/user/lucky";
public static final String MOBILE_helpDetail= MOBILE_HOST + "/kjy/live/flip/word/user/helpDetail";
// *************** 直播间过渡视频 ***************
public static final String MANAGER_confCaveOrUpdate = MANAGER_HOST + "/kjy/manager/live/trans/video/conf/saveOrUpdate";
public static final String MANAGER_videoSwitch = MANAGER_HOST + "/kjy/manager/live/trans/video/conf/status/switch";
......
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