Commit 83312f4a authored by Su-Yi's avatar Su-Yi

新增首页case

parent d93f4990
......@@ -4,6 +4,7 @@ import static com.kjj.qa.config.BasicConfig.*;
import com.kjj.qa.utils.NetworkUtil;
import io.restassured.response.Response;
import org.codehaus.groovy.antlr.UnicodeEscapingReader;
import org.testng.Assert;
import org.testng.annotations.*;
import org.testng.annotations.Test;
......@@ -144,8 +145,88 @@ public class Article {
infoParams.put("contentId",ARTICLE_CONTENTID);
response = network.getResponse(infoParams,ARTICLE_GETEXPINFO);
String tags = response.jsonPath().getString("data.tags");
Assert.assertEquals(tags,"放到沙发上",network.message(infoParams,ARTICLE_GETEXPINFO,"文章内标签-获取失败"));
String recommendReason = response.jsonPath().getString("data.recommendReason");
Assert.assertEquals(tags,"发送到发",network.message(infoParams,ARTICLE_GETEXPINFO,"获取文章标签有误"));
Assert.assertEquals(recommendReason,"发发",network.message(infoParams,ARTICLE_GETEXPINFO,"获取文章推荐理由有误"));
}
// 获取互动区-专业解读
@Test(description="互动区-专业解读",priority = 6)
public void 互动区_专业解读() throws IOException
{
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
params.put("pageIndex",1);
params.put("pageSize",10);
Response response = network.getResponse(params,ARTICLE_ENHANCEDCOLUMN_GETCONTENTS);
int count = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(count,10,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETCONTENTS,"获取专业解读列表有误"));
}
// 获取互动区-互动问答
@Test(description="互动区-互动问答",priority = 7)
public void 互动区_互动问答() throws IOException
{
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
params.put("pageIndex",1);
params.put("pageSize",3);
Response response = network.getResponse(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS);
int count = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(count,3,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"获取个人专栏列表有误"));
String answer = response.jsonPath().getString("data.list[0].answer");
Assert.assertNotNull(answer,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"获取问答内容有误"));
}
// 获取互动区-风险评测
@Test(description="互动区-风险评测",priority = 8)
public void 互动区_风险评测() throws IOException
{
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params,ARTICLE_ISDISPLAYACTIVITY);
boolean isDisplay = response.jsonPath().getBoolean("data.isDisplay");
String riskScid = response.jsonPath().getString("data.scid");
Assert.assertTrue(isDisplay,network.message(params,ARTICLE_ISDISPLAYACTIVITY,"互动区-风险评测显示有误"));
Assert.assertEquals(riskScid,RISK_CONTENTID, network.message(params,ARTICLE_ISDISPLAYACTIVITY,"互动区-风险评测内容有误"));
}
// 获取代理人个人专栏
@Test(description="代理人个人专栏",priority = 9)
public void 代理人个人专栏() throws IOException {
// 先获取代理人个人专栏设置
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
Response response = network.getResponse(params,ARTICLE_GETENHANCEDCOLUMNCONFIG);
boolean isOpen = response.jsonPath().getBoolean("data.find {it.code == 'personal_document_switch'}.val");
Assert.assertTrue(isOpen,network.message(params,ARTICLE_GETENHANCEDCOLUMNCONFIG,"获取代理人日常精准素材个人专栏开关有误"));
//关闭 代理人个人专栏开关
Map<String, Object> configParams = new HashMap<String, Object>();
configParams.put("configKey","personal_document_switch");
configParams.put("configValue",false);
response = network.postResponse(configParams,SELLERCONFIG_EDITCONFIG);
//再获取代理人个人专栏
response = network.getResponse(params,ARTICLE_GETENHANCEDCOLUMNCONFIG);
isOpen = response.jsonPath().getBoolean("data.find {it.code == 'personal_document_switch'}.val");
Assert.assertFalse(isOpen,network.message(params,ARTICLE_GETENHANCEDCOLUMNCONFIG,"获取代理人日常精准素材个人专栏开关有误"));
//再次开启 代理人个人专栏开关
configParams.put("configKey","personal_document_switch");
configParams.put("configValue",true);
response = network.postResponse(configParams,SELLERCONFIG_EDITCONFIG);
}
// 获取代理人个人专栏
@Test(description="获取代理人私信",priority = 10)
public void 获取代理人私信() throws IOException {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
params.put("t",System.currentTimeMillis());
Response response = network.getResponse(params, CHECKUNREAD);
String desc = response.jsonPath().getString("desc");
Assert.assertEquals(desc,"OK",network.message(params, CHECKUNREAD, "获取私信有误"));
}
//
}
......@@ -13,17 +13,16 @@ public class BasicConfig {
public static final String VISITOR_TKU = "T3gM31f18jAWudwfTW6o9zs27w5xMjdhLHsKVP3cHo9Aj7Q4Fg7WyEkqXiKWWdLHka1jjGseU7JpgC2UaU";
// *************** 钉钉机器人 ***************
// 线上-告警群
// public static final String DINGTALKPATH = "https://oapi.dingtalk.com/robot/send?access_token=f63c9cb36e89dd68e9af82d926933b3afc6544e57b23a3a55ed5b3b772d5e8d2";
// 测试
public static final String DINGTALKPATH = "https://oapi.dingtalk.com/robot/send?access_token=e4b7d997fb9f90b17672dcdb9c9922d52c59f741b82081a368f4d3c305c1afcd";;
public static final String DINGTALKPATH = "https://oapi.dingtalk.com/robot/send?access_token=e4b7d997fb9f90b17672dcdb9c9922d52c59f741b82081a368f4d3c305c1afcd";
;
// *************** 素材ID ***************
public static final String ARTICLE_CONTENTID = "Kj21NjQ5NDM";
public static final String ARTICLE_CONTENTID = "Kj21NjM4NDc";
public static final String ANIMATION_CONTENTID = "Kj21MzgzMTk";
......@@ -31,7 +30,8 @@ public class BasicConfig {
public static final String UPLOAD_CONTENTID = "Kj21NjA1NTE";
//风险评测
public static final String RISK_CONTENTID = "Kj20MTM0MDA3";
// *************** 公共 ***************
public static final String VERSION_INFO = "/kjy/mp/version/info";
......@@ -46,13 +46,14 @@ public class BasicConfig {
public static final String HASALREADYLIKE = "/kjy/mp/interaction/hasAlreadyLike";
public static final String CHECKUNREAD = "/kjy/mp/chat/checkUnread";
// *************** 支付 ***************
public static final String PAY_GETMIDDLEDETAIL = "/kjy/mp/payMiddle/getMiddleDetail";
public static final String PAY_GETMIDDLEDETAIL = "/kjy/mp/payMiddle/getMiddleDetail";
public static final String PAY_HASSITESALEVALID = "/kjy/mp/seller/dist/hasSiteSaleValid";
public static final String PAY_HASSITESALEVALID = "/kjy/mp/seller/dist/hasSiteSaleValid";
public static final String PAY_GETPROMOCODE = "/kjy/order/getPromoCode";
public static final String PAY_GETPROMOCODE = "/kjy/order/getPromoCode";
public static final String PAY_COMBOLIST = "/kjy/mp/combo/list/v2?code=";
......@@ -65,9 +66,8 @@ public class BasicConfig {
public static final String PAY_DISTRIBUTE = "/kjy/sp/visitorPayment/distribute";
// *************** 名片 ***************
public static final String SELLERCARD_TOPOFDETAIL = "/kjy/mp/sellerCardV5/topOfDetail";
public static final String SELLERCARD_TOPOFDETAIL = "/kjy/mp/sellerCardV5/topOfDetail";
public static final String SELLERCARD_EDITBASEINFO = "/kjy/mp/sellerCard/editBaseInfo";
......@@ -91,9 +91,9 @@ public class BasicConfig {
public static final String SELLERCARD_GETSELLERCARDSTYLE = "/kjy/mp/sellerConfig/getSellerCardStyle";
public static final String SELLERCARD_TOPOFCONTENT = "/kjy/mp/sellerCardV5/topOfContent";
public static final String SELLERCARD_TOPOFCONTENT = "/kjy/mp/sellerCardV5/topOfContent";
public static final String SELLERCARD_BOTTOMOFCONTENT = "/kjy/mp/sellerCardV5/bottomOfContent";
public static final String SELLERCARD_BOTTOMOFCONTENT = "/kjy/mp/sellerCardV5/bottomOfContent";
// *************** 上传 ***************
......@@ -118,27 +118,34 @@ public class BasicConfig {
public static final String UPLOAD_UNBIND = "/kjy/mp/seller/import/unbind";
// *************** 新手任务 ***************
public static final String NOVICE_LIST = "/kjy/mp/seller/novice/list";
public static final String NOVICE_MONGOLIANLAYERISPLAY = "/kjy/mp/seller/novice/mongolianLayerDisplay";
// *************** 谁看过我 ***************
public static final String WHOSAWME_CUSTCLUELISTV2 = "/kjy/mp/whoSawMe/custClueList/v2";
// *************** 文章 ***************
public static final String ARTICLE_H5INFO = "/kjy/mp/article/h5info";
public static final String ARTICLE_H5INFO = "/kjy/mp/article/h5info";
public static final String ARTICLE_GETEXPINFO = "/kjy/mp/explosioncontent/getexpinfo";
public static final String ARTICLE_GETTAGTYPESBYCONTENTID = "/kjy/mp/explosionContent/resource/getTagTypesByContentId";
public static final String ARTICLE_GETEXPINFO = "/kjy/mp/explosioncontent/getexpinfo";
public static final String ARTICLE_GETQUESTIONS = "/kjy/mp/explosioncontent/qa/getquestions";
public static final String ARTICLE_GETTAGTYPESBYCONTENTID = "/kjy/mp/explosionContent/resource/getTagTypesByContentId";
public static final String ARTICLE_ISDISPLAYACTIVITY = "/kjy/mp/clue/activity/isDisplayActivity";
public static final String ARTICLE_GETENHANCEDCOLUMNCONFIG = "/kjy/mp/sellerConfig/getEnhancedColumnConfig";
public static final String ARTICLE_ENHANCEDCOLUMN_GETCONTENTS = "/kjy/mp/enhancedColumn/getContents";
public static final String ARTICLE_ENHANCEDCOLUMN_GETFAQS = "/kjy/mp/enhancedColumn/getFAQs";
// ************** 设置中心 ***************
public static final String SELLERCONFIG_EDITCONFIG = "/kjy/mp/sellerConfig/editConfig";
public static final String SELLERCONFIG_EDITCONFIG = "/kjy/mp/sellerConfig/editConfig";
}
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