Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oto
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
龚小红
oto
Commits
4ae4d218
Commit
4ae4d218
authored
Aug 04, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改xml文件
parent
9aea1576
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
123 additions
and
96 deletions
+123
-96
NoviceGuidance.java
...est/java/com/kjj/cases/assistant/menu/NoviceGuidance.java
+28
-20
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+1
-0
NetworkUtils.java
src/test/java/com/kjj/utils/NetworkUtils.java
+13
-0
wechatTestNG.xml
src/test/wechatTestNG.xml
+81
-76
No files found.
src/test/java/com/kjj/cases/assistant/menu/NoviceGuidance.java
View file @
4ae4d218
...
...
@@ -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()));
// }
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
4ae4d218
...
...
@@ -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"
;
}
src/test/java/com/kjj/utils/NetworkUtils.java
View file @
4ae4d218
...
...
@@ -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
().
...
...
src/test/wechatTestNG.xml
View file @
4ae4d218
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment