Commit 7bb88c5f authored by 郭姣's avatar 郭姣

Merge branch 'master' into gifaeture/20211105-gj

parents 17b72828 68711478
......@@ -39,6 +39,7 @@ public class HomePage implements Authorization {
public String activityScid; //测评对应的scid
public long articleId; //解密后的的文章id
public int totalCount; //视频数量
public int companyCount; //公司专区数量
@BeforeClass
public void setUp() {
......@@ -331,10 +332,17 @@ public class HomePage implements Authorization {
String infoDesc = response.jsonPath().getString("desc");
Assert.assertEquals(infoDesc,"OK",network.message(params,MANAGER_simpleInfo,"匹配内容失败",response.body().asString()));
//获取生效的公司专区素材id
params.clear();
response = network.getResponse(params,MANAGER_manage);
int index = response.jsonPath().getInt("data.list[2].parentTagList.size()")-1;
int tag = response.jsonPath().getJsonObject("data.list[2].parentTagList.get("+index+").id");
Assert.assertNotNull(tag,network.message(params,MANAGER_simpleInfo,"匹配内容失败",response.body().asString()));
//新增公司专区内容
Map<String,Object> addParams = new HashMap<>();
List list = new ArrayList();
list.add(589);
list.add(tag);
List tagList = new ArrayList();
tagList.add(list);
addParams.put("contentTag","");
......@@ -378,8 +386,8 @@ public class HomePage implements Authorization {
params.put("pageIndex",1);
params.put("source",1);
Response listRes = network.getResponse(params,HOME_companyGetContentList);
int totalCount = listRes.jsonPath().getInt("data.totalCount");
Assert.assertEquals(totalCount,2,network.message(params,HOME_companyGetContentList,"获取公司专区内容列表数据错误",listRes.body().asString()));
companyCount = listRes.jsonPath().getInt("data.totalCount");
Assert.assertTrue(companyCount>0,network.message(params,HOME_companyGetContentList,"获取公司专区内容列表数据错误",listRes.body().asString()));
}
//管理后台删除文章
......@@ -396,6 +404,7 @@ public class HomePage implements Authorization {
Object id = listRes.jsonPath().getJsonObject("data.list.get(0).id");
String desc = listRes.jsonPath().getString("desc");
Assert.assertEquals(desc,"OK",network.message(params,MANAGER_exclusiveItemPage,"获取id失败",listRes.body().asString()));
companyCount = listRes.jsonPath().getInt("data.list.size()");
//删除公司专区内容
Map<String,Object> delParams = new HashMap<>();
......@@ -414,8 +423,8 @@ public class HomePage implements Authorization {
paramsList.put("pageIndex",1);
paramsList.put("source",1);
Response dataRes = network.getResponse(paramsList,HOME_companyGetContentList);
int totalCount = dataRes.jsonPath().getInt("data.totalCount");
Assert.assertEquals(totalCount,1,network.message(paramsList,HOME_companyGetContentList,"获取公司专区内容列表数据错误",dataRes.body().asString()));
int totalCountNew = dataRes.jsonPath().getInt("data.totalCount");
Assert.assertEquals(totalCountNew,companyCount-1,network.message(paramsList,HOME_companyGetContentList,"获取公司专区内容列表数据错误",dataRes.body().asString()));
}
......
......@@ -176,6 +176,7 @@ public class RecommendMaterial implements Authorization {
params.put("insuranceTitle", "2222");
params.put("insuranceType", 1);
params.put("insureAmount", 1000);
params.put("insuranceLink", "https://www.baidu.com");
Response response = network.postResponse(params, GRASS_editInsurance);
boolean success = response.jsonPath().getBoolean("success");
Assert.assertTrue(success, network.message(params, GRASS_editInsurance, "修改赠险信息失败", response.body().asString()));
......@@ -197,6 +198,7 @@ public class RecommendMaterial implements Authorization {
@Test(description = "代理人_赠险管理_删除赠险", priority = 13)
public void 代理人_赠险管理_删除赠险() {
agentTku();
Map<String, Object> params = new HashMap<>();
params.put("id", inId);
Response response = network.getResponse(params, GRASS_delInsurance);
......
......@@ -25,13 +25,6 @@ public class Upload implements Authorization {
BaseUtils.ssoLogin();
}
// @Test(description="会员判断",priority = 1)
// public void 会员判断() throws IOException{
// Response response = network.getResponse(ISVIPSUBSCRIBE);
// boolean isVip = response.jsonPath().getBoolean("data.vip");
// Assert.assertTrue(true, network.message(ISVIPSUBSCRIBE,"会员判断错误",response.body().asString()));
// }
@Test(description = "获取首页上传链接配置",priority = 1)
public void 上传链接配置(){
Map<String,Object> params = new HashMap<>();
......
......@@ -53,7 +53,6 @@ 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("confStatus",2);
Response response = network.postResponse(Params, BasicConfig.MANAGER_wordSwitchStatus);
boolean data = response.jsonPath().getBoolean("data");
......@@ -65,7 +64,6 @@ 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",6451);
Params.put("firstInviteStatus",2);
Params.put("freeNum",3);
Params.put("helpNum",2);
......@@ -84,41 +82,26 @@ 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",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()));
Assert.assertEquals(response.jsonPath().getInt("data.openStatus"), 2, 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 = "翻牌集字配置详情",priority = 7)
public void 翻牌集字配置详情(){
......
......@@ -32,6 +32,7 @@ public class SaveLive implements Authorization {
private Integer taskId;
public List<RedList> redId;
public List<WelfareList> id; //奖品列表id
private int confID; // 默认抽奖券配置ID
@BeforeClass
public void setUp() {
......@@ -65,6 +66,7 @@ public class SaveLive implements Authorization {
Params.put("preWindowUrl","https://yun.dui88.com/kjy/image/20210629/1624949098093.png");
Params.put("distributionType", 0);
Params.put("existSeriesPoster", 0);
Params.put("followPushState", 0); // 关注直播间用户是否推送开关,0 = false
List<ProvinceCityCodeList> provinceCityCode = new ArrayList<>();
ProvinceCityCodeList save = new ProvinceCityCodeList();
save.setProvinceCode(110000);
......@@ -1893,7 +1895,7 @@ public class SaveLive implements Authorization {
}
@Test(description = "获取好运红包配置详情", priority = 106)
@Test(description = "获取好运红包配置详情", priority = 107)
public void 获取好运红包配置详情() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -1903,11 +1905,11 @@ public class SaveLive implements Authorization {
Assert.assertTrue(amount==30, network.message(Params, BasicConfig.MANAGER_redConfDetail, "好运红包配置金额不对", response.body().asString()));
int num=response.jsonPath().getInt("data.num");
Assert.assertTrue(num==1, network.message(Params, BasicConfig.MANAGER_redConfDetail, "好运红包配置总数不对", response.body().asString()));
// 好运红包配置开关状态合并到配置详情接口
Assert.assertEquals(response.jsonPath().getInt("data.confStatus"), 1, network.message(Params, BasicConfig.MANAGER_redConfDetail, "好运红包开关状态错误", response.body().asString()));
}
@Test(description = "开启好运配置开关", priority = 107)
@Test(description = "开启好运配置开关", priority = 106)
public void 开启好运配置开关() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -1919,22 +1921,6 @@ public class SaveLive implements Authorization {
}
@Test(description = "查看直播好运配置状态", priority = 108)
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_getConfDetail);
boolean configFortune = response.jsonPath().getBoolean("data.configFortune");
System.out.println(configFortune);
Assert.assertTrue(configFortune, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未配置好运红包", response.body().asString()));
boolean fortuneConfBuildStatus = response.jsonPath().getBoolean("data.fortuneConfBuildStatus");
System.out.println(fortuneConfBuildStatus);
Assert.assertTrue(fortuneConfBuildStatus, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未开启好运红包配置", response.body().asString()));
}
/**
* 直播预告页弹窗
*/
......@@ -2228,7 +2214,25 @@ public class SaveLive implements Authorization {
/**
* 亲友抽奖券配置
*/
@Test(description = "保存亲友抽奖券配置", priority = 124)
/**
* 亲友抽奖券新增默认配置,即有一个默认配置ID
*/
@Test(description = "获取亲友抽奖劵默认配置ID", priority = 124)
public void 获取默认亲友券配置ID(){
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(Params, BasicConfig.MANAGER_detailLottery);
Assert.assertNotNull(response.jsonPath().getJsonObject("data"), network.message(Params, BasicConfig.MANAGER_detailLottery, "获取亲友券配置失败", response.body().asString()));
try {
confID = response.jsonPath().getInt("data.id");
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(Params, BasicConfig.MANAGER_detailLottery, "获取默认亲友券配置ID失败", response.body().asString()));
}
}
@Test(description = "保存亲友抽奖券配置", priority = 125)
public void 保存亲友抽奖券配置(){
ssoLogin();
Map<String, Object> Params = new HashMap<>();
......@@ -2240,13 +2244,19 @@ public class SaveLive implements Authorization {
Params.put("lotteryName","亲友抽奖券");
Params.put("lotteryNum",3);
Params.put("lotteryDesc","这是亲友抽奖券的说明");
Params.put("id", confID);
Response response = network.postResponse(Params, BasicConfig.MANAGER_relativeLottery);
System.out.println(response.body().asString());
try {
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_relativeLottery, "保存亲友券配置失败", response.body().asString()));
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(Params, BasicConfig.MANAGER_relativeLottery, "获取数据失败", response.body().asString()));
}
}
@Test(description = "查看亲友抽奖券配置详情", priority = 125)
@Test(description = "查看亲友抽奖券配置详情", priority = 127)
public void 查看亲友抽奖券配置详情() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -2257,7 +2267,7 @@ public class SaveLive implements Authorization {
int lotteryNum = response.jsonPath().getInt("data.lotteryNum");
int openStatus = response.jsonPath().getInt("data.openStatus");
Assert.assertEquals(openStatus,0, network.message(Params, BasicConfig.MANAGER_detailLottery, "亲友抽奖券数开启状态错误", response.body().asString()));
Assert.assertEquals(openStatus,1, network.message(Params, BasicConfig.MANAGER_detailLottery, "亲友抽奖券数开启状态错误", response.body().asString()));
Assert.assertEquals(lotteryNum,3, network.message(Params, BasicConfig.MANAGER_detailLottery, "亲友抽奖券数量错误", response.body().asString()));
}
......@@ -2271,18 +2281,4 @@ public class SaveLive implements Authorization {
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_switchStatusLottery, "开启亲友券配置失败", response.body().asString()));
}
@Test(description = "查询亲友抽奖券配置状态", priority = 127)
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_getConfDetail);
System.out.println(response.body().asString());
boolean fissionLotteryConfBuildStatus = response.jsonPath().getBoolean("data.fissionLotteryConfBuildStatus");
Assert.assertTrue(fissionLotteryConfBuildStatus, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未配置亲友抽奖券", response.body().asString()));
boolean fissionLotteryConfStatus = response.jsonPath().getBoolean("data.fissionLotteryConfStatus");
Assert.assertTrue(fissionLotteryConfStatus, network.message(Params, BasicConfig.MANAGER_getConfDetail, "未配置亲友抽奖券", response.body().asString()));
}
}
......@@ -100,7 +100,9 @@ public class Share implements Authorization {
Params.put("shareType",4);
response=network.getResponse(Params, BasicConfig.MANAGER_mpShareList);
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
// 直播宝箱分享包含一个默认配置,所以新创建的配置索引值为1;
// 其他活动分享同理
String mpShareTitle=response.jsonPath().getString("data[1].mpShareTitle");
Assert.assertEquals(mpShareTitle,"宝箱裂变分享文案",network.message(Params, BasicConfig.MANAGER_mpShareList, "宝箱裂变分享配置列表为null", response.body().asString()));
}
......@@ -121,7 +123,7 @@ public class Share implements Authorization {
Params.put("shareType",5);
response=network.getResponse(Params, BasicConfig.MANAGER_mpShareList);
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
String mpShareTitle=response.jsonPath().getString("data[1].mpShareTitle");
Assert.assertEquals(mpShareTitle,"猜数字红包分享文案",network.message(Params, BasicConfig.MANAGER_mpShareList, "猜数字红包配置列表为null", response.body().asString()));
}
......@@ -142,7 +144,7 @@ public class Share implements Authorization {
Params.put("shareType",6);
response=network.getResponse(Params, BasicConfig.MANAGER_mpShareList);
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
String mpShareTitle=response.jsonPath().getString("data[1].mpShareTitle");
Assert.assertEquals(mpShareTitle,"翻牌红包分享文案",network.message(Params, BasicConfig.MANAGER_mpShareList, "翻牌红包配置列表为null", response.body().asString()));
}
......@@ -163,7 +165,7 @@ public class Share implements Authorization {
Params.put("shareType",9);
response=network.getResponse(Params, BasicConfig.MANAGER_mpShareList);
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
String mpShareTitle=response.jsonPath().getString("data[1].mpShareTitle");
Assert.assertEquals(mpShareTitle,"好运红包分享",network.message(Params, BasicConfig.MANAGER_mpShareList, "好运红包配置列表为null", response.body().asString()));
}
......@@ -184,7 +186,7 @@ public class Share implements Authorization {
Params.put("shareType",8);
response=network.getResponse(Params, BasicConfig.MANAGER_mpShareList);
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
String mpShareTitle=response.jsonPath().getString("data[1].mpShareTitle");
Assert.assertEquals(mpShareTitle,"答题闯关分享文案",network.message(Params, BasicConfig.MANAGER_mpShareList, "答题闯关配置列表为null", response.body().asString()));
}
......@@ -205,7 +207,7 @@ public class Share implements Authorization {
Params.put("shareType",10);
response=network.getResponse(Params, BasicConfig.MANAGER_mpShareList);
System.out.println(response.body().asString());
String mpShareTitle=response.jsonPath().getString("data[0].mpShareTitle");
String mpShareTitle=response.jsonPath().getString("data[1].mpShareTitle");
Assert.assertEquals(mpShareTitle,"亲友抽奖券分享文案",network.message(Params, BasicConfig.MANAGER_mpShareList, "答题闯关配置列表为null", response.body().asString()));
}
......
......@@ -64,6 +64,7 @@ public class SimpleLiveConfig implements Authorization {
Params.put("preWindowUrl","https://yun.dui88.com/kjy/image/20210629/1624949098093.png");
Params.put("distributionType", 1);
Params.put("existSeriesPoster", 0);
Params.put("followPushState", 0);
Response response = network.postResponse(Params, BasicConfig.MANAGER_saveAndUpdate_0);
liveID = response.jsonPath().getString("data");
EncodeLiveID = IdMakeUtil.encodingId(Long.valueOf(liveID));
......
......@@ -11,10 +11,9 @@ 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;
import java.lang.reflect.Array;
import java.util.*;
import static com.kjj.config.BasicConfig.*;
import static com.kjj.utils.ThreadSleepUtils.sleep;
......@@ -115,8 +114,13 @@ public class RelativeLottery implements Authorization {
params.put("userType","A");
Response response = network.getResponse(params, BasicConfig.MOBILE_helpInfo);
System.out.println(response.body().asString());
Object mpShareTitle = response.jsonPath().getJsonObject("data.mpShareTitle");
Assert.assertEquals(mpShareTitle,"亲友抽奖券分享文案", network.message(params, BasicConfig.MOBILE_helpInfo, "根据分享类型获取分享内容", response.body().asString()));
String mpShareTitle = response.jsonPath().getString("data.mpShareTitle");
// 抽奖劵分享文案有默认配置和个人配置两种
List<String> mpShareTitles = Arrays.asList("亲友抽奖券分享文案", "我在直播间,帮你抢到一张限量抽奖券!快收下~");
if (mpShareTitles.contains(mpShareTitle)){
return;
}
Assert.fail(network.message(params, MOBILE_helpInfo, "根据分享类型获取到的分享内容错误", response.body().asString()));
}
@Test(description = "访客J_获取小程序分享码", priority = 7)
......
......@@ -120,11 +120,12 @@ public class GoldenEgg implements Authorization {
System.out.println(response.body().asString());
Integer openCondition = response.jsonPath().getInt("data.openCondition");
Assert.assertTrue(openCondition > 0, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "查询砸金蛋配置详情失败", response.body().asString()));
Assert.assertEquals(response.jsonPath().getInt("data.confStatus"), 1, network.message(confDetailParam, BasicConfig.MANAGER_goldenEgg_detail, "砸金蛋配置开启状态错误", response.body().asString()));
treasureConf = JSON.parseObject(JSON.toJSONString(response.jsonPath().get("data")));
}
@Test(description = "开启砸金蛋配置", priority = 6)
@Test(description = "开启砸金蛋配置", priority = 5)
public void 开启砸金蛋配置() {
Map<String, Object> switchStatusParam = new HashMap<>();
switchStatusParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
......@@ -136,19 +137,6 @@ public class GoldenEgg implements Authorization {
}
@Test(description = "查询砸金蛋配置状态", priority = 7)
public void 查询宝箱配置状态() {
Map<String, Object> statusParam = new HashMap<>();
statusParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(statusParam, BasicConfig.MANAGER_getConfDetail);
System.out.println(response.body().asString());
boolean goldenEggTreasureConfStatus =response.jsonPath().getBoolean("data.goldenEggTreasureConfStatus");
boolean goldenEggTreasureConfBuildStatus =response.jsonPath().getBoolean("data.goldenEggTreasureConfBuildStatus");
Assert.assertTrue(goldenEggTreasureConfStatus, network.message(statusParam, BasicConfig.MANAGER_getConfDetail, "砸金蛋未配置", response.body().asString()));
Assert.assertTrue(goldenEggTreasureConfBuildStatus, network.message(statusParam, BasicConfig.MANAGER_getConfDetail, "砸金蛋未开启", response.body().asString()));
}
@Test(description = "查询砸金蛋配置数据", priority = 8)
public void 查询砸金蛋配置数据() {
visitorAuth1();
......
......@@ -1166,6 +1166,7 @@ public class BasicConfig {
public static final String MANAGER_exclusiveItemDel = MANAGER_HOST + "/kjy/manager/exclusiveItem/del";
public static final String MANAGER_searchCompany = MANAGER_HOST + "/kjy/manager/live/company/search";
public static final String MANAGER_liveList = MANAGER_HOST + "/kjy/manager/live/list";
public static final String MANAGER_manage = MANAGER_HOST + "/kjy/manager/tag/manage";
// 企业后台
public static final String MANAGER_corp_saveCorp = MANAGER_HOST + "/kjy/manager/corp/company/saveOrUpdate";
......
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