Commit e67c0126 authored by xiamengchen's avatar xiamengchen

直播中测试完善

parent a8b48fde
......@@ -12,6 +12,7 @@ public class ResourceForm {
private List<FieldList> fieldList;
private String received;
private String evaluationId;
private boolean hasSubmitEvaluation;
@Data
public static class FieldList
......
......@@ -24,4 +24,5 @@ public class ResourceFree {
private String outLinkAppId;
private String formBanner;
private String evaluationId;
private boolean hasSubmitEvaluation;
}
......@@ -238,6 +238,11 @@ public class LiveLater implements Authorization {
List<GrabWelfares>list=JsonUtil.parseResponseToListBean(response,GrabWelfares.class,"grabWelfares");
Boolean specifyAward =list.get(0).getSpecifyAward();
Assert.assertTrue(specifyAward,network.message(params, BasicConfig.MOBILE_getClueDetail, "指定中奖为null", response.body().asString()));
List<Map<String, Object>> evaLists = response.jsonPath().getList("evaluationResources");
System.out.println("evaLists: "+evaLists);
Assert.assertEquals(evaLists.size(), 1, network.message(params, BasicConfig.MOBILE_getClueDetail, "用户参与测试数量错误", response.body().asString()));
String evaTitle = (String) evaLists.get(0).get("resourceTitle");
Assert.assertEquals(evaTitle, "编辑后修改标题", network.message(params, BasicConfig.MOBILE_getClueDetail, "用户参与测试标题错误", response.body().asString()));
}
......
......@@ -73,6 +73,16 @@ public class PersonalPage implements Authorization {
Assert.assertEquals(sourceRecordId, LiveVisitors.resourceReceiveRecordId, network.message(params, BasicConfig.USER_resourceList, "资料领取记录id不正确", response.body().asString()));
String liveId = resourceList.getLiveId();
Assert.assertEquals(liveId, LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()), network.message(params, BasicConfig.USER_resourceList, "资料领取直播id不正确", response.body().asString()));
try {
for (ResourceList resourceList1 : resourceLists){
if (resourceList1.getLiveId().equals(LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()))){
Assert.assertNotEquals(resourceList1.getRecordId(), LiveVisitors.freeForEvaReceiveRecordId, network.message(params, BasicConfig.USER_resourceList, "关联测试的资料未被过滤", response.body().asString()));
}else {break;}
}
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(params, BasicConfig.USER_resourceList, "获取数据失败", response.body().asString()));
}
companyName = resourceList.getCompanyName(); // 获取领取资料的公司名称
}
......
......@@ -82,23 +82,23 @@ public class EvaluationConf implements Authorization {
System.out.println(response.body().asString());
}
@Test(description = "删除权益", priority = 2)
public void 删除权益() {
for (int resourceId : Arrays.asList(LiveMaterial.resourceId, LiveMaterial.termResourceId, LiveMaterial.freeResourceId, LiveMaterial.picResourceId)){
System.out.println(resourceId);
Map<String, Object> delResourceParam = new HashMap<>();
delResourceParam.put("id", resourceId);
Response delResourceRes = network.postResponse(delResourceParam, BasicConfig.MANAGER_delResource);
try {
boolean data = delResourceRes.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(delResourceParam, BasicConfig.MANAGER_delResource, "删除权益失败", delResourceRes.body().asString()));
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(delResourceParam, BasicConfig.MANAGER_delResource, "获取数据失败", delResourceRes.body().asString()));
}
}
}
// @Test(description = "删除权益", priority = 2)
// public void 删除权益() {
// for (int resourceId : Arrays.asList(LiveMaterial.resourceId, LiveMaterial.termResourceId, LiveMaterial.freeResourceId, LiveMaterial.picResourceId)){
// System.out.println(resourceId);
// Map<String, Object> delResourceParam = new HashMap<>();
// delResourceParam.put("id", resourceId);
// Response delResourceRes = network.postResponse(delResourceParam, BasicConfig.MANAGER_delResource);
// try {
// boolean data = delResourceRes.jsonPath().getBoolean("data");
// System.out.println(data);
// Assert.assertTrue(data, network.message(delResourceParam, BasicConfig.MANAGER_delResource, "删除权益失败", delResourceRes.body().asString()));
// }catch (NullPointerException e){
// e.printStackTrace();
// Assert.fail(network.message(delResourceParam, BasicConfig.MANAGER_delResource, "获取数据失败", delResourceRes.body().asString()));
// }
// }
// }
......
......@@ -68,7 +68,7 @@ public class Lottery implements Authorization {
Assert.assertTrue(success, network.message(connectSuccessParam, BasicConfig.USER_connectSuccess, "访客到场请求失败", response.body().asString()));
}
/*
@Test(description = "访客A抽奖查询抽奖活动弹层", priority = 5)
public void 访客A抽奖查询抽奖活动弹层() {
visitorAuth();
......@@ -1473,7 +1473,7 @@ public class Lottery implements Authorization {
throw e;
}
}
*/
}
......
......@@ -54,7 +54,6 @@ public class LotteryCode implements Authorization {
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
/*
@Test(description = "访客A获取直播所有的订阅消息模板", priority = 4)
public void 访客A获取直播所有的订阅消息模板() {
visitorAuth();
......@@ -243,7 +242,7 @@ public class LotteryCode implements Authorization {
System.out.println(type);
Assert.assertTrue(type==3, network.message(tokenParam, BasicConfig.MOBILE_Token, "未获取到绑定结果", tokenRes.body().asString()));
}
*/
}
This diff is collapsed.
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