Commit ad5f13e8 authored by xiamengchen's avatar xiamengchen

fix:接口助手文章赠险下线

parent 6dfd7302
......@@ -22,7 +22,6 @@ public class ForwardAndRead implements Authorization {
private String articleScId;
private Long sellerId;
private String jjvisitId;
private String insuranceId;
private long forwardTime;
private String questionId;
public static Map<String, Integer> custClueStatistics;
......@@ -42,11 +41,9 @@ public class ForwardAndRead implements Authorization {
param.put("userId", userId);
response = network.getResponse(param, BasicConfig.CLUESTATISTICS);
int drawMaterial = response.jsonPath().getInt("data.drawMaterial");
int drawPresentInsuranceCount = response.jsonPath().getInt("data.drawPresentInsuranceCount");
int grassCount = response.jsonPath().getInt("data.grassCount");
int visitCount = response.jsonPath().getInt("data.visitCount");
custClueStatistics.put("drawMaterial", drawMaterial);
custClueStatistics.put("drawPresentInsuranceCount", drawPresentInsuranceCount);
custClueStatistics.put("grassCount", grassCount);
custClueStatistics.put("visitCount", visitCount);
}
......@@ -99,28 +96,6 @@ public class ForwardAndRead implements Authorization {
Assert.assertNotNull(jjvisitId, network.message(param, BasicConfig.CONTENT_READ, "visitId为空", response.body().asString()));
}
@Test(description = "访客领取赠险", priority = 5)
public void 领取赠险() throws IOException{
// 获取赠险insuranceId
param = new HashMap<>();
param.put("scid", articleScId);
response = network.getResponse(param, BasicConfig.SELLERCARD_RECOMMENDLISTV3);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.SELLERCARD_RECOMMENDLISTV3, "接口调用失败", response.body().asString()));
insuranceId = response.jsonPath().getString("data.insuranceVos[0].id");
// 领取赠险
param = new HashMap<>();
param.put("clueTypeName", "WELFARE_INSURANCE");
param.put("insuranceId", insuranceId);
param.put("locationSource", 1);
param.put("scId", articleScId);
param.put("sourceId", articleScId);
param.put("sourceType", 1);
response = network.postResponse(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "接口调用失败", response.body().asString()));
String data = response.jsonPath().getString("data");
Assert.assertEquals(data, "success", network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "领取赠险失败", response.body().asString()));
}
@Test(description = "访客转发文章", priority = 6)
public void 访客转发文章() throws IOException{
......@@ -151,22 +126,6 @@ public class ForwardAndRead implements Authorization {
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CONTENT_READ, "接口调用失败", response.body().asString()));
}
// 新用户领取赠险
@Test(description = "新用户领取赠险", priority = 8)
public void 新用户领取赠险() throws IOException{
param.clear();
param.put("clueTypeName", "WELFARE_INSURANCE");
param.put("insuranceId", insuranceId);
param.put("locationSource", 1);
param.put("scId", articleScId);
param.put("sourceId", articleScId);
param.put("sourceType", 1);
response = network.postResponse(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN);
System.out.println(response.body().asString());
String data = response.jsonPath().getString("data");
Assert.assertEquals(data, "success", network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "领取赠险失败", response.body().asString()));
}
@Test(description = "二度访客阅读文章", priority = 9)
public void 二度访客阅读文章() throws IOException{
ThreadSleepUtils.sleep(5000);
......@@ -190,21 +149,6 @@ public class ForwardAndRead implements Authorization {
Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.DYNAMIC_ADDVISIT, "添加访问记录失败", response.body().asString()));
}
@Test(description = "二度访客领取赠险", priority = 11)
public void 二度访客领取赠险() throws IOException{
param = new HashMap<>();
param.put("clueTypeName", "WELFARE_INSURANCE");
param.put("insuranceId", insuranceId);
param.put("locationSource", 1);
param.put("scId", articleScId);
param.put("sourceId", articleScId);
param.put("sourceType", 1);
response = network.postResponse(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "接口调用失败", response.body().asString()));
String data = response.jsonPath().getString("data");
Assert.assertEquals(data, "success", network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "领取赠险失败", response.body().asString()));
}
@Test(description = "获取文章FAQs", priority = 12)
public void 获取文章FAQs() throws IOException{
param.clear();
......
......@@ -355,11 +355,9 @@ public class MyCustomer implements Authorization {
response = network.getResponse(param, BasicConfig.CLUESTATISTICS);
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CLUESTATISTICS, "接口请求失败", response.body().asString()));
ClueStatistics clueStatistics = JsonUtil.parseResponseToBean(response, ClueStatistics.class);
int drawPresentInsuranceCount = clueStatistics.getDrawPresentInsuranceCount();
int grassCount = clueStatistics.getGrassCount();
int visitCount = clueStatistics.getVisitCount();
int drawMaterial = clueStatistics.getDrawMaterial();
Assert.assertEquals(drawPresentInsuranceCount, ForwardAndRead.custClueStatistics.get("drawPresentInsuranceCount") + 1, network.message(param, BasicConfig.CLUESTATISTICS, "访客领取赠险记录次数未正确增加", response.body().asString()));
Assert.assertEquals(grassCount, ForwardAndRead.custClueStatistics.get("grassCount") + 1, network.message(param, BasicConfig.CLUESTATISTICS, "访客阅读种草文章记录次数未正确增加", response.body().asString()));
Assert.assertEquals(visitCount, ForwardAndRead.custClueStatistics.get("visitCount") + 1, network.message(param, BasicConfig.CLUESTATISTICS, "访客来访记录次数未正确增加", response.body().asString()));
Assert.assertEquals(drawMaterial, ForwardAndRead.custClueStatistics.get("drawMaterial") + 1, network.message(param, BasicConfig.CLUESTATISTICS, "访客领取资料次数未正确增加", response.body().asString()));
......@@ -405,7 +403,7 @@ public class MyCustomer implements Authorization {
String contentId = recordsOfContent.getContentId();
int clueType = recordsOfClue.getClueType();
Assert.assertEquals(contentId, BasicConfig.ARTICLE_CONTENTID, network.message(param ,BasicConfig.CUSTVISITLIST, "访问记录详情有误", response.body().asString()));
Assert.assertEquals(clueType, 31, network.message(param, BasicConfig.CUSTVISITLIST, "访问记录详情有误", response.body().asString()));
Assert.assertEquals(clueType, 29, network.message(param, BasicConfig.CUSTVISITLIST, "访问记录详情有误", response.body().asString()));
}
// 客户线索跟进
......
......@@ -842,7 +842,7 @@ public class WhoSawMe implements Authorization {
int visitClueType = response.jsonPath().getInt("data.visitClueType");
Long custUserId = response.jsonPath().getLong("data.custUserId");
String contentScid = response.jsonPath().getString("data.fromContent.scid");
Assert.assertEquals(visitClueType, 31, network.message(param, BasicConfig.CLUEINFO, "线索类型错误", response.body().asString()));
Assert.assertEquals(visitClueType, 29, network.message(param, BasicConfig.CLUEINFO, "线索类型错误", response.body().asString()));
Assert.assertEquals(custUserId, ForwardAndRead.decodeTku(VISITOR1_TKU).get("userId"), network.message(param, BasicConfig.CLUEINFO, "线索来源访客userId错误", response.body().asString()));
Assert.assertEquals(contentScid, ForwardAndRead.getContentScId(BasicConfig.ARTICLE_CONTENTID), network.message(param, BasicConfig.CLUEINFO, "线索来源素材id错误", 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