Commit 5b175a1f authored by xiamengchen's avatar xiamengchen

补充线索类型

parent 94d55ce6
...@@ -8,6 +8,8 @@ import io.restassured.response.Response; ...@@ -8,6 +8,8 @@ import io.restassured.response.Response;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.w3c.dom.events.UIEvent;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
...@@ -25,6 +27,8 @@ public class ForwardAndRead implements Authorization { ...@@ -25,6 +27,8 @@ public class ForwardAndRead implements Authorization {
private long forwardTime; private long forwardTime;
private String questionId; private String questionId;
public static Map<String, Integer> custClueStatistics; public static Map<String, Integer> custClueStatistics;
private String riskTestContentId; //评测contentId
private String riskTestScId; // 评测scid
@BeforeClass @BeforeClass
public void setUp() throws IOException{ public void setUp() throws IOException{
...@@ -39,9 +43,7 @@ public class ForwardAndRead implements Authorization { ...@@ -39,9 +43,7 @@ public class ForwardAndRead implements Authorization {
param = new HashMap<>(); param = new HashMap<>();
custClueStatistics = new HashMap<>(); custClueStatistics = new HashMap<>();
param.put("userId", userId); param.put("userId", userId);
System.out.println(param);
response = network.getResponse(param, BasicConfig.CLUESTATISTICS); response = network.getResponse(param, BasicConfig.CLUESTATISTICS);
System.out.println(response.body().asString());
int drawMaterial = response.jsonPath().getInt("data.drawMaterial"); int drawMaterial = response.jsonPath().getInt("data.drawMaterial");
int drawPresentInsuranceCount = response.jsonPath().getInt("data.drawPresentInsuranceCount"); int drawPresentInsuranceCount = response.jsonPath().getInt("data.drawPresentInsuranceCount");
int faqCount = response.jsonPath().getInt("data.faqCount"); int faqCount = response.jsonPath().getInt("data.faqCount");
...@@ -140,37 +142,37 @@ public class ForwardAndRead implements Authorization { ...@@ -140,37 +142,37 @@ public class ForwardAndRead implements Authorization {
} }
// 获取新用户 // 获取新用户
@Test(description = "新用户访问", priority = 7) // @Test(description = "新用户访问", priority = 7)
public void 新用户访问() throws IOException{ // public void 新用户访问() throws IOException{
ThreadSleepUtils.sleep(5000); // ThreadSleepUtils.sleep(5000);
network.agentCookies.put("tku", BaseUtils.tku); // network.agentCookies.put("tku", BaseUtils.tku);
response = network.getResponse(BasicConfig.USER_INFO); // response = network.getResponse(BasicConfig.USER_INFO);
System.out.println(response.body().asString()); // System.out.println(response.body().asString());
param.clear(); // param.clear();
param.put("scid", articleScId); // param.put("scid", articleScId);
param.put("fromUserId", sellerId); // param.put("fromUserId", sellerId);
param.put("cancelPush", false); // param.put("cancelPush", false);
param.put("visitPath", 0); // param.put("visitPath", 0);
response = network.getResponse(param, BasicConfig.CONTENT_READ); // response = network.getResponse(param, BasicConfig.CONTENT_READ);
System.out.println(response.body().asString()); // System.out.println(response.body().asString());
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CONTENT_READ, "接口调用失败", response.body().asString())); // Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CONTENT_READ, "接口调用失败", response.body().asString()));
} // }
//
// 新用户领取赠险 // // 新用户领取赠险
@Test(description = "新用户领取赠险", priority = 8) // @Test(description = "新用户领取赠险", priority = 8)
public void 新用户领取赠险() throws IOException{ // public void 新用户领取赠险() throws IOException{
param.clear(); // param.clear();
param.put("clueTypeName", "WELFARE_INSURANCE"); // param.put("clueTypeName", "WELFARE_INSURANCE");
param.put("insuranceId", insuranceId); // param.put("insuranceId", insuranceId);
param.put("locationSource", 1); // param.put("locationSource", 1);
param.put("scId", articleScId); // param.put("scId", articleScId);
param.put("sourceId", articleScId); // param.put("sourceId", articleScId);
param.put("sourceType", 1); // param.put("sourceType", 1);
response = network.postResponse(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN); // response = network.postResponse(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN);
System.out.println(response.body().asString()); // System.out.println(response.body().asString());
String data = response.jsonPath().getString("data"); // String data = response.jsonPath().getString("data");
Assert.assertEquals(data, "success", network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "领取赠险失败", response.body().asString())); // Assert.assertEquals(data, "success", network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "领取赠险失败", response.body().asString()));
} // }
@Test(description = "二度访客阅读文章", priority = 9) @Test(description = "二度访客阅读文章", priority = 9)
public void 二度访客阅读文章() throws IOException{ public void 二度访客阅读文章() throws IOException{
...@@ -240,6 +242,41 @@ public class ForwardAndRead implements Authorization { ...@@ -240,6 +242,41 @@ public class ForwardAndRead implements Authorization {
ThreadSleepUtils.sleep(10000); ThreadSleepUtils.sleep(10000);
} }
@Test(description = "获取文章测评", priority = 14)
public void 获取文章测评() throws IOException{
// 获取测评contentId
param.clear();
param.put("scid", articleScId);
response = network.getResponse(param, BasicConfig.SELLERCARD_RECOMMENDLISTV3);
Map<String, Object> clueActivityDisplayVo = response.jsonPath().getMap("data.clueActivityDisplayVo");
riskTestContentId = (String) clueActivityDisplayVo.get("contentId");
// 获取测评scid
String sid = encodeId(sellerId);
param.clear();
param.put("contentId", riskTestContentId);
param.put("sid", sid);
System.out.println(param);
response = network.getResponse(param, BasicConfig.GETSCID);
riskTestScId = response.jsonPath().getString("data");
Assert.assertNotNull(riskTestScId, network.message(param, BasicConfig.GETSCID, "获取测评scid失败", response.body().asString()));
}
@Test(description = "领取测评报告", priority = 15)
public void 领取测评报告() throws IOException{
param.clear();
param.put("completed", 1);
param.put("originScId", articleScId);
param.put("riskTestOperateType", 2);
param.put("scid", riskTestScId);
param.put("sourceId", articleScId);
param.put("sourceType", 1);
param.put("visitExtra", "{\"性别\":\"男\",\"年龄\":\"85后\",\"家庭成员构成\":\"2个子女\",\"不良生活习惯\":\"运动少\",\"出行习惯\":\"骑行\",\"月收入\":\"5000-10000\",\"负债水平\":\"无\"}");
response = network.postResponse(param, BasicConfig.RISKTEST_SENDINFO);
boolean data = response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(param, BasicConfig.RISKTEST_SENDINFO, "点击领取测评报告失败", response.body().asString()));
}
// 通过素材contentId获取线索员文章scId // 通过素材contentId获取线索员文章scId
public String getContentScId(String contentId){ public String getContentScId(String contentId){
param = new HashMap<>(); param = new HashMap<>();
......
...@@ -73,9 +73,9 @@ public class BasicConfig { ...@@ -73,9 +73,9 @@ public class BasicConfig {
// 基础线访客 TKU---"请勿打扰" // 基础线访客 TKU---"请勿打扰"
public static String VISITOR_TKU = "T3gM31f18jCGvqvoyJRzyMTdpcPDJWUJJP4VQje7p9sfC4HKmj5NJfCUkxusAyFb5SpkWS31srDTYr6KtV"; public static String VISITOR_TKU = "T3gM31f18jCGvqvoyJRzyMTdpcPDJWUJJP4VQje7p9sfC4HKmj5NJfCUkxusAyFb5SpkWS31srDTYr6KtV";
// 基础线访客(小雪人) TKU // 基础线访客(小雪人) TKU
public static String VISITOR1_TKU = "T3gM31f18jCFXzk692pKjJCqJZdDv8Nb3htkzNk983cPMspUQD6pVEn2FNMefM2nieKPicXG9c1tDg8qtN"; public static String VISITOR1_TKU = "T3gM31f18jCFXzk692pKjJCqJZdDv8Nb3htkzNk983cPPrfjggTn4Gv1ytpR3XAQusWRz7uTsHaibp6Es8";
// 基础线访客 // 基础线访客
public static String VISITOR2_TKU = "T3gM31f18jCeKCBVHf5MANgyXeBZGCm8vTJQTuWYXHFqx97PATsWyUYamGaNdNip8bEs9shoE9tTsAmp8x"; // 二度访客用 public static String VISITOR2_TKU = "T3gM31f18jCeKCBVHf5MANgyXeBZGCm8vTJQTuWYXHFr27f8asoYpZASD6JzN5VJsBpQ8NxvzrJFGz2Ame"; // 二度访客用
// 访客的sids // 访客的sids
public static final String sids = "Kj21MjMwNTU"; public static final String sids = "Kj21MjMwNTU";
// 访客(SuYi) userID:4425 // 访客(SuYi) userID:4425
...@@ -87,6 +87,7 @@ public class BasicConfig { ...@@ -87,6 +87,7 @@ public class BasicConfig {
// *************** 客集集域名 *************** // *************** 客集集域名 ***************
public static final String HOST = "https://kjj.m.duibatest.com.cn"; public static final String HOST = "https://kjj.m.duibatest.com.cn";
public static final String ACTIVITY_HOST = "https://kjj-activity.duibatest.com.cn"; public static final String ACTIVITY_HOST = "https://kjj-activity.duibatest.com.cn";
public static final String ACTIVITY1_HOST = "https://kjj-activity-1.duibatest.com.cn";
public static final String SSO_HOST = "https://sso.duibatest.com.cn"; public static final String SSO_HOST = "https://sso.duibatest.com.cn";
public static final String MANAGER_HOST = "https://kjj-mng.duibatest.com.cn"; public static final String MANAGER_HOST = "https://kjj-mng.duibatest.com.cn";
public static final String MOBILE_HOST = "https://live.duibatest.com.cn"; public static final String MOBILE_HOST = "https://live.duibatest.com.cn";
...@@ -801,6 +802,8 @@ public class BasicConfig { ...@@ -801,6 +802,8 @@ public class BasicConfig {
public static final String ARTICLE_ENHANCEDCOLUMN_GETFAQS = HOST + "/kjy/mp/enhancedColumn/getFAQs"; public static final String ARTICLE_ENHANCEDCOLUMN_GETFAQS = HOST + "/kjy/mp/enhancedColumn/getFAQs";
public static final String ARTICLE_getQuestionDetail = HOST +"/kjy/mp/explosioncontent/qa/getQuestionDetail"; public static final String ARTICLE_getQuestionDetail = HOST +"/kjy/mp/explosioncontent/qa/getQuestionDetail";
public static final String ARTICLE_GETEXPLOSIONCONTENTLIST = HOST + "/kjy/mp/explosioncontent/getExplosionContentList"; public static final String ARTICLE_GETEXPLOSIONCONTENTLIST = HOST + "/kjy/mp/explosioncontent/getExplosionContentList";
// 风险评测
public static final String RISKTEST_SENDINFO = ACTIVITY1_HOST + "/kjy/mp/activity/sendInfoForRisk";
// ************** 发圈素材 *************** // ************** 发圈素材 ***************
public static final String FRIENDS_GETMATERIALTAGS = HOST + "/kjy/mp/materialContent/getmaterialTags"; public static final String FRIENDS_GETMATERIALTAGS = HOST + "/kjy/mp/materialContent/getmaterialTags";
......
...@@ -52,21 +52,21 @@ ...@@ -52,21 +52,21 @@
<class name="com.kjj.cases.assistant.whoSawMe.ForwardAndRead"/> <class name="com.kjj.cases.assistant.whoSawMe.ForwardAndRead"/>
</classes> </classes>
</test> </test>
<test preserve-order="true" name = "谁看过我"> <!-- <test preserve-order="true" name = "谁看过我">-->
<classes> <!-- <classes>-->
<class name="com.kjj.cases.assistant.whoSawMe.WhoSawMe"/> <!-- <class name="com.kjj.cases.assistant.whoSawMe.WhoSawMe"/>-->
</classes> <!-- </classes>-->
</test> <!-- </test>-->
<test preserve-order="true" name = "我的转发"> <!-- <test preserve-order="true" name = "我的转发">-->
<classes> <!-- <classes>-->
<class name="com.kjj.cases.assistant.whoSawMe.MyForward"/> <!-- <class name="com.kjj.cases.assistant.whoSawMe.MyForward"/>-->
</classes> <!-- </classes>-->
</test> <!-- </test>-->
<test preserve-order="true" name = "我的客户"> <!-- <test preserve-order="true" name = "我的客户">-->
<classes> <!-- <classes>-->
<class name="com.kjj.cases.assistant.whoSawMe.MyCustomer"/> <!-- <class name="com.kjj.cases.assistant.whoSawMe.MyCustomer"/>-->
</classes> <!-- </classes>-->
</test> <!-- </test>-->
<!-- <test preserve-order="true" name = "贺卡">--> <!-- <test preserve-order="true" name = "贺卡">-->
<!-- <classes>--> <!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.markettools.GreetingCrad"/>--> <!-- <class name="com.kjj.cases.assistant.markettools.GreetingCrad"/>-->
......
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