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
a55633c3
Commit
a55633c3
authored
Aug 07, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改方法函数调用方式
parent
9003940d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
90 deletions
+83
-90
ForwardAndRead.java
...java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
+39
-39
MyCustomer.java
...est/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
+11
-14
MyForward.java
...test/java/com/kjj/cases/assistant/whoSawMe/MyForward.java
+8
-10
WhoSawMe.java
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
+25
-27
No files found.
src/test/java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
View file @
a55633c3
...
...
@@ -17,8 +17,8 @@ import static com.kjj.config.BasicConfig.BOSS_EDITCONFIG;
// 谁看过我模块测试前执行一次代理人转发素材及访客访问和产生线索
public
class
ForwardAndRead
implements
Authorization
{
private
Response
response
;
private
Map
<
String
,
Object
>
param
;
private
static
Response
response
;
private
static
Map
<
String
,
Object
>
param
;
private
String
articleScId
;
private
Long
sellerId
;
private
String
jjvisitId
;
...
...
@@ -141,37 +141,37 @@ public class ForwardAndRead implements Authorization {
}
// 获取新用户
//
@Test(description = "新用户访问", priority = 7)
//
public void 新用户访问() throws IOException{
//
ThreadSleepUtils.sleep(5000);
//
network.agentCookies.put("tku", BaseUtils.tku);
//
response = network.getResponse(BasicConfig.USER_INFO);
//
System.out.println(response.body().asString());
//
param.clear();
//
param.put("scid", articleScId);
//
param.put("fromUserId", sellerId);
//
param.put("cancelPush", false);
//
param.put("visitPath", 0);
//
response = network.getResponse(param, BasicConfig.CONTENT_READ);
//
System.out.println(response.body().asString());
//
Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CONTENT_READ, "接口调用失败", response.body().asString()));
//
}
//
//
// 新用户领取赠险
//
@Test(description = "新用户领取赠险", priority = 8)
//
public void 新用户领取赠险() throws IOException{
//
param.clear();
//
param.put("clueTypeName", "WELFARE_INSURANCE");
//
param.put("insuranceId", insuranceId);
//
param.put("locationSource", 1);
//
param.put("scId", articleScId);
//
param.put("sourceId", articleScId);
//
param.put("sourceType", 1);
//
response = network.postResponse(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN);
//
System.out.println(response.body().asString());
//
String data = response.jsonPath().getString("data");
//
Assert.assertEquals(data, "success", network.message(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN, "领取赠险失败", response.body().asString()));
//
}
@Test
(
description
=
"新用户访问"
,
priority
=
7
)
public
void
新用户访问
()
throws
IOException
{
ThreadSleepUtils
.
sleep
(
5000
);
network
.
agentCookies
.
put
(
"tku"
,
BaseUtils
.
tku
);
response
=
network
.
getResponse
(
BasicConfig
.
USER_INFO
);
System
.
out
.
println
(
response
.
body
().
asString
());
param
.
clear
();
param
.
put
(
"scid"
,
articleScId
);
param
.
put
(
"fromUserId"
,
sellerId
);
param
.
put
(
"cancelPush"
,
false
);
param
.
put
(
"visitPath"
,
0
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CONTENT_READ
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CONTENT_READ
,
"接口调用失败"
,
response
.
body
().
asString
()));
}
// 新用户领取赠险
@Test
(
description
=
"新用户领取赠险"
,
priority
=
8
)
public
void
新用户领取赠险
()
throws
IOException
{
param
.
clear
();
param
.
put
(
"clueTypeName"
,
"WELFARE_INSURANCE"
);
param
.
put
(
"insuranceId"
,
insuranceId
);
param
.
put
(
"locationSource"
,
1
);
param
.
put
(
"scId"
,
articleScId
);
param
.
put
(
"sourceId"
,
articleScId
);
param
.
put
(
"sourceType"
,
1
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
);
System
.
out
.
println
(
response
.
body
().
asString
());
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
data
,
"success"
,
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"领取赠险失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"二度访客阅读文章"
,
priority
=
9
)
public
void
二度访客阅读文章
()
throws
IOException
{
...
...
@@ -242,7 +242,7 @@ public class ForwardAndRead implements Authorization {
}
// 通过素材contentId获取线索员文章scId
public
String
getContentScId
(
String
contentId
){
public
static
String
getContentScId
(
String
contentId
){
param
=
new
HashMap
<>();
param
.
put
(
"contentId"
,
contentId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
GETSCID
);
...
...
@@ -253,7 +253,7 @@ public class ForwardAndRead implements Authorization {
}
// 获取用户信息
public
Map
<
String
,
String
>
getUserInfo
(
String
userTku
){
public
static
Map
<
String
,
String
>
getUserInfo
(
String
userTku
){
network
.
agentCookies
.
put
(
"tku"
,
userTku
);
response
=
network
.
getResponse
(
BasicConfig
.
USER_INFO
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
USER_INFO
,
"接口调用失败"
,
response
.
body
().
asString
()));
...
...
@@ -269,10 +269,10 @@ public class ForwardAndRead implements Authorization {
// 解密tku
public
static
HashMap
<
String
,
Long
>
decodeTku
(
String
tku
){
// 登陆管理后台
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"tku"
,
tku
);
Response
response
=
network
.
getResponse
(
param
,
BasicConfig
.
MANAGER_TKU_DECODE
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
MANAGER_TKU_DECODE
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
MANAGER_TKU_DECODE
,
"接口请求失败"
,
response
.
body
().
asString
()));
Long
userId
=
response
.
jsonPath
().
getLong
(
"data.userId"
);
Long
sellerId
=
response
.
jsonPath
().
getLong
(
"data.sellerId"
);
...
...
@@ -285,7 +285,7 @@ public class ForwardAndRead implements Authorization {
}
// 加密sellerId
public
String
encodeId
(
Long
Id
){
public
static
String
encodeId
(
Long
Id
){
// 登陆管理后台
param
=
new
HashMap
<>();
param
.
put
(
"code"
,
Id
);
...
...
@@ -296,7 +296,7 @@ public class ForwardAndRead implements Authorization {
}
// 关闭数据看板演示数据
public
void
closeDemoData
()
throws
IOException
{
public
static
void
closeDemoData
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"configKey"
,
"boss_board_demon_switch"
);
param
.
put
(
"configValue"
,
false
);
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
View file @
a55633c3
...
...
@@ -19,7 +19,6 @@ import java.util.*;
public
class
MyCustomer
implements
Authorization
{
private
Response
response
;
private
Map
<
String
,
Object
>
param
;
private
ForwardAndRead
far
;
private
String
createTagId
;
private
long
visitor1UserId
;
private
String
sessionId
;
...
...
@@ -31,8 +30,6 @@ public class MyCustomer implements Authorization {
public
void
setUp
()
throws
IOException
{
BaseUtils
.
ssoLogin
();
visitor2Tku
();
far
=
new
ForwardAndRead
();
}
// 我的客户首页_客户统计
...
...
@@ -85,7 +82,7 @@ public class MyCustomer implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
String
newTagId
=
response
.
jsonPath
().
getString
(
"data[0].id"
);
String
newTagName
=
response
.
jsonPath
().
getString
(
"data[0].tagName"
);
Assert
.
assertEquals
(
newTagId
,
(
String
)
createTagId
,
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"新增标签id错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
newTagId
,
createTagId
,
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"新增标签id错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
newTagName
,
"新标签"
,
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"新增标签名称错误"
,
response
.
body
().
asString
()));
}
...
...
@@ -104,7 +101,7 @@ public class MyCustomer implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
String
newTagId
=
response
.
jsonPath
().
getString
(
"data[0].id"
);
String
newTagName
=
response
.
jsonPath
().
getString
(
"data[0].tagName"
);
Assert
.
assertEquals
(
newTagId
,
(
String
)
createTagId
,
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"新增标签id错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
newTagId
,
createTagId
,
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"新增标签id错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
newTagName
,
"新标签2"
,
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"新增标签名称错误"
,
response
.
body
().
asString
()));
}
...
...
@@ -132,7 +129,7 @@ public class MyCustomer implements Authorization {
// 我的客户首页_获取全部客户列表_最近访问
@Test
(
description
=
"客户列表_最近访问"
,
priority
=
6
)
public
void
客户列表
_
最近访问
()
throws
IOException
{
visitor1UserId
=
far
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
);
visitor1UserId
=
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
);
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
...
...
@@ -266,7 +263,7 @@ public class MyCustomer implements Authorization {
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CUSTOMERSEARCH
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"接口请求失败"
,
response
.
body
().
asString
()));
Long
custUserId
=
response
.
jsonPath
().
getLong
(
"data.list[0].userId"
);
Assert
.
assertEquals
(
custUserId
,
far
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"好友转发的访客userId与预期不一致"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
custUserId
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"好友转发的访客userId与预期不一致"
,
response
.
body
().
asString
()));
}
// 客户列表_标签
...
...
@@ -308,7 +305,7 @@ public class MyCustomer implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTINFO
,
"接口请求失败"
,
response
.
body
().
asString
()));
Long
sellerId
=
response
.
jsonPath
().
getLong
(
"data.sellerId"
);
sessionId
=
response
.
jsonPath
().
getString
(
"data.sessionId"
);
Assert
.
assertEquals
(
sellerId
,
far
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
),
network
.
message
(
param
,
BasicConfig
.
CUSTINFO
,
"访客所属销售员sellerId不符"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
sellerId
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
),
network
.
message
(
param
,
BasicConfig
.
CUSTINFO
,
"访客所属销售员sellerId不符"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
sessionId
,
network
.
message
(
param
,
BasicConfig
.
CUSTINFO
,
"访客sessionId为空"
,
response
.
body
().
asString
()));
}
...
...
@@ -695,7 +692,7 @@ public class MyCustomer implements Authorization {
@Test
(
description
=
"客户信息_客户关系链_统计信息"
,
priority
=
38
)
public
void
客户信息
_
客户关系链
_
统计信息
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
far
.
decodeTku
(
BasicConfig
.
AGENT_TKU
).
get
(
"userId"
));
param
.
put
(
"custUserId"
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
AGENT_TKU
).
get
(
"userId"
));
response
=
network
.
getResponse
(
param
,
BasicConfig
.
RELATIONINFO_HEADER
);
String
name
=
response
.
jsonPath
().
getString
(
"data.name"
);
Assert
.
assertEquals
(
name
,
BasicConfig
.
WECHAT_NAME
,
network
.
message
(
param
,
BasicConfig
.
RELATIONINFO_HEADER
,
"客户姓名不正确"
,
response
.
body
().
asString
()));
...
...
@@ -705,7 +702,7 @@ public class MyCustomer implements Authorization {
@Test
(
description
=
"客户信息_客户关系链_人脉列表"
,
priority
=
39
)
public
void
客户信息
_
客户关系链
_
人脉列表
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
far
.
decodeTku
(
BasicConfig
.
AGENT_TKU
).
get
(
"userId"
));
param
.
put
(
"custUserId"
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
AGENT_TKU
).
get
(
"userId"
));
param
.
put
(
"type"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageIndex"
,
1
);
...
...
@@ -794,7 +791,7 @@ public class MyCustomer implements Authorization {
@Test
(
description
=
"客户详情页_留言_留言对象是否关注公众号"
,
priority
=
44
)
public
void
客户详情页
_
留言
_
留言对象是否关注公众号
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"targetSid"
,
far
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
));
param
.
put
(
"targetSid"
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
));
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CHAT_GETSUBSCRIBESTATUS
);
int
subscribe
=
response
.
jsonPath
().
getInt
(
"data.subscribe"
);
Assert
.
assertEquals
(
subscribe
,
1
,
network
.
message
(
param
,
BasicConfig
.
CHAT_GETSUBSCRIBESTATUS
,
"判断用户是否关注公众号失败"
,
response
.
body
().
asString
()));
...
...
@@ -826,7 +823,7 @@ public class MyCustomer implements Authorization {
long
receiverId
=
chatLists
.
get
(
chatLists
.
size
()-
1
).
getReceiverId
();
String
content
=
chatLists
.
get
(
chatLists
.
size
()-
1
).
getContent
();
int
readFlag
=
chatLists
.
get
(
chatLists
.
size
()-
1
).
getReadFlag
();
Assert
.
assertEquals
(
senderId
,
far
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
),
network
.
message
(
param
,
BasicConfig
.
CHAT_LIST
,
"发送者sellerId错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
senderId
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
),
network
.
message
(
param
,
BasicConfig
.
CHAT_LIST
,
"发送者sellerId错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiverId
,
visitor1UserId
,
network
.
message
(
param
,
BasicConfig
.
CHAT_LIST
,
"接收者userId错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
content
,
"Hello"
,
network
.
message
(
param
,
BasicConfig
.
CHAT_LIST
,
"消息内容错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
readFlag
,
1
,
network
.
message
(
param
,
BasicConfig
.
CHAT_LIST
,
"消息已读状态错误"
,
response
.
body
().
asString
()));
...
...
@@ -851,14 +848,14 @@ public class MyCustomer implements Authorization {
long
receiverId
=
response
.
jsonPath
().
getLong
(
"data.list[0].receiverId"
);
String
content
=
response
.
jsonPath
().
getString
(
"data.list[0].content"
);
Assert
.
assertEquals
(
senderId
,
visitor1UserId
,
network
.
message
(
param
,
BasicConfig
.
CHAT_NEW
,
"发送者userID错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiverId
,
(
long
)
far
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
),
network
.
message
(
param
,
BasicConfig
.
CHAT_NEW
,
"接收者sellerId错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiverId
,
(
long
)
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
),
network
.
message
(
param
,
BasicConfig
.
CHAT_NEW
,
"接收者sellerId错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
content
,
"你好"
,
network
.
message
(
param
,
BasicConfig
.
CHAT_NEW
,
"消息内容错误"
,
response
.
body
().
asString
()));
}
// 留言_客户接收消息
@Test
(
description
=
"留言_客户接收消息"
,
priority
=
46
)
public
void
留言
_
客户接收消息
()
throws
IOException
{
String
scid
=
far
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
);
String
scid
=
ForwardAndRead
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR1_TKU
);
param
.
clear
();
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/MyForward.java
View file @
a55633c3
...
...
@@ -20,7 +20,6 @@ public class MyForward implements Authorization {
private
Response
response
;
private
Map
<
String
,
Object
>
param
;
private
String
visitorEncodeUserId
;
private
ForwardAndRead
far
;
@BeforeClass
public
void
setUp
()
throws
IOException
{
...
...
@@ -28,9 +27,8 @@ public class MyForward implements Authorization {
BaseUtils
.
ssoLogin
();
visitor2Tku
();
far
=
new
ForwardAndRead
();
// 关闭数据看板演示数据
far
.
closeDemoData
();
ForwardAndRead
.
closeDemoData
();
}
// 进入我的转发页面获取转发统计头部信息
...
...
@@ -169,7 +167,7 @@ public class MyForward implements Authorization {
@Test
(
description
=
"文章详情_头部信息"
,
priority
=
9
)
public
void
文章详情
_
头部信息
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"scid"
,
far
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
));
param
.
put
(
"scid"
,
ForwardAndRead
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
));
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_CONTENTHEADER
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
FORWARD_CONTENTHEADER
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
clueNum
=
response
.
jsonPath
().
getInt
(
"data.clueNum"
);
...
...
@@ -184,14 +182,14 @@ public class MyForward implements Authorization {
@Test
(
description
=
"文章详情_全部访客记录"
,
priority
=
10
)
public
void
文章详情
_
全部访客记录
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"scid"
,
far
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
));
param
.
put
(
"scid"
,
ForwardAndRead
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
));
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"type"
,
1
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
,
"接口请求失败"
,
response
.
body
().
asString
()));
String
visitorUserIdEncode
=
response
.
jsonPath
().
getString
(
"data.list[0].userId"
);
// 获取访客加密的userId
visitorEncodeUserId
=
far
.
encodeId
(
far
.
decodeTku
(
VISITOR1_TKU
).
get
(
"userId"
));
visitorEncodeUserId
=
ForwardAndRead
.
encodeId
(
ForwardAndRead
.
decodeTku
(
VISITOR1_TKU
).
get
(
"userId"
));
Assert
.
assertEquals
(
visitorUserIdEncode
,
visitorEncodeUserId
,
network
.
message
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
,
"转发素材访客记录中首条记录用户userId不正确"
,
response
.
body
().
asString
()));
}
...
...
@@ -199,7 +197,7 @@ public class MyForward implements Authorization {
@Test
(
description
=
"文章详情_访客记录_留下线索"
,
priority
=
11
)
public
void
文章详情
_
访客记录
_
留下线索
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"scid"
,
far
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
));
param
.
put
(
"scid"
,
ForwardAndRead
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
));
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"type"
,
2
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
);
...
...
@@ -215,7 +213,7 @@ public class MyForward implements Authorization {
@Test
(
description
=
"文章详情_访客记录_转发素材"
,
priority
=
12
)
public
void
文章详情
_
访客记录
_
转发素材
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"scid"
,
far
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
));
param
.
put
(
"scid"
,
ForwardAndRead
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
));
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"type"
,
3
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
);
...
...
@@ -231,7 +229,7 @@ public class MyForward implements Authorization {
@Test
(
description
=
"文章详情_访客记录_多度人脉"
,
priority
=
13
)
public
void
文章详情
_
访客记录
_
多度人脉
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"scid"
,
far
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
));
param
.
put
(
"scid"
,
ForwardAndRead
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
));
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"type"
,
4
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
);
...
...
@@ -244,7 +242,7 @@ public class MyForward implements Authorization {
@Test
(
description
=
"文章详情_访客记录_转发关系"
,
priority
=
14
)
public
void
文章详情
_
访客记录
_
转发关系
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"scid"
,
far
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
));
param
.
put
(
"scid"
,
ForwardAndRead
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
));
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
INVITATIONCHAIN
);
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
View file @
a55633c3
...
...
@@ -24,7 +24,6 @@ public class WhoSawMe implements Authorization {
private
Response
response
;
private
Map
<
String
,
Object
>
param
;
private
ForwardAndRead
far
;
private
Long
xxxSellerId
;
private
Long
childSellerId
;
private
Long
clueId
;
...
...
@@ -42,10 +41,9 @@ public class WhoSawMe implements Authorization {
visitor2Tku
();
BaseUtils
.
ssoLogin
();
far
=
new
ForwardAndRead
();
// 关闭数据看板演示数据
far
.
closeDemoData
();
xxrUserId
=
far
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
);
ForwardAndRead
.
closeDemoData
();
xxrUserId
=
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
);
}
// 进入谁看过我主页
...
...
@@ -69,7 +67,7 @@ public class WhoSawMe implements Authorization {
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
USER_INFO
,
"接口请求失败"
,
response
.
body
().
asString
()));
Long
userId
=
response
.
jsonPath
().
getLong
(
"data.userId"
);
Assert
.
assertEquals
(
userId
,
far
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"userId"
),
network
.
message
(
BasicConfig
.
USER_INFO
,
"代理人userId与预期不符"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
userId
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"userId"
),
network
.
message
(
BasicConfig
.
USER_INFO
,
"代理人userId与预期不符"
,
response
.
body
().
asString
()));
}
// 获取当前页面Tips
...
...
@@ -89,8 +87,8 @@ public class WhoSawMe implements Authorization {
@Test
(
description
=
"首页_查询使用版本"
,
priority
=
4
)
public
void
查询代理人当前使用版本
()
throws
IOException
{
param
.
clear
();
xxxSellerId
=
far
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
);
String
sellerIdEncode
=
far
.
encodeId
(
xxxSellerId
);
xxxSellerId
=
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
);
String
sellerIdEncode
=
ForwardAndRead
.
encodeId
(
xxxSellerId
);
param
.
put
(
"sellerId"
,
sellerIdEncode
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
USING_VERSION
);
String
userVersion
=
response
.
jsonPath
().
getString
(
"data.userVersion"
);
...
...
@@ -167,7 +165,7 @@ public class WhoSawMe implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"接口请求失败"
,
response
.
body
().
asString
()));
String
visitorWxName
=
response
.
jsonPath
().
getString
(
"data.list[0].nickName"
);
boolean
isNew
=
response
.
jsonPath
().
getBoolean
(
"data.list[1].isNew"
);
Assert
.
assertEquals
(
visitorWxName
,
far
.
getUserInfo
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"wxName"
),
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"最近访客微信昵称不匹配"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
visitorWxName
,
ForwardAndRead
.
getUserInfo
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"wxName"
),
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"最近访客微信昵称不匹配"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
isNew
,
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"新老客户身份判断错误"
,
response
.
body
().
asString
()));
clueId
=
response
.
jsonPath
().
getLong
(
"data.list[0].clueId"
);
...
...
@@ -176,9 +174,9 @@ public class WhoSawMe implements Authorization {
// 将新用户标记为老用户(小葡萄)
@Test
(
description
=
"标记新用户为老用户"
,
priority
=
12
)
public
void
标记新用户为老用户
()
throws
IOException
{
long
xptUserId
=
far
.
decodeTku
(
BaseUtils
.
tku
).
get
(
"userId"
);
long
xptUserId
=
ForwardAndRead
.
decodeTku
(
BaseUtils
.
tku
).
get
(
"userId"
);
param
.
clear
();
param
.
put
(
"userId"
,
far
.
encodeId
(
xptUserId
));
param
.
put
(
"userId"
,
ForwardAndRead
.
encodeId
(
xptUserId
));
response
=
network
.
getResponse
(
param
,
BasicConfig
.
UPDATENEWTOOLD
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
param
,
BasicConfig
.
UPDATENEWTOOLD
,
"用户身份更新失败"
,
response
.
body
().
asString
()));
...
...
@@ -279,7 +277,7 @@ public class WhoSawMe implements Authorization {
@Test
(
description
=
"运营周报_生成代理人头像二维码"
,
priority
=
21
)
public
void
运营周报
_
生成代理人头像二维码
()
throws
IOException
{
long
xxxUserId
=
far
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"userId"
);
long
xxxUserId
=
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"userId"
);
param
.
clear
();
param
.
put
(
"needAvatarCover"
,
true
);
param
.
put
(
"pageType"
,
1
);
...
...
@@ -368,7 +366,7 @@ public class WhoSawMe implements Authorization {
// 代理人加入团队
param
=
new
HashMap
<>();
param
.
put
(
"inviterSid"
,
far
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
));
param
.
put
(
"inviterSid"
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
));
param
.
put
(
"inviteType"
,
2
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_BOUND
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
...
...
@@ -381,13 +379,13 @@ public class WhoSawMe implements Authorization {
@Test
(
description
=
"查看被邀请代理人上级名称"
,
priority
=
26
)
public
void
查看上级名称
()
throws
IOException
{
// 获取被邀请代理人sellerId
childSellerId
=
far
.
decodeTku
(
BasicConfig
.
AGENT_TKU
).
get
(
"sellerId"
);
childSellerId
=
ForwardAndRead
.
decodeTku
(
BasicConfig
.
AGENT_TKU
).
get
(
"sellerId"
);
param
=
new
HashMap
<>();
param
.
put
(
"sellerId"
,
childSellerId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_BOSS
);
String
bossName
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_BOSS
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
bossName
,
far
.
getUserInfo
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"wxName"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_BOSS
,
"被邀请人上级名称与邀请人不一致"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
bossName
,
ForwardAndRead
.
getUserInfo
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"wxName"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_BOSS
,
"被邀请人上级名称与邀请人不一致"
,
response
.
body
().
asString
()));
}
// 获取代理人团队信息
...
...
@@ -428,8 +426,8 @@ public class WhoSawMe implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
TEAMRANKINGLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
List
<
RankingList
>
rankingLists
=
JsonUtil
.
parseResponseToPageBean
(
response
,
RankingList
.
class
);
List
<
String
>
memberSids
=
Lists
.
newArrayList
();
memberSids
.
add
(
far
.
encodeId
(
xxxSellerId
));
memberSids
.
add
(
far
.
encodeId
(
far
.
decodeTku
(
BasicConfig
.
AGENT_TKU
).
get
(
"sellerId"
)));
memberSids
.
add
(
ForwardAndRead
.
encodeId
(
xxxSellerId
));
memberSids
.
add
(
ForwardAndRead
.
encodeId
(
ForwardAndRead
.
decodeTku
(
BasicConfig
.
AGENT_TKU
).
get
(
"sellerId"
)));
Assert
.
assertTrue
(
rankingLists
.
size
()
>=
2
,
network
.
message
(
param
,
BasicConfig
.
TEAMRANKINGLIST
,
"排行榜人员数有误"
,
response
.
body
().
asString
()));
for
(
int
i
=
0
;
i
<
rankingLists
.
size
();
i
++){
boolean
isExist
=
memberSids
.
contains
(
rankingLists
.
get
(
i
).
getSellerId
());
...
...
@@ -451,21 +449,21 @@ public class WhoSawMe implements Authorization {
// 团队架构_搜索成员
@Test
(
description
=
"团队架构_搜索成员"
,
priority
=
31
)
public
void
团队架构
_
搜索成员
()
throws
IOException
{
jjSellerId
=
far
.
decodeTku
(
BasicConfig
.
AGENT_TKU
).
get
(
"sellerId"
);
jjSellerId
=
ForwardAndRead
.
decodeTku
(
BasicConfig
.
AGENT_TKU
).
get
(
"sellerId"
);
param
=
new
HashMap
<>();
param
.
put
(
"sellerName"
,
"吉吉"
);
param
.
put
(
"superiorSid"
,
String
.
valueOf
(
xxxSellerId
));
System
.
out
.
println
();
response
=
network
.
getResponse
(
param
,
BasicConfig
.
MEMBERSEARCH
);
String
sellerId
=
response
.
jsonPath
().
getString
(
"data[0].sellerId"
);
Assert
.
assertEquals
(
sellerId
,
far
.
encodeId
(
jjSellerId
),
network
.
message
(
param
,
BasicConfig
.
MEMBERSEARCH
,
"搜索结果错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
sellerId
,
ForwardAndRead
.
encodeId
(
jjSellerId
),
network
.
message
(
param
,
BasicConfig
.
MEMBERSEARCH
,
"搜索结果错误"
,
response
.
body
().
asString
()));
}
// 团队架构_删除团队成员
@Test
(
description
=
"团队架构_删除团队成员"
,
priority
=
100
)
public
void
团队架构
_
删除团队成员
()
throws
IOException
{
List
<
String
>
sids
=
new
ArrayList
<>();
sids
.
add
(
far
.
encodeId
(
childSellerId
));
sids
.
add
(
ForwardAndRead
.
encodeId
(
childSellerId
));
param
=
new
HashMap
<>();
param
.
put
(
"sids"
,
sids
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
MEMBERREMOVE
);
...
...
@@ -495,7 +493,7 @@ public class WhoSawMe implements Authorization {
@Test
(
description
=
"团队任务_新建任务_创建任务"
,
priority
=
33
)
public
void
团队任务
_
新建任务
_
创建任务
()
throws
IOException
{
// 获取选择素材的scId
String
scid
=
far
.
getContentScId
(
taskArticleContentId
);
String
scid
=
ForwardAndRead
.
getContentScId
(
taskArticleContentId
);
param
.
clear
();
param
.
put
(
"scid"
,
scid
);
...
...
@@ -513,7 +511,7 @@ public class WhoSawMe implements Authorization {
int
totalCount
=
response
.
jsonPath
().
getInt
(
"data.totalCount"
);
String
sellerId
=
response
.
jsonPath
().
getString
(
"data.list[0].sellerId"
);
Assert
.
assertEquals
(
totalCount
,
1
,
network
.
message
(
param
,
BasicConfig
.
TEAMMEMBER
,
"可推送成员数不正确"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
sellerId
,
far
.
encodeId
(
jjSellerId
),
network
.
message
(
param
,
BasicConfig
.
TEAMMEMBER
,
"可推送成员sellerId错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
sellerId
,
ForwardAndRead
.
encodeId
(
jjSellerId
),
network
.
message
(
param
,
BasicConfig
.
TEAMMEMBER
,
"可推送成员sellerId错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"团队任务_新建任务_获取任务详情"
,
priority
=
35
)
...
...
@@ -530,7 +528,7 @@ public class WhoSawMe implements Authorization {
@Test
(
description
=
"团队任务_推送任务"
,
priority
=
36
)
public
void
团队任务
_
推送任务
()
throws
IOException
{
List
<
String
>
sellerIds
=
new
ArrayList
<>();
sellerIds
.
add
(
far
.
encodeId
(
jjSellerId
));
sellerIds
.
add
(
ForwardAndRead
.
encodeId
(
jjSellerId
));
param
.
clear
();
param
.
put
(
"effectiveDuration"
,
7
);
// 任务有效期7天
param
.
put
(
"isAllMen"
,
false
);
...
...
@@ -628,7 +626,7 @@ public class WhoSawMe implements Authorization {
@Test
(
description
=
"接受任务_转发素材"
,
priority
=
43
)
public
void
接受任务
_
转发素材
()
throws
IOException
{
// 获取文章scid
String
scid
=
far
.
getContentScId
(
taskArticleContentId
);
String
scid
=
ForwardAndRead
.
getContentScId
(
taskArticleContentId
);
param
.
clear
();
param
.
put
(
"scId"
,
scid
);
param
.
put
(
"forwardType"
,
1
);
...
...
@@ -745,7 +743,7 @@ public class WhoSawMe implements Authorization {
@Test
(
description
=
"使用工具"
,
priority
=
49
)
public
void
使用工具
()
throws
IOException
{
// 生成抽奖转盘素材scId
String
lottery_scId
=
far
.
getContentScId
(
BasicConfig
.
LOTTERY_CONTENTID
);
String
lottery_scId
=
ForwardAndRead
.
getContentScId
(
BasicConfig
.
LOTTERY_CONTENTID
);
// 分享抽奖
param
=
new
HashMap
<>();
...
...
@@ -826,8 +824,8 @@ public class WhoSawMe implements Authorization {
Long
custUserId
=
response
.
jsonPath
().
getLong
(
"data.custUserId"
);
String
contentScid
=
response
.
jsonPath
().
getString
(
"data.fromContent.scid"
);
Assert
.
assertEquals
(
visitClueType
,
31
,
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索类型错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
custUserId
,
far
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
),
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索来源访客userId错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
contentScid
,
far
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
),
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索来源素材id错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
custUserId
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
),
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索来源访客userId错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
contentScid
,
ForwardAndRead
.
getContentScId
(
BasicConfig
.
ARTICLE_CONTENTID
),
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索来源素材id错误"
,
response
.
body
().
asString
()));
}
// 销售线索_跟进建议
...
...
@@ -859,7 +857,7 @@ public class WhoSawMe implements Authorization {
// 销售线索_获取访客管理信息
@Test
(
description
=
"销售线索_获取访客管理信息"
,
priority
=
57
)
public
void
销售线索
_
获取访客管理信息
()
throws
IOException
{
String
encodeUserId
=
far
.
encodeId
(
xxrUserId
);
String
encodeUserId
=
ForwardAndRead
.
encodeId
(
xxrUserId
);
param
=
new
HashMap
<>();
param
.
put
(
"userId"
,
encodeUserId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
GETCUSTAGANDMEMO
);
...
...
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