Commit 628a9bfb authored by Su-Yi's avatar Su-Yi

修改接口地址写法

parent 78e8c0bb
...@@ -16,7 +16,12 @@ import static com.kjj.qa.config.BasicConfig.*; ...@@ -16,7 +16,12 @@ import static com.kjj.qa.config.BasicConfig.*;
public class GreetingCard { public class GreetingCard {
private static final NetworkUtil network = NetworkUtil.getInstance(); private static final NetworkUtil network = NetworkUtil.getInstance();
int tagId = 0; int tagId = 0;
String greetingName = "";
String contentId = ""; String contentId = "";
String scid = "";
String shareId = "";
String confId = "";
@BeforeClass @BeforeClass
public void setUp() { public void setUp() {
...@@ -52,7 +57,7 @@ public class GreetingCard { ...@@ -52,7 +57,7 @@ public class GreetingCard {
} }
// 获取539的贺卡列表 // 获取539的贺卡列表
@Test(description="生日tab贺卡列表",priority = 3) @Test(description="生日tab贺卡列表",priority = 4)
public void 生日tab贺卡列表() throws IOException { public void 生日tab贺卡列表() throws IOException {
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
params.put("pageIndex", 1); params.put("pageIndex", 1);
...@@ -62,11 +67,46 @@ public class GreetingCard { ...@@ -62,11 +67,46 @@ public class GreetingCard {
Response response = network.getResponse(params,GREETING_PAGELIST); Response response = network.getResponse(params,GREETING_PAGELIST);
boolean hasList = response.jsonPath().getInt("data.list.size()") > 0; boolean hasList = response.jsonPath().getInt("data.list.size()") > 0;
contentId = response.jsonPath().getString("data.list[0].id"); contentId = response.jsonPath().getString("data.list[0].id");
greetingName = response.jsonPath().getString("data.list[0].title");
Assert.assertTrue(hasList,network.message(params,GREETING_PAGELIST,"获取贺卡tab失败")); Assert.assertTrue(hasList,network.message(params,GREETING_PAGELIST,"获取贺卡tab失败"));
} }
// 贺卡详情页
@Test(description="贺卡详情页",priority = 5)
public void 贺卡详情页() throws IOException {
// 获取scId
Map<String, Object> params = new HashMap<String, Object>();
params.put("contentId", contentId);
Response response = network.getResponse(params,GETSCID);
scid = response.jsonPath().getString("data");
// 获取贺卡信息
Map<String, Object> infoParams = new HashMap<String, Object>();
infoParams.put("scid",scid);
response = network.getResponse(infoParams,GREETING_H5INFO);
String name = response.jsonPath().getString("data.title");
Assert.assertEquals(name,greetingName, network.message(infoParams,GREETING_H5INFO,"获取贺卡信息失败"));
}
// 获取H5分享信息
@Test(description="获取H5分享信息",priority = 7)
public void 获取H5分享信息() throws IOException {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid", scid);
params.put("createSource",1);
Response response = network.postResponse(params,GREETING_SAVEDEFAULT);
confId = response.jsonPath().getString("data");
Map<String, Object> shareParams = new HashMap<String, Object>();
shareParams.put("confId", confId);
response = network.getResponse(shareParams,GREETING_H5SHARE);
shareId = response.jsonPath().getString("data.id");
String title = response.jsonPath().getString("data.title");
Assert.assertEquals(title,greetingName,network.message(shareParams,GREETING_H5SHARE,"获取H5分享信息失败"));
}
// 我送出的贺卡列表 // 我送出的贺卡列表
@Test(description="我送出的贺卡列表",priority = 3) @Test(description="我送出的贺卡列表",priority = 8)
public void 我送出的贺卡列表() throws IOException { public void 我送出的贺卡列表() throws IOException {
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
params.put("pageIndex", 1); params.put("pageIndex", 1);
...@@ -76,8 +116,9 @@ public class GreetingCard { ...@@ -76,8 +116,9 @@ public class GreetingCard {
Assert.assertFalse(hasList,network.message(params,GREETING_CONFLIST,"获取我的贺卡初始列表数量有误")); Assert.assertFalse(hasList,network.message(params,GREETING_CONFLIST,"获取我的贺卡初始列表数量有误"));
} }
@AfterClass @AfterClass
public static void tearDown(){ public static void tearDown(){
apiCount += 5; apiCount += 8;
} }
} }
...@@ -72,7 +72,7 @@ public class Pay { ...@@ -72,7 +72,7 @@ public class Pay {
Response orderAppId = network.postResponse(payParams,PAY_ORDERCREATE); Response orderAppId = network.postResponse(payParams,PAY_ORDERCREATE);
String appId = orderAppId.jsonPath().getString("data.appId"); String appId = orderAppId.jsonPath().getString("data.appId");
Assert.assertEquals(appId,"wxcb8c36279dd7dff2",network.message(payParams, PAY_ORDERCREATE,"拉起支付:拉起微信支付失败")); //判断返回的微信调起参数中appId是否正确 Assert.assertEquals(appId,"wxcb8c36279dd7dff2",network.message(payParams, PAY_ORDERCREATE,"拉起支付:拉起微信支付失败")); //判断返回的微信调起参数中appId是否正确
orderAppId.body().prettyPrint();
} }
@Test (description = "默认付费_取消支付",priority = 3) @Test (description = "默认付费_取消支付",priority = 3)
...@@ -101,7 +101,7 @@ public class Pay { ...@@ -101,7 +101,7 @@ public class Pay {
// } // }
@Test (description = "默认付费_切换会员类型为保险版",priority = 5) @Test (description = "默认付费_切换会员类型为保险版",priority = 5)
public void 默认付费_切换为保险版会员类型并成功付款() throws IOException { public void 默认付费_切换为保险版会员类型() throws IOException {
//会员类型版本判断 //会员类型版本判断
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
params.put("t",System.currentTimeMillis()); params.put("t",System.currentTimeMillis());
...@@ -124,6 +124,12 @@ public class Pay { ...@@ -124,6 +124,12 @@ public class Pay {
Assert.assertEquals(userVersion,changeVersion,network.message(params, VERSION_INFO,"会员类型版本判断:判断错误,此版本为尊享版")); Assert.assertEquals(userVersion,changeVersion,network.message(params, VERSION_INFO,"会员类型版本判断:判断错误,此版本为尊享版"));
} }
// 支付成功回调
@Test (description = "默认付费_支付成功回调",priority = 6)
public void 默认付费_支付成功回调() throws IOException {
}
@AfterClass @AfterClass
public static void tearDown() throws IOException, InterruptedException { public static void tearDown() throws IOException, InterruptedException {
apiCount += 6; apiCount += 6;
......
...@@ -6,7 +6,7 @@ public class BasicConfig { ...@@ -6,7 +6,7 @@ public class BasicConfig {
// *************** 配置信息,每次重新配置以下信息就ok *************** // *************** 配置信息,每次重新配置以下信息就ok ***************
// 是否推送 // 是否推送
public static final boolean isPushReport = true; //true public static final boolean isPushReport = false; //true
// 用户微信昵称 // 用户微信昵称
public static final String WECHAT_NAME = "小疙瘩人寿"; //true public static final String WECHAT_NAME = "小疙瘩人寿"; //true
// 用户tku // 用户tku
...@@ -22,13 +22,15 @@ public class BasicConfig { ...@@ -22,13 +22,15 @@ 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 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";
// *************** TKU *************** // *************** TKU ***************
public static final String VISITOR_TKU = "T3gM31f18jAW2hicRDxbwHFSuwA4MMVLLeHZ5G4yvb3kN3GLCWAGnZVPFsnr6i8exgC4uYrYUctn4qheph"; public static final String VISITOR_TKU = "T3gM31f18jAW2hicRDxbwHFSuwA4MMVLLeHZ5G4yvb3kN2xUC7kBMVyjghwaMUaBkXBb34TrZkSBtySoUs";
// *************** 素材ID *************** // *************** 素材ID ***************
...@@ -42,208 +44,208 @@ public class BasicConfig { ...@@ -42,208 +44,208 @@ public class BasicConfig {
// *************** 公共 *************** // *************** 公共 ***************
public static final String VERSION_INFO = "/kjy/mp/version/info"; public static final String VERSION_INFO = HOST + "/kjy/mp/version/info";
public static final String ISVIPSUBSCRIBE = "/kjy/mp/seller/isVipSubscribe"; public static final String ISVIPSUBSCRIBE = HOST + "/kjy/mp/seller/isVipSubscribe";
public static final String USER_INFO = "/kjy/mp/user/info"; public static final String USER_INFO = HOST + "/kjy/mp/user/info";
public static final String FORWARD = "/kjy/mp/forward"; public static final String FORWARD = HOST + "/kjy/mp/forward";
public static final String GETSCID = "/kjy/mp/seller/getScId"; public static final String GETSCID = HOST + "/kjy/mp/seller/getScId";
public static final String HASALREADYLIKE = "/kjy/mp/interaction/hasAlreadyLike"; public static final String HASALREADYLIKE = HOST + "/kjy/mp/interaction/hasAlreadyLike";
public static final String CHECKUNREAD = "/kjy/mp/chat/checkUnread"; public static final String CHECKUNREAD = HOST + "/kjy/mp/chat/checkUnread";
public static final String CONTENT_READ = "/kjy/mp/content/read"; public static final String CONTENT_READ = HOST + "/kjy/mp/content/read";
public static final String INTERACTION_LIKE = "/kjy/mp/interaction/like"; public static final String INTERACTION_LIKE = HOST + "/kjy/mp/interaction/like";
// *************** 支付 *************** // *************** 支付 ***************
public static final String PAY_GETMIDDLEDETAIL = "/kjy/mp/payMiddle/getMiddleDetail"; public static final String PAY_GETMIDDLEDETAIL = HOST + "/kjy/mp/payMiddle/getMiddleDetail";
public static final String PAY_HASSITESALEVALID = "/kjy/mp/seller/dist/hasSiteSaleValid"; public static final String PAY_HASSITESALEVALID = HOST + "/kjy/mp/seller/dist/hasSiteSaleValid";
public static final String PAY_GETPROMOCODE = "/kjy/order/getPromoCode"; public static final String PAY_GETPROMOCODE = HOST + "/kjy/order/getPromoCode";
public static final String PAY_COMBOLIST = "/kjy/mp/combo/list/v2?code="; public static final String PAY_COMBOLIST = HOST + "/kjy/mp/combo/list/v2?code=";
public static final String PAY_ORDERCREATE = "/kjy/order/create"; public static final String PAY_ORDERCREATE = HOST + "/kjy/order/create";
public static final String PAY_ORDERCANCEL = "/kjy/order/cancel"; public static final String PAY_ORDERCANCEL = HOST + "/kjy/order/cancel";
public static final String PAY_VERSIONEXCHANGE = "/kjy/mp/version/exchange"; public static final String PAY_VERSIONEXCHANGE = HOST + "/kjy/mp/version/exchange";
public static final String PAY_DISTRIBUTE = "/kjy/sp/visitorPayment/distribute"; public static final String PAY_DISTRIBUTE = HOST + "/kjy/sp/visitorPayment/distribute";
// *************** 名片 *************** // *************** 名片 ***************
public static final String SELLERCARD_TOPOFDETAIL = "/kjy/mp/sellerCardV5/topOfDetail"; public static final String SELLERCARD_TOPOFDETAIL = HOST + "/kjy/mp/sellerCardV5/topOfDetail";
public static final String SELLERCARD_EDITBASEINFO = "/kjy/mp/sellerCard/editBaseInfo"; public static final String SELLERCARD_EDITBASEINFO = HOST + "/kjy/mp/sellerCard/editBaseInfo";
public static final String SELLERCARD_PERSONALPROFILE = "/kjy/mp/sellerCardV5/personalProfile"; public static final String SELLERCARD_PERSONALPROFILE = HOST + "/kjy/mp/sellerCardV5/personalProfile";
public static final String SELLERCARD_EDITMAJORGOODAUTH = "/kjy/mp/sellerCard/editMajorGoodAuth"; public static final String SELLERCARD_EDITMAJORGOODAUTH = HOST + "/kjy/mp/sellerCard/editMajorGoodAuth";
public static final String SELLERCARD_APPRAISELISTNEW = "/kjy/mp/sellerCardV5/appraiseListNew"; public static final String SELLERCARD_APPRAISELISTNEW = HOST + "/kjy/mp/sellerCardV5/appraiseListNew";
public static final String SELLERCARD_GETQUESTIONS = "/kjy/mp/sellerCardV5/getQuestions"; public static final String SELLERCARD_GETQUESTIONS = HOST + "/kjy/mp/sellerCardV5/getQuestions";
public static final String SELLERCARD_ISDISPLAYACTIVITY = "/kjy/mp/clue/activity/isDisplayActivity"; public static final String SELLERCARD_ISDISPLAYACTIVITY = HOST + "/kjy/mp/clue/activity/isDisplayActivity";
public static final String SELLERCARD_COMPANYLIST = "/kjy/mp/company/list"; public static final String SELLERCARD_COMPANYLIST = HOST + "/kjy/mp/company/list";
public static final String SELLERCARD_SELLERCARDCASENEW = "/kjy/mp/sellerCardV5/sellerCardCasesNew"; public static final String SELLERCARD_SELLERCARDCASENEW = HOST + "/kjy/mp/sellerCardV5/sellerCardCasesNew";
public static final String SELLERCARD_PRODUCTLIST = "/kjy/mp/sellerCardV5/productList"; public static final String SELLERCARD_PRODUCTLIST = HOST + "/kjy/mp/sellerCardV5/productList";
public static final String SELLERCARD_GETSELLERCARDCONFIG = "/kjy/mp/sellerConfig/getSellerCardConfig"; public static final String SELLERCARD_GETSELLERCARDCONFIG = HOST + "/kjy/mp/sellerConfig/getSellerCardConfig";
public static final String SELLERCARD_GETSELLERCARDSTYLE = "/kjy/mp/sellerConfig/getSellerCardStyle"; public static final String SELLERCARD_GETSELLERCARDSTYLE = HOST + "/kjy/mp/sellerConfig/getSellerCardStyle";
public static final String SELLERCARD_TOPOFCONTENT = "/kjy/mp/sellerCardV5/topOfContent"; public static final String SELLERCARD_TOPOFCONTENT = HOST + "/kjy/mp/sellerCardV5/topOfContent";
public static final String SELLERCARD_BOTTOMOFCONTENT = "/kjy/mp/sellerCardV5/bottomOfContent"; public static final String SELLERCARD_BOTTOMOFCONTENT = HOST + "/kjy/mp/sellerCardV5/bottomOfContent";
// *************** 上传 *************** // *************** 上传 ***************
public static final String UPLOAD = "/kjy/mp/seller/import/upload"; public static final String UPLOAD = HOST + "/kjy/mp/seller/import/upload";
public static final String UPLOAD_TASKSTATUS = "/kjy/mp/seller/import/taskStatus"; public static final String UPLOAD_TASKSTATUS = HOST + "/kjy/mp/seller/import/taskStatus";
public static final String UPLOAD_CONTENTDETAIL = "/kjy/mp/content/detail"; public static final String UPLOAD_CONTENTDETAIL = HOST + "/kjy/mp/content/detail";
public static final String UPLOAD_UPDATEANDSHARE = "/kjy/mp/content/updateAndShare"; public static final String UPLOAD_UPDATEANDSHARE = HOST + "/kjy/mp/content/updateAndShare";
public static final String UPLOAD_UPLOADVEDIO = "/kjy/mp/upload/video"; public static final String UPLOAD_UPLOADVEDIO = HOST + "/kjy/mp/upload/video";
public static final String UPLOAD_SELLERUPLOADVEDIO = "/kjy/mp/seller/upload/video"; public static final String UPLOAD_SELLERUPLOADVEDIO = HOST + "/kjy/mp/seller/upload/video";
public static final String UPLOAD_HOT = "/kjy/mp/seller/import/hot"; public static final String UPLOAD_HOT = HOST + "/kjy/mp/seller/import/hot";
public static final String UPLOAD_VIDEOHOT = "/kjy/mp/seller/import/video/hot"; public static final String UPLOAD_VIDEOHOT = HOST + "/kjy/mp/seller/import/video/hot";
public static final String UPLOAD_LIST = "/kjy/mp/seller/import/list"; public static final String UPLOAD_LIST = HOST + "/kjy/mp/seller/import/list";
public static final String UPLOAD_UNBIND = "/kjy/mp/seller/import/unbind"; public static final String UPLOAD_UNBIND = HOST + "/kjy/mp/seller/import/unbind";
// *************** 新手任务 *************** // *************** 新手任务 ***************
public static final String NOVICE_LIST = "/kjy/mp/seller/novice/list"; public static final String NOVICE_LIST = HOST + "/kjy/mp/seller/novice/list";
public static final String NOVICE_MONGOLIANLAYERISPLAY = "/kjy/mp/seller/novice/mongolianLayerDisplay"; public static final String NOVICE_MONGOLIANLAYERISPLAY = HOST + "/kjy/mp/seller/novice/mongolianLayerDisplay";
// *************** 谁看过我 *************** // *************** 谁看过我 ***************
public static final String WHOSAWME_CUSTCLUELISTV2 = "/kjy/mp/whoSawMe/custClueList/v2"; public static final String WHOSAWME_CUSTCLUELISTV2 = HOST + "/kjy/mp/whoSawMe/custClueList/v2";
// *************** 文章 *************** // *************** 文章 ***************
public static final String ARTICLE_H5INFO = "/kjy/mp/article/h5info"; public static final String ARTICLE_H5INFO = HOST + "/kjy/mp/article/h5info";
public static final String ARTICLE_GETEXPINFO = "/kjy/mp/explosioncontent/getexpinfo"; public static final String ARTICLE_GETEXPINFO = HOST + "/kjy/mp/explosioncontent/getexpinfo";
public static final String ARTICLE_GETTAGTYPESBYCONTENTID = "/kjy/mp/explosionContent/resource/getTagTypesByContentId"; public static final String ARTICLE_GETTAGTYPESBYCONTENTID = HOST + "/kjy/mp/explosionContent/resource/getTagTypesByContentId";
public static final String ARTICLE_GETQUESTIONS = "/kjy/mp/explosioncontent/qa/getquestions"; public static final String ARTICLE_GETQUESTIONS = HOST + "/kjy/mp/explosioncontent/qa/getquestions";
public static final String ARTICLE_ISDISPLAYACTIVITY = "/kjy/mp/clue/activity/isDisplayActivity"; public static final String ARTICLE_ISDISPLAYACTIVITY = HOST + "/kjy/mp/clue/activity/isDisplayActivity";
public static final String ARTICLE_GETENHANCEDCOLUMNCONFIG = "/kjy/mp/sellerConfig/getEnhancedColumnConfig"; public static final String ARTICLE_GETENHANCEDCOLUMNCONFIG = HOST + "/kjy/mp/sellerConfig/getEnhancedColumnConfig";
public static final String ARTICLE_ENHANCEDCOLUMN_GETCONTENTS = "/kjy/mp/enhancedColumn/getContents"; public static final String ARTICLE_ENHANCEDCOLUMN_GETCONTENTS = HOST + "/kjy/mp/enhancedColumn/getContents";
public static final String ARTICLE_ENHANCEDCOLUMN_GETFAQS = "/kjy/mp/enhancedColumn/getFAQs"; public static final String ARTICLE_ENHANCEDCOLUMN_GETFAQS = HOST + "/kjy/mp/enhancedColumn/getFAQs";
public static final String ARTICLE_GETEXPLOSIONCONTENTLIST = "/kjy/mp/explosioncontent/getExplosionContentList"; public static final String ARTICLE_GETEXPLOSIONCONTENTLIST = HOST + "/kjy/mp/explosioncontent/getExplosionContentList";
// ************** 发圈素材 *************** // ************** 发圈素材 ***************
public static final String FRIENDS_GETMATERIALTAGS = "/kjy/mp/materialContent/getmaterialTags"; public static final String FRIENDS_GETMATERIALTAGS = HOST + "/kjy/mp/materialContent/getmaterialTags";
public static final String FRIENDS_ISUSERFIRSTENTERANDCOLLECT = "/kjy/mp/materialContent/isUserFirstEnterAndCollect"; public static final String FRIENDS_ISUSERFIRSTENTERANDCOLLECT = HOST + "/kjy/mp/materialContent/isUserFirstEnterAndCollect";
public static final String FRIENDS_COUNTBYFIRSTTAG = "/kjy/mp/timelineContent/countByFirstTag"; public static final String FRIENDS_COUNTBYFIRSTTAG = HOST + "/kjy/mp/timelineContent/countByFirstTag";
public static final String FRIENDS_GETUNREADTIMELINSLIST = "/kjy/mp/timelineContent/getUnreadTimelineList"; public static final String FRIENDS_GETUNREADTIMELINSLIST = HOST + "/kjy/mp/timelineContent/getUnreadTimelineList";
public static final String FRIENDS_GETTIMELINELIST = "/kjy/mp/timelineContent/getTimelineList"; public static final String FRIENDS_GETTIMELINELIST = HOST + "/kjy/mp/timelineContent/getTimelineList";
public static final String FRIENDS_GETNEWESTCOUNTBYTYPE = "/kjy/mp/home/getNewestCountByType"; public static final String FRIENDS_GETNEWESTCOUNTBYTYPE = HOST + "/kjy/mp/home/getNewestCountByType";
public static final String FRIENDS_ASYNCMARKTIMELINEREAD = "/kjy/mp/timelineContent/asyncMarkTimelineRead"; public static final String FRIENDS_ASYNCMARKTIMELINEREAD = HOST + "/kjy/mp/timelineContent/asyncMarkTimelineRead";
public static final String FRIENDS_ADDORCANCELCOLLECT = "/kjy/mp/materialContent/addOrCancelCollect"; public static final String FRIENDS_ADDORCANCELCOLLECT = HOST + "/kjy/mp/materialContent/addOrCancelCollect";
public static final String FRIENDS_QUERYLISTFORCOLLECT = "/kjy/mp/materialContent/queryListForCollect"; public static final String FRIENDS_QUERYLISTFORCOLLECT = HOST + "/kjy/mp/materialContent/queryListForCollect";
public static final String FRIENDS_GETCHANNELLIST = "/kjy/mp/materialContent/getChannelList"; public static final String FRIENDS_GETCHANNELLIST = HOST + "/kjy/mp/materialContent/getChannelList";
public static final String FRIENDS_CHANNELDETAIL = "/kjy/mp/materialContent/channelDetail"; public static final String FRIENDS_CHANNELDETAIL = HOST + "/kjy/mp/materialContent/channelDetail";
public static final String FRIENDS_GETCURRENTINFO ="/kjy/mp/timelineContent/getCurrentInfo"; public static final String FRIENDS_GETCURRENTINFO = HOST + "/kjy/mp/timelineContent/getCurrentInfo";
// ************** 首页 **************** // ************** 首页 ****************
public static final String HOME_GETHOMETIMELINECONTENT = "/kjy/mp/home/getHomeTimeLineContent"; public static final String HOME_GETHOMETIMELINECONTENT = HOST + "/kjy/mp/home/getHomeTimeLineContent";
// ************** 设置中心 *************** // ************** 设置中心 ***************
public static final String SELLERCONFIG_EDITCONFIG = "/kjy/mp/sellerConfig/editConfig"; public static final String SELLERCONFIG_EDITCONFIG = HOST + "/kjy/mp/sellerConfig/editConfig";
// ************** BOSS看板 *************** // ************** BOSS看板 ***************
public static final String BOSS_VERSIONINFO = "/kjy/mp/version/info"; public static final String BOSS_VERSIONINFO = HOST + "/kjy/mp/version/info";
public static final String BOSS_ROLE = "/kjy/mp/seller/team/member/role"; public static final String BOSS_ROLE = HOST + "/kjy/mp/seller/team/member/role";
public static final String BOSS_CODE = "/kjy/mp/seller/team/invite/code"; public static final String BOSS_CODE = HOST + "/kjy/mp/seller/team/invite/code";
public static final String BOSS_IDENTITY = "/kjy/mp/seller/team/member/identity"; public static final String BOSS_IDENTITY = HOST + "/kjy/mp/seller/team/member/identity";
public static final String BOSS_BOUND = "/kjy/mp/seller/team/bound"; public static final String BOSS_BOUND = HOST + "/kjy/mp/seller/team/bound";
public static final String BOSS_BOSS = "/kjy/mp/seller/team/boss"; public static final String BOSS_BOSS = HOST + "/kjy/mp/seller/team/boss";
public static final String BOSS_REMOVE = "/kjy/mp/seller/team/member/remove"; public static final String BOSS_REMOVE = HOST + "/kjy/mp/seller/team/member/remove";
public static final String BOSS_USERINFO = "/kjy/mp/user/info"; public static final String BOSS_USERINFO = HOST + "/kjy/mp/user/info";
public static final String BOSS_MEMBER = "/kjy/mp/seller/team/member"; public static final String BOSS_MEMBER = HOST + "/kjy/mp/seller/team/member";
// *************** 贺卡 *************** // *************** 贺卡 ***************
public static final String GREETING_BANNER = "/kjy/mp/greeting/banner"; public static final String GREETING_BANNER = HOST + "/kjy/mp/greeting/banner";
public static final String GREETING_SHOW = "/kjy/mp/seller/parctice/show"; public static final String GREETING_SHOW = HOST + "/kjy/mp/seller/parctice/show";
public static final String GREETING_ALLFORWARD = "/kjy/mp/greeting/allForward"; public static final String GREETING_ALLFORWARD = HOST + "/kjy/mp/greeting/allForward";
public static final String GREETING_FINDBYTYPE = "/kjy/mp/tag/findByType"; public static final String GREETING_FINDBYTYPE = HOST + "/kjy/mp/tag/findByType";
public static final String GREETING_GETTIPSBYPAGE = "/kjy/mp/tips/getTipsByPage"; public static final String GREETING_GETTIPSBYPAGE = HOST + "/kjy/mp/tips/getTipsByPage";
public static final String GREETING_SHOWLAYER = "/kjy/mp/festival/showLayer"; public static final String GREETING_SHOWLAYER = HOST + "/kjy/mp/festival/showLayer";
public static final String GREETING_PAGELIST = "/kjy/mp/greeting/pageList"; public static final String GREETING_PAGELIST = HOST + "/kjy/mp/greeting/pageList";
public static final String GREETING_CONFLIST = "/kjy/mp/greeting/conf/list"; public static final String GREETING_CONFLIST = HOST + "/kjy/mp/greeting/conf/list";
// *************** 管理后台 *************** public static final String GREETING_H5SHARE = ACTIVITY_HOST + "/kjy/mp/greeting/conf/h5share";
public static final String SSO_DOLOGIN = "/doLogin";
public static final String SSO_INDEX = "/sso/ssoIndex"; public static final String GREETING_H5INFO = ACTIVITY_HOST + "/kjy/mp/content/h5info";
public static final String TESTUSER_DISABLEUSER = "kjj-mng.duibatest.com.cn/kjy/manager/testUser/disableUser"; public static final String GREETING_SAVEDEFAULT = ACTIVITY_HOST + "/kjy/mp/greeting/conf/saveDefault";
public static final String MANAGER_AUTH = "/auth/getAuthList"; // *************** 管理后台 ***************
public static final String SSO_DOLOGIN = SSO_HOST + "/doLogin";
public static final String MANAGER_CHANGECOMPANY = "/kjy/manager/seller/changeCompany"; public static final String MANAGER_CHANGECOMPANY = MANAGER_HOST + "/kjy/manager/seller/changeCompany";
public static final String MANAGER_UPDATETYPEORDATE = "/kjy/manager/seller/updateTypeOrDate"; public static final String MANAGER_UPDATETYPEORDATE = MANAGER_HOST + "/kjy/manager/seller/updateTypeOrDate";
public static final String MANAGER_SETINTERALSELLER = "/kjy/manager/seller/setInternalSeller"; public static final String MANAGER_SETINTERALSELLER = MANAGER_HOST + "/kjy/manager/seller/setInternalSeller";
public static final String MANAGER_ADMININFO = "/kjy/manager/admin/info"; public static final String MANAGER_ADMININFO = MANAGER_HOST + "/kjy/manager/admin/info";
} }
...@@ -12,8 +12,7 @@ import java.io.IOException; ...@@ -12,8 +12,7 @@ import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static com.kjj.qa.config.BasicConfig.SSO_DOLOGIN; import static com.kjj.qa.config.BasicConfig.*;
import static com.kjj.qa.config.BasicConfig.SSO_HOST;
import static io.restassured.RestAssured.given; import static io.restassured.RestAssured.given;
public class ManagerUtil { public class ManagerUtil {
...@@ -23,7 +22,6 @@ public class ManagerUtil { ...@@ -23,7 +22,6 @@ public class ManagerUtil {
public static void ssoLogin(){ public static void ssoLogin(){
// 请求下后台的管理员信息接口 // 请求下后台的管理员信息接口
network.host = MANAGER_HOST;
Response response = network.getResponse(MANAGER_ADMININFO); Response response = network.getResponse(MANAGER_ADMININFO);
String actualType = "application/json;charset=UTF-8"; String actualType = "application/json;charset=UTF-8";
String exceptType = response.headers().getValue("Content-Type"); String exceptType = response.headers().getValue("Content-Type");
...@@ -34,7 +32,6 @@ public class ManagerUtil { ...@@ -34,7 +32,6 @@ public class ManagerUtil {
} }
// 1.先进入SSO登录框 登入管理后台 // 1.先进入SSO登录框 登入管理后台
network.host = SSO_HOST;
Map<String, Object> loginParams = new HashMap<String, Object>(); Map<String, Object> loginParams = new HashMap<String, Object>();
loginParams.put("email","lihaohong"); loginParams.put("email","lihaohong");
loginParams.put("password","duiba123456"); loginParams.put("password","duiba123456");
...@@ -52,13 +49,10 @@ public class ManagerUtil { ...@@ -52,13 +49,10 @@ public class ManagerUtil {
ssoCookies = response.getCookies(); ssoCookies = response.getCookies();
network.agentCookies.putAll(ssoCookies); network.agentCookies.putAll(ssoCookies);
network.agentHeaders.put("X-Csrf-Token",ssoCookies.get("csrf_token")); network.agentHeaders.put("X-Csrf-Token",ssoCookies.get("csrf_token"));
network.host = MANAGER_HOST;
} }
// 拿到sellerId // 拿到sellerId
public static String getSellerId (){ public static String getSellerId (){
network.host = HOST;
Response response = network.getResponse(USER_INFO); Response response = network.getResponse(USER_INFO);
return response.jsonPath().getString("data.sellerId"); return response.jsonPath().getString("data.sellerId");
} }
...@@ -93,7 +87,6 @@ public class ManagerUtil { ...@@ -93,7 +87,6 @@ public class ManagerUtil {
network.agentCookies.remove("sso_ticket"); network.agentCookies.remove("sso_ticket");
network.agentCookies.remove("device_no"); network.agentCookies.remove("device_no");
network.agentCookies.remove("csrf_token"); network.agentCookies.remove("csrf_token");
network.host = HOST;
} }
// 切换为内部人员 isInternalSeller 传1代表内部人员 传0代表非内部人员 // 切换为内部人员 isInternalSeller 传1代表内部人员 传0代表非内部人员
...@@ -111,7 +104,6 @@ public class ManagerUtil { ...@@ -111,7 +104,6 @@ public class ManagerUtil {
network.agentCookies.remove("sso_ticket"); network.agentCookies.remove("sso_ticket");
network.agentCookies.remove("device_no"); network.agentCookies.remove("device_no");
network.agentCookies.remove("csrf_token"); network.agentCookies.remove("csrf_token");
network.host = HOST;
} }
......
...@@ -27,10 +27,6 @@ public class NetworkUtil { ...@@ -27,10 +27,6 @@ public class NetworkUtil {
public Map<String, Object> getFileHeaders() { return fileHeaders; } public Map<String, Object> getFileHeaders() { return fileHeaders; }
public void setFileHeadersHeaders(Map<String, Object> fileHeaders) { this.fileHeaders = fileHeaders; } public void setFileHeadersHeaders(Map<String, Object> fileHeaders) { this.fileHeaders = fileHeaders; }
public String host = "";
public String getHost() {return host;}
public void setHost(String host) {this.host = host;}
// 钉钉的 headers // 钉钉的 headers
public Map<String, Object> dingTalkHeaders = new HashMap<String, Object>(); public Map<String, Object> dingTalkHeaders = new HashMap<String, Object>();
public Map<String, Object> getDingTalkHeaders() { return dingTalkHeaders; } public Map<String, Object> getDingTalkHeaders() { return dingTalkHeaders; }
...@@ -40,8 +36,6 @@ public class NetworkUtil { ...@@ -40,8 +36,6 @@ public class NetworkUtil {
// 构造函数 初始化tku、content-type // 构造函数 初始化tku、content-type
private NetworkUtil (){ private NetworkUtil (){
//配置地址
host = HOST;
//cookies中的tku //cookies中的tku
agentCookies.put("tku",AGENT_TKU); agentCookies.put("tku",AGENT_TKU);
//json类型的headers //json类型的headers
...@@ -73,7 +67,7 @@ public class NetworkUtil { ...@@ -73,7 +67,7 @@ public class NetworkUtil {
return given() return given()
.cookies(agentCookies) .cookies(agentCookies)
.headers(agentHeaders) .headers(agentHeaders)
.get(host + path); .get(path);
} }
// get 带参请求 // get 带参请求
...@@ -82,7 +76,7 @@ public class NetworkUtil { ...@@ -82,7 +76,7 @@ public class NetworkUtil {
.cookies(agentCookies) .cookies(agentCookies)
.headers(agentHeaders) .headers(agentHeaders)
.params(params) .params(params)
.get(host + path); .get(path);
} }
// post 不帶参请求 // post 不帶参请求
...@@ -90,7 +84,7 @@ public class NetworkUtil { ...@@ -90,7 +84,7 @@ public class NetworkUtil {
return given() return given()
.cookies(agentCookies) .cookies(agentCookies)
.headers(agentHeaders) .headers(agentHeaders)
.post(host + path); .post(path);
} }
// post 带参请求 // post 带参请求
...@@ -100,7 +94,7 @@ public class NetworkUtil { ...@@ -100,7 +94,7 @@ public class NetworkUtil {
.cookies(agentCookies) .cookies(agentCookies)
.headers(agentHeaders) .headers(agentHeaders)
.body(jsonStr) .body(jsonStr)
.post(host + path); .post(path);
} }
// post 文件上传 // post 文件上传
...@@ -109,7 +103,7 @@ public class NetworkUtil { ...@@ -109,7 +103,7 @@ public class NetworkUtil {
.cookies(agentCookies) .cookies(agentCookies)
.headers(fileHeaders) .headers(fileHeaders)
.multiPart("file",new File(filePath)) .multiPart("file",new File(filePath))
.post(host + path); .post(path);
} }
// 管理后台 // 管理后台
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="客集集-测试结果" verbose="1" thread-count="3"> <suite name="客集集" verbose="1" thread-count="3">
<!-- <test preserve-order="true" name="首页" >--> <!-- <test preserve-order="true" name="首页" >-->
<!-- <classes>--> <!-- <classes>-->
<!-- <class name="com.kjj.qa.cases.Home"/>--> <!-- <class name="com.kjj.qa.cases.Home"/>-->
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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