Commit 3e1e3e8b authored by 张艳玲's avatar 张艳玲

Merge branch 'featrue/20210712-zyl' into 'master'

Featrue/20210712 zyl

See merge request test-group/kejiji!63
parents 32c8ac0c 24fdafb7
package com.kjj.bean.agent;
import lombok.Data;
@Data
public class GrabWelfares {
private Boolean specifyAward;
}
package com.kjj.cases.live.agent;
import com.kjj.bean.agent.GrabWelfares;
import com.kjj.bean.agent.LiveUserList;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
......@@ -29,11 +30,8 @@ public class LiveLater implements Authorization {
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
// params.put("liveId","Kj21MzYyNjM");
Response response = network.getResponse(params,BasicConfig.MOBILE_recycleSuccessCase);
boolean success =response.jsonPath().getBoolean("success");
System.out.println(success);
Assert.assertTrue(success, network.message(params, BasicConfig.MOBILE_recycleSuccessCase, "接口请求失败", response.body().asString()));
System.out.println(response.body().asString());
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_recycleSuccessCase, "未获取到成功案例", response.body().asString()));
}
......@@ -90,7 +88,6 @@ public class LiveLater implements Authorization {
System.out.println(data);
String nickname =response.jsonPath().getString("data.nickname");
Assert.assertEquals(nickname,"张三", network.message(params, BasicConfig.MOBILE_providerInfo, "未获取到发奖人姓名", response.body().asString()));
String phoneNumber =response.jsonPath().getString("data.phoneNumber");
Assert.assertEquals(phoneNumber,"15558005636", network.message(params, BasicConfig.MOBILE_providerInfo, "未获取到发奖人手机号", response.body().asString()));
}
......@@ -228,8 +225,25 @@ public class LiveLater implements Authorization {
Response response = network.getResponse(params,BasicConfig.MOBILE_getClueDetail);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(response.body().asString());
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_getClueDetail, "查看客户A线索详情失败", response.body().asString()));
int visitorInviteNum=response.jsonPath().getInt("data.visitorInviteNum");
Assert.assertTrue(visitorInviteNum==1, network.message(params, BasicConfig.MOBILE_getClueDetail, "访客邀请数不对", response.body().asString()));
String remarkName=response.jsonPath().getString("data.remarkName");
Assert.assertEquals(remarkName,"访客A", network.message(params, BasicConfig.MOBILE_getClueDetail, "访客备注名不正确", response.body().asString()));
int speakNum=response.jsonPath().getInt("data.speakNum");
Assert.assertTrue(speakNum>0, network.message(params, BasicConfig.MOBILE_getClueDetail, "没有评论数", response.body().asString()));
Object questions=response.jsonPath().getJsonObject("data.questions");
Assert.assertNotNull(questions, network.message(params, BasicConfig.MOBILE_getClueDetail, "用户提问列表为null", response.body().asString()));
Object resources=response.jsonPath().getJsonObject("data.resources");
Assert.assertNotNull(resources, network.message(params, BasicConfig.MOBILE_getClueDetail, "用户领取资料列表为null", response.body().asString()));
Object grabWelfares=response.jsonPath().getJsonObject("data.grabWelfares");
Assert.assertNotNull(grabWelfares, network.message(params, BasicConfig.MOBILE_getClueDetail, "用户中奖列表为null", response.body().asString()));
Object choiceQuestions=response.jsonPath().getJsonObject("data.choiceQuestions");
Assert.assertNotNull(choiceQuestions, network.message(params, BasicConfig.MOBILE_getClueDetail, "投票列表为null", response.body().asString()));
Object testResources=response.jsonPath().getJsonObject("data.testResources");
Assert.assertNotNull(testResources, network.message(params, BasicConfig.MOBILE_getClueDetail, "用户提交测试资源报告为null", response.body().asString()));
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()));
}
......@@ -249,7 +263,8 @@ public class LiveLater implements Authorization {
//需要校验返回结果
@Test(description="访客邀请列表",priority = 14)
public void 访客邀请列表() {
public void
访客邀请列表() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
// params.put("liveId","Kj21MzYyNjM");
......@@ -279,7 +294,7 @@ public class LiveLater implements Authorization {
//代理人首页已结束直播,查询待跟进线索数
@Test(description="查询待跟进线索数",priority = 15)
@Test(description="查询待跟进线索数",priority = 16)
public void 查询待跟进线索数() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
......@@ -296,20 +311,4 @@ public class LiveLater implements Authorization {
}
//不确定业务场景
@Test(description="代理人直播线索页分页查询咨询消息",priority = 16)
public void 代理人直播线索页分页查询咨询消息() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
// params.put("liveId","Kj21MzYyNjM");
Response response = network.getResponse(params,BasicConfig.MOBILE_clueTextList);
boolean success=response.jsonPath().getBoolean("success");
Assert.assertTrue(success,network.message(params, BasicConfig.MOBILE_clueTextList, "接口调用失败", response.body().asString()));
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
// Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_clueTextList, "咨询消息为null", response.body().asString()));
}
}
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