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

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

Gifeature/20210924 gj

See merge request test-group/kejiji!128
parents 5889baec 16cf5618
package com.kjj.bean.manager;
import lombok.Data;
@Data
public class RedLevelBean {
private int amount;
private int num;
}
package com.kjj.cases.live.flipCard; package com.kjj.cases.live.flipCard;
import com.kjj.bean.manager.RedLevelBean;
import com.kjj.cases.admin.Authorization; import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig; import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants; import com.kjj.constants.LiveConstants;
...@@ -108,6 +109,99 @@ public class FlipCard implements Authorization { ...@@ -108,6 +109,99 @@ 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("liveId",6441);
Params.put("freeNum",1);
Params.put("helpNum",1);
List<RedLevelBean> RedLevels = new ArrayList<>();
RedLevelBean redLevel1 = new RedLevelBean();
redLevel1.setAmount(30); //红包金额为0.3
redLevel1.setNum(1); //红包数量
RedLevels.add(redLevel1); //红包等级I
RedLevelBean redLevel2 = new RedLevelBean();
redLevel2.setAmount(40); //红包金额为0.4
redLevel2.setNum(1); //红包数量
RedLevels.add(redLevel2); //红包等级II
Params.put("stepReds",RedLevels);
Response response = network.postResponse(Params, BasicConfig.MANAGER_saveOrUpdateV2);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_saveOrUpdateV2, "保存翻牌配置失败", 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()));
//Params.put("liveId",6441);
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 = 3)
public void 编辑红包等级(){
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);
List<RedLevelBean> RedLevels = new ArrayList<>();
RedLevelBean redLevel1 = new RedLevelBean();
redLevel1.setAmount(50); //红包金额为0.5
redLevel1.setNum(1); //红包数量
RedLevels.add(redLevel1); //红包等级III
Params.put("stepReds",RedLevels);
Response response = network.postResponse(Params, BasicConfig.MANAGER_saveOrUpdateV2);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_saveOrUpdateV2, "编辑翻牌红包等级失败", 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()));
//Params.put("liveId",6439);
Response response = network.getResponse(Params, BasicConfig.MANAGER_detailV2);
Object data = response.jsonPath().getJsonObject("data");
redConfId = response.jsonPath().getString("data.stepReds.get(2).redConfId");
System.out.println(data);
System.out.println(redConfId);
Assert.assertNotNull(data, network.message(Params, BasicConfig.MANAGER_detailV2, "查看直播翻牌配置详情失败", response.body().asString()));
}
@Test(description = "删除红包等级",priority = 5)
public void 删除红包等级(){
Map<String,Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
//Params.put("liveId",6439);
Params.put("redConfId",redConfId);
//Params.put("redConfId",28877);
Response response = network.postResponse(Params,BasicConfig.MANAGER_wordDelete);
boolean data = response.jsonPath().getBoolean("data");
String desc = response.jsonPath().getString("desc");
Assert.assertTrue(data, network.message(Params,BasicConfig.MANAGER_wordDelete,"删除红包等级失败",response.body().asString()));
Assert.assertEquals(desc,"OK",network.message(Params,BasicConfig.MANAGER_wordDelete,"删除红包等级失败",response.body().asString()));
}
@Test(description = "查看直播配置", priority = 6)
public void 查看直播配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
//Params.put("liveId",6439);
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 = "访客H分享直播间", priority = 7) @Test(description = "访客H分享直播间", priority = 7)
public void 访客H分享直播间() { public void 访客H分享直播间() {
...@@ -177,7 +271,7 @@ public class FlipCard implements Authorization { ...@@ -177,7 +271,7 @@ public class FlipCard implements Authorization {
} }
/*
@Test(description = "已登录查询分享人头像昵称", priority = 11) @Test(description = "已登录查询分享人头像昵称", priority = 11)
public void 已登录查询分享人头像昵称() { public void 已登录查询分享人头像昵称() {
...@@ -186,7 +280,7 @@ public class FlipCard implements Authorization { ...@@ -186,7 +280,7 @@ public class FlipCard implements Authorization {
infoParam.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); infoParam.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
infoParam.put("shareSign",shareSign); infoParam.put("shareSign",shareSign);
infoParam.put("shareType",12); infoParam.put("shareType",12);
infoParam.put("confId",this.redConfId); //infoParam.put("confId",this.redConfId);
visitorAuth22(); visitorAuth22();
Response response = network.getResponse(infoParam, BasicConfig.MOBILE_info); Response response = network.getResponse(infoParam, BasicConfig.MOBILE_info);
Object data = response.jsonPath().getJsonObject("data"); Object data = response.jsonPath().getJsonObject("data");
...@@ -218,7 +312,7 @@ public class FlipCard implements Authorization { ...@@ -218,7 +312,7 @@ public class FlipCard implements Authorization {
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareSign",shareSign); params.put("shareSign",shareSign);
params.put("shareType",12); params.put("shareType",12);
params.put("confId",this.redConfId); //params.put("confId",this.redConfId);
response = network.postResponse(params, BasicConfig.MOBILE_assist); response = network.postResponse(params, BasicConfig.MOBILE_assist);
System.out.println(response.body().asString()); System.out.println(response.body().asString());
...@@ -255,7 +349,7 @@ public class FlipCard implements Authorization { ...@@ -255,7 +349,7 @@ public class FlipCard implements Authorization {
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareSign",shareSign); params.put("shareSign",shareSign);
params.put("shareType",12); params.put("shareType",12);
params.put("confId",this.redConfId); //params.put("confId",this.redConfId);
visitorAuth9(); visitorAuth9();
Response response = network.postResponse(params, BasicConfig.MOBILE_assist); Response response = network.postResponse(params, BasicConfig.MOBILE_assist);
...@@ -293,7 +387,7 @@ public class FlipCard implements Authorization { ...@@ -293,7 +387,7 @@ public class FlipCard implements Authorization {
} }
*/
//预约 //预约
@Test(description = "翻牌集字_预约", priority = 16) @Test(description = "翻牌集字_预约", priority = 16)
...@@ -320,7 +414,7 @@ public class FlipCard implements Authorization { ...@@ -320,7 +414,7 @@ public class FlipCard implements Authorization {
} }
/*
@Test(description = "用户完成任务情况", priority = 17) @Test(description = "用户完成任务情况", priority = 17)
public void 用户完成任务情况() { public void 用户完成任务情况() {
...@@ -486,18 +580,18 @@ public class FlipCard implements Authorization { ...@@ -486,18 +580,18 @@ public class FlipCard implements Authorization {
} }
@Test(description = "放弃开红包", priority = 23) // @Test(description = "放弃开红包", priority = 23)
public void 放弃开红包() { // public void 放弃开红包() {
visitorAuth22(); // visitorAuth22();
ThreadSleepUtils.sleep(1000); // ThreadSleepUtils.sleep(1000);
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.postResponse(params, BasicConfig.MOBILE_abort); // Response response = network.postResponse(params, BasicConfig.MOBILE_abort);
System.out.println(response.body().asString()); // System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data"); // boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_abort, "放弃开红包报异常", response.body().asString())); // Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_abort, "放弃开红包报异常", response.body().asString()));
//
} // }
@Test(description = "开红包", priority = 24) @Test(description = "开红包", priority = 24)
...@@ -510,6 +604,13 @@ public class FlipCard implements Authorization { ...@@ -510,6 +604,13 @@ public class FlipCard implements Authorization {
System.out.println(response.body().asString()); System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data"); boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_redOpen, "开红包失败", response.body().asString())); Assert.assertTrue(data, network.message(params, BasicConfig.MOBILE_redOpen, "开红包失败", response.body().asString()));
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Response response2 = network.postResponse(params, BasicConfig.MOBILE_redOpen);
System.out.println(response2.body().asString());
boolean data2 =response2.jsonPath().getBoolean("data");
Assert.assertTrue(data2, network.message(params, BasicConfig.MOBILE_redOpen, "开红包失败", response2.body().asString()));
} }
@Test(description = "用户开红包状态查询", priority = 25) @Test(description = "用户开红包状态查询", priority = 25)
...@@ -530,13 +631,17 @@ public class FlipCard implements Authorization { ...@@ -530,13 +631,17 @@ public class FlipCard implements Authorization {
Response finishRes = network.getResponse(params, BasicConfig.MOBILE_finishStatus); Response finishRes = network.getResponse(params, BasicConfig.MOBILE_finishStatus);
System.out.println(finishRes.body().asString()); System.out.println(finishRes.body().asString());
int status1 =finishRes.jsonPath().getInt("data.status"); int status1 =finishRes.jsonPath().getInt("data.status");
Assert.assertTrue(status1==4, network.message(params, BasicConfig.MOBILE_finishStatus, "集字状态不对", finishRes.body().asString())); Assert.assertTrue(status1==3, network.message(params, BasicConfig.MOBILE_finishStatus, "集字状态不对", finishRes.body().asString()));
int redStatus2 =response.jsonPath().getInt("data.redStatus");
Assert.assertTrue(redStatus2==4, network.message(params, BasicConfig.MOBILE_finishStatus, "发钱异常", finishRes.body().asString()));
} }
//开启不同等级的红包
@Test(description = "开红包结果", priority = 26) @Test(description = "开红包结果", priority = 26)
public void 开红包结果() { public void 开红包结果() {
//红包等级I
visitorAuth9(); visitorAuth9();
ThreadSleepUtils.sleep(1000); ThreadSleepUtils.sleep(1000);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
...@@ -546,9 +651,30 @@ public class FlipCard implements Authorization { ...@@ -546,9 +651,30 @@ public class FlipCard implements Authorization {
int redStatus =response.jsonPath().getInt("data.redStatus"); int redStatus =response.jsonPath().getInt("data.redStatus");
Assert.assertTrue(redStatus==4, network.message(params, BasicConfig.MOBILE_redOpenState, "红包领取状态不对", response.body().asString())); Assert.assertTrue(redStatus==4, network.message(params, BasicConfig.MOBILE_redOpenState, "红包领取状态不对", response.body().asString()));
int redAmount =response.jsonPath().getInt("data.redAmount"); int redAmount =response.jsonPath().getInt("data.redAmount");
Assert.assertTrue(redAmount==1000, network.message(params, BasicConfig.MOBILE_redOpenState, "红包金额不对", response.body().asString())); Assert.assertTrue(redAmount==30, network.message(params, BasicConfig.MOBILE_redOpenState, "红包金额不对", response.body().asString()));
//红包等级II
visitorAuth22();
ThreadSleepUtils.sleep(1000);
Response response2 = network.getResponse(params, BasicConfig.MOBILE_redOpenState);
System.out.println(response2.body().asString());
int redStatus2 =response2.jsonPath().getInt("data.redStatus");
Assert.assertTrue(redStatus2==4, network.message(params, BasicConfig.MOBILE_redOpenState, "红包领取状态不对", response2.body().asString()));
int redAmount2 =response2.jsonPath().getInt("data.redAmount");
System.out.println(redAmount2);
Assert.assertTrue(redAmount2==40, network.message(params, BasicConfig.MOBILE_redOpenState, "红包金额不对", response2.body().asString()));
} }
*/ @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()));
}
} }
...@@ -252,6 +252,9 @@ public class BasicConfig { ...@@ -252,6 +252,9 @@ public class BasicConfig {
public static final String MANAGER_flipWord = MANAGER_HOST + "/kjy/manager/flip/word/saveOrUpdate"; public static final String MANAGER_flipWord = MANAGER_HOST + "/kjy/manager/flip/word/saveOrUpdate";
public static final String MANAGER_wordSwitchStatus = MANAGER_HOST + "/kjy/manager/flip/word/switchStatus"; public static final String MANAGER_wordSwitchStatus = MANAGER_HOST + "/kjy/manager/flip/word/switchStatus";
public static final String MANAGER_wordDetail = MANAGER_HOST + "/kjy/manager/flip/word/detail"; public static final String MANAGER_wordDetail = MANAGER_HOST + "/kjy/manager/flip/word/detail";
public static final String MANAGER_saveOrUpdateV2 = MANAGER_HOST +"/kjy/manager/flip/word/saveOrUpdate/v2";
public static final String MANAGER_detailV2 = MANAGER_HOST +"/kjy/manager/flip/word/detail/v2";
public static final String MANAGER_wordDelete = MANAGER_HOST +"/kjy/manager/flip/word/delete";
public static final String MOBILE_status = MOBILE_HOST + "/kjy/live/flip/word/status"; public static final String MOBILE_status = MOBILE_HOST + "/kjy/live/flip/word/status";
public static final String MOBILE_wordConf= MOBILE_HOST + "/kjy/live/flip/word/conf"; public static final String MOBILE_wordConf= MOBILE_HOST + "/kjy/live/flip/word/conf";
...@@ -267,6 +270,7 @@ public class BasicConfig { ...@@ -267,6 +270,7 @@ public class BasicConfig {
public static final String MOBILE_record= MOBILE_HOST + "/kjy/live/flip/word/user/record"; 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_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_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 MANAGER_confCaveOrUpdate = MANAGER_HOST + "/kjy/manager/live/trans/video/conf/saveOrUpdate"; 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"; 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