Commit 4ae4d218 authored by 龚小红's avatar 龚小红

更改xml文件

parent 9aea1576
......@@ -25,6 +25,13 @@ public class NoviceGuidance implements Authorization {
@Test(description = "禁用代理人小葡萄",priority = 1)
public void 禁用代理人小葡萄() throws UnsupportedEncodingException {
//取关公众号
network.agentHeaders.put("Content-Type","text/plain");
String str = "<xml><ToUserName><![CDATA[gh_3b9884c7b0ee]]></ToUserName><FromUserName><![CDATA[osi5w5kT-smQ42Fc-ByO4G8C-E1M]]></FromUserName><CreateTime>1628040963</CreateTime><MsgType><![CDATA[event]]></MsgType><Event><![CDATA[unsubscribe]]></Event></xml>";
Response response = network.postXMLResponse(str,MANAGER_oamsg);
System.out.println(response.body().asString());
network.agentHeaders.put("Content-Type","application/json");
//找到小葡萄的用户id
Map<String, Object> params = new HashMap<String, Object>();
String name = URLEncoder.encode("小葡萄","utf-8");
......@@ -34,7 +41,7 @@ public class NoviceGuidance implements Authorization {
params.put("pageSize",10);
params.put("agentId","");
params.put("phoneNumber","");
Response response = network.getResponse(params,MANAGER_vipList);
response = network.getResponse(params,MANAGER_vipList);
boolean success = response.jsonPath().getBoolean("success");
Object data = response.jsonPath().getJsonObject("data");
Assert.assertTrue(success,network.message(params,MANAGER_vipList,"接口返回失败",response.body().asString()));
......@@ -47,28 +54,29 @@ public class NoviceGuidance implements Authorization {
//禁用账号
params.put("userId",userId);
response = network.postResponse(params,MANAGER_updateTypeOrDate);
response = network.postResponse(params,MANAGER_disableUser);
success = response.jsonPath().getBoolean("success");
boolean result = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,USINGSTRATAGY_strategyDetail,"接口返回失败",response.body().asString()));
Assert.assertTrue(result,network.message(params,USINGSTRATAGY_strategyDetail,"返回数据为空",response.body().asString()));
Assert.assertTrue(success,network.message(params,MANAGER_disableUser,"接口返回失败",response.body().asString()));
Assert.assertTrue(result,network.message(params,MANAGER_disableUser,"返回数据为空",response.body().asString()));
//切换会员
params.put("reason","测试账号");
params.put("sellerId",sellerId);
params.put("userVersion",userVersion);
params.put("vipEndDate",10);
params.put("vipStartDate","");
params.put("vipType",2);
response = network.getResponse(params,MANAGER_updateTypeOrDate);
success = response.jsonPath().getBoolean("success");
result = response.jsonPath().getBoolean("data");
Assert.assertTrue(success,network.message(params,USINGSTRATAGY_strategyDetail,"接口返回失败",response.body().asString()));
Assert.assertTrue(result,network.message(params,USINGSTRATAGY_strategyDetail,"返回数据为空",response.body().asString()));
}
@Test(description = "小葡萄进入首页",priority = 2)
public void 小葡萄进入首页(){
}
// @Test(description = "小葡萄进入首页",priority = 2)
// public void 小葡萄进入首页(){
//
// //切换会员
// params.put("reason","测试账号");
// params.put("sellerId",sellerId);
// params.put("userVersion",userVersion);
// params.put("vipEndDate",10);
// params.put("vipStartDate","");
// params.put("vipType",2);
// response = network.getResponse(params,MANAGER_updateTypeOrDate);
// success = response.jsonPath().getBoolean("success");
// result = response.jsonPath().getBoolean("data");
// Assert.assertTrue(success,network.message(params,USINGSTRATAGY_strategyDetail,"接口返回失败",response.body().asString()));
// Assert.assertTrue(result,network.message(params,USINGSTRATAGY_strategyDetail,"返回数据为空",response.body().asString()));
// }
}
......@@ -969,4 +969,5 @@ public class BasicConfig {
public static final String MANAGER_vipList = MANAGER_HOST + "/kjy/manager/seller/vipList";
public static final String MANAGER_disableUser = MANAGER_HOST + "/kjy/manager/testUser/disableUser";
public static final String MANAGER_updateTypeOrDate = MANAGER_HOST + "/kjy/manager/seller/updateTypeOrDate";
public static final String MANAGER_oamsg = MANAGER_HOST + "/kjy/notify/oamsg";
}
......@@ -115,6 +115,19 @@ public class NetworkUtils {
return response;
}
// post xml请求方式
public Response postXMLResponse(String str, String path) {
Response response = given()
.cookies(agentCookies)
.headers(agentHeaders)
.body(str)
.post(path);
if (!Objects.equals(response.statusCode(),200)){
System.out.println("请求状态码错误,path=【"+path+"】 code=【"+response.statusCode()+"】");
}
return response;
}
// 管理后台
public Response getManagerCookies(String path){
Response response = given().
......
......@@ -2,83 +2,88 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="集客助手" verbose="1" thread-count="3">
<test preserve-order="true" name="支付">
<classes>
<class name="com.kjj.cases.assistant.pay.Pay"/>
</classes>
</test>
<test preserve-order="true" name="邀请返现">
<classes>
<class name="com.kjj.cases.assistant.pay.Cashback"/>
</classes>
</test>
<test preserve-order="true" name = "首页">
<classes>
<class name="com.kjj.cases.assistant.homePage.HomePage"/>
</classes>
</test>
<test preserve-order="true" name="我的名片">
<classes>
<class name="com.kjj.cases.assistant.card.PersonCard"/>
</classes>
</test>
<test preserve-order="true" name="文章中个人名片">
<classes>
<class name="com.kjj.cases.assistant.card.ArticalPersonCard"/>
</classes>
</test>
<test preserve-order="true" name = "种草素材">
<classes>
<class name="com.kjj.cases.assistant.homePage.RecommendMaterial"/>
</classes>
</test>
<test preserve-order="true" name = "今日早报">
<classes>
<class name="com.kjj.cases.assistant.homePage.DailyPaper"/>
</classes>
</test>
<test preserve-order="true" name = "上传链接">
<classes>
<class name="com.kjj.cases.assistant.homePage.Upload"/>
</classes>
</test>
<!-- <test preserve-order="true" name="支付">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.pay.Pay"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="邀请返现">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.pay.Cashback"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "首页">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.homePage.HomePage"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="我的名片">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.card.PersonCard"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="文章中个人名片">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.card.ArticalPersonCard"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "种草素材">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.homePage.RecommendMaterial"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "今日早报">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.homePage.DailyPaper"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "上传链接">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.homePage.Upload"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name = "获取访客">
<classes>
<class name="com.kjj.cases.assistant.whoSawMe.ForwardAndRead"/>
</classes>
</test>
<test preserve-order="true" name = "谁看过我">
<classes>
<class name="com.kjj.cases.assistant.whoSawMe.WhoSawMe"/>
</classes>
</test>
<test preserve-order="true" name = "我的转发">
<classes>
<class name="com.kjj.cases.assistant.whoSawMe.MyForward"/>
</classes>
</test>
<test preserve-order="true" name = "我的客户">
<classes>
<class name="com.kjj.cases.assistant.whoSawMe.MyCustomer"/>
</classes>
</test>
<test preserve-order="true" name = "贺卡">
<classes>
<class name="com.kjj.cases.assistant.markettools.GreetingCrad"/>
</classes>
</test>
<test preserve-order="true" name = "抽奖转盘">
<classes>
<class name="com.kjj.cases.assistant.markettools.GameLottery"/>
</classes>
</test>
<test preserve-order="true" name = "邀请函和趣味测评">
<classes>
<class name="com.kjj.cases.assistant.markettools.InvitationLetter"/>
</classes>
</test>
<test preserve-order="true" name = "使用攻略和设置中心">
<!-- <test preserve-order="true" name = "获取访客">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.whoSawMe.ForwardAndRead"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "谁看过我">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.whoSawMe.WhoSawMe"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "我的转发">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.whoSawMe.MyForward"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "我的客户">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.whoSawMe.MyCustomer"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "贺卡">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.markettools.GreetingCrad"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "抽奖转盘">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.markettools.GameLottery"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "邀请函和趣味测评">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.markettools.InvitationLetter"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name = "使用攻略和设置中心">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.assistant.menu.PersonalCenter"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name = "新手引导">
<classes>
<class name="com.kjj.cases.assistant.menu.PersonalCenter"/>
</classes>
......
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