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
e94af801
Commit
e94af801
authored
Aug 03, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充客户阅读偏好及留言板内容
parent
16e37d73
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
250 additions
and
102 deletions
+250
-102
ForwardAndRead.java
...java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
+12
-4
MyCustomer.java
...est/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
+105
-17
WhoSawMe.java
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
+127
-81
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+6
-0
No files found.
src/test/java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
View file @
e94af801
...
@@ -21,7 +21,7 @@ public class ForwardAndRead implements Authorization {
...
@@ -21,7 +21,7 @@ public class ForwardAndRead implements Authorization {
private
Long
sellerId
;
private
Long
sellerId
;
private
String
visitId
;
private
String
visitId
;
private
String
insuranceId
;
private
String
insuranceId
;
private
Stri
ng
forwardTime
;
private
lo
ng
forwardTime
;
@BeforeClass
@BeforeClass
public
void
setUp
()
throws
IOException
{
public
void
setUp
()
throws
IOException
{
...
@@ -41,7 +41,7 @@ public class ForwardAndRead implements Authorization {
...
@@ -41,7 +41,7 @@ public class ForwardAndRead implements Authorization {
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
data
,
network
.
message
(
param
,
BasicConfig
.
FORWARD
,
"转发素材失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
param
,
BasicConfig
.
FORWARD
,
"转发素材失败"
,
response
.
body
().
asString
()));
forwardTime
=
response
.
jsonPath
().
get
Stri
ng
(
"timestamp"
);
forwardTime
=
response
.
jsonPath
().
get
Lo
ng
(
"timestamp"
);
}
}
@Test
(
description
=
"代理人转发名片"
,
priority
=
2
)
@Test
(
description
=
"代理人转发名片"
,
priority
=
2
)
...
@@ -122,7 +122,16 @@ public class ForwardAndRead implements Authorization {
...
@@ -122,7 +122,16 @@ public class ForwardAndRead implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CONTENT_READ
,
"接口调用失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CONTENT_READ
,
"接口调用失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"二度访客领取赠险"
,
priority
=
7
)
@Test
(
description
=
"添加访问记录"
,
priority
=
7
)
public
void
添加访问记录
()
throws
IOException
{
param
.
clear
();
param
.
put
(
"forwardTime"
,
forwardTime
+
5000
);
param
.
put
(
"scid"
,
articleScId
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
DYNAMIC_ADDVISIT
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
DYNAMIC_ADDVISIT
,
"添加访问记录失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"二度访客领取赠险"
,
priority
=
8
)
public
void
二度访客领取赠险
()
throws
IOException
{
public
void
二度访客领取赠险
()
throws
IOException
{
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"clueTypeName"
,
"WELFARE_INSURANCE"
);
param
.
put
(
"clueTypeName"
,
"WELFARE_INSURANCE"
);
...
@@ -135,7 +144,6 @@ public class ForwardAndRead implements Authorization {
...
@@ -135,7 +144,6 @@ public class ForwardAndRead implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"接口调用失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"接口调用失败"
,
response
.
body
().
asString
()));
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
data
,
"success"
,
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"领取赠险失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
data
,
"success"
,
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"领取赠险失败"
,
response
.
body
().
asString
()));
}
}
// 通过素材contentId获取线索员文章scId
// 通过素材contentId获取线索员文章scId
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
View file @
e94af801
...
@@ -26,6 +26,7 @@ public class MyCustomer implements Authorization {
...
@@ -26,6 +26,7 @@ public class MyCustomer implements Authorization {
private
String
sessionId
;
private
String
sessionId
;
private
int
visitCount
;
private
int
visitCount
;
private
String
id
;
// 自定义提醒事项id
private
String
id
;
// 自定义提醒事项id
private
long
lastMessageId
;
@BeforeClass
@BeforeClass
public
void
setUp
()
throws
IOException
{
public
void
setUp
()
throws
IOException
{
...
@@ -47,12 +48,12 @@ public class MyCustomer implements Authorization {
...
@@ -47,12 +48,12 @@ public class MyCustomer implements Authorization {
}
}
// 我的客户首页_查询未读信息
// 我的客户首页_查询未读信息
@Test
(
description
=
"首页_查询未读信息"
,
priority
=
2
)
@Test
(
description
=
"首页_查询未读信息"
,
priority
=
49
)
public
void
首页
_
查询未读信息
()
throws
IOException
{
public
void
首页
_
查询未读信息
()
throws
IOException
{
response
=
network
.
getResponse
(
BasicConfig
.
SELLERUNREADMESSAGE
);
response
=
network
.
getResponse
(
BasicConfig
.
SELLERUNREADMESSAGE
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
SELLERUNREADMESSAGE
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
SELLERUNREADMESSAGE
,
"接口请求失败"
,
response
.
body
().
asString
()));
Object
unreadCount
=
response
.
jsonPath
().
getJsonObjec
t
(
"data.unreadCount"
);
int
unreadCount
=
response
.
jsonPath
().
getIn
t
(
"data.unreadCount"
);
Assert
.
assert
NotNull
(
unreadCount
,
network
.
message
(
BasicConfig
.
SELLERUNREADMESSAGE
,
"获取未读消息数失败
"
,
response
.
body
().
asString
()));
Assert
.
assert
Equals
(
unreadCount
,
1
,
network
.
message
(
param
,
BasicConfig
.
SELLERUNREADMESSAGE
,
"代理人未读消息数有误
"
,
response
.
body
().
asString
()));
}
}
// 消息通知页_对话记录
// 消息通知页_对话记录
...
@@ -66,7 +67,7 @@ public class MyCustomer implements Authorization {
...
@@ -66,7 +67,7 @@ public class MyCustomer implements Authorization {
String
sessionIds
=
(
String
)
linkLists
.
get
(
0
).
getSession
().
get
(
"sessionId"
);
String
sessionIds
=
(
String
)
linkLists
.
get
(
0
).
getSession
().
get
(
"sessionId"
);
String
lastContent
=
(
String
)
linkLists
.
get
(
0
).
getSession
().
get
(
"lastContent"
);
String
lastContent
=
(
String
)
linkLists
.
get
(
0
).
getSession
().
get
(
"lastContent"
);
Assert
.
assertEquals
(
sessionIds
,
sessionId
,
network
.
message
(
param
,
BasicConfig
.
CHAT_LINKMANLIST
,
"对话记录sessionId有误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
sessionIds
,
sessionId
,
network
.
message
(
param
,
BasicConfig
.
CHAT_LINKMANLIST
,
"对话记录sessionId有误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
lastContent
,
"
Hello
"
,
network
.
message
(
param
,
BasicConfig
.
CHAT_LINKMANLIST
,
"对话记录最后一条内容错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
lastContent
,
"
你好
"
,
network
.
message
(
param
,
BasicConfig
.
CHAT_LINKMANLIST
,
"对话记录最后一条内容错误"
,
response
.
body
().
asString
()));
}
}
// 标签管理页_新建标签
// 标签管理页_新建标签
...
@@ -280,7 +281,6 @@ public class MyCustomer implements Authorization {
...
@@ -280,7 +281,6 @@ public class MyCustomer implements Authorization {
param
.
put
(
"sortType"
,
3
);
param
.
put
(
"sortType"
,
3
);
param
.
put
(
"tagIds"
,
tagIds
);
param
.
put
(
"tagIds"
,
tagIds
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CUSTOMERSEARCH
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CUSTOMERSEARCH
);
System
.
out
.
println
(
response
.
body
().
asString
());
long
userId
=
response
.
jsonPath
().
getLong
(
"data.list[0].userId"
);
long
userId
=
response
.
jsonPath
().
getLong
(
"data.list[0].userId"
);
Assert
.
assertEquals
(
userId
,
visitor1UserId
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"筛选结果与预期不符"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
userId
,
visitor1UserId
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"筛选结果与预期不符"
,
response
.
body
().
asString
()));
}
}
...
@@ -384,7 +384,8 @@ public class MyCustomer implements Authorization {
...
@@ -384,7 +384,8 @@ public class MyCustomer implements Authorization {
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1UserId
);
param
.
put
(
"custUserId"
,
visitor1UserId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTREADPERFERENCE
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTREADPERFERENCE
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTREADPERFERENCE
,
"接口请求失败"
,
response
.
body
().
asString
()));
List
<
Object
>
readPerferences
=
response
.
jsonPath
().
getList
(
"data"
);
Assert
.
assertTrue
(
readPerferences
.
size
()
>
0
,
network
.
message
(
param
,
BasicConfig
.
CUSTREADPERFERENCE
,
"客户无阅读偏好"
,
response
.
body
().
asString
()));
}
}
// 客户详情页_来访记录
// 客户详情页_来访记录
...
@@ -762,8 +763,29 @@ public class MyCustomer implements Authorization {
...
@@ -762,8 +763,29 @@ public class MyCustomer implements Authorization {
Assert
.
assertFalse
(
data
,
network
.
message
(
param
,
BasicConfig
.
NEWFUNC_FIRSTVISIT
,
"判断错误,用户非首次访问"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
data
,
network
.
message
(
param
,
BasicConfig
.
NEWFUNC_FIRSTVISIT
,
"判断错误,用户非首次访问"
,
response
.
body
().
asString
()));
}
}
//客户详情页_留言_历史信息
@Test
(
description
=
"客户详情页_留言_历史信息"
,
priority
=
43
)
public
void
客户详情页
_
留言
_
历史信息
()
throws
IOException
{
param
.
clear
();
param
.
put
(
"role"
,
1
);
param
.
put
(
"sessionId"
,
sessionId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CHAT_COUNTHISTORY
);
int
data
=
response
.
jsonPath
().
getInt
(
"data"
);
Assert
.
assertTrue
(
data
>
1
,
network
.
message
(
param
,
BasicConfig
.
CHAT_COUNTHISTORY
,
"历史消息总数小于1"
,
response
.
body
().
asString
()));
}
// 客户详情页_留言_留言对象是否关注公众号
@Test
(
description
=
"客户详情页_留言_留言对象是否关注公众号"
,
priority
=
44
)
public
void
客户详情页
_
留言
_
留言对象是否关注公众号
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"targetSid"
,
far
.
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
()));
}
// 客户详情页_留言_发送消息
// 客户详情页_留言_发送消息
@Test
(
description
=
"客户详情页_留言_发送消息"
,
priority
=
4
3
)
@Test
(
description
=
"客户详情页_留言_发送消息"
,
priority
=
4
5
)
public
void
客户详情页
_
留言
_
发送消息
()
throws
IOException
{
public
void
客户详情页
_
留言
_
发送消息
()
throws
IOException
{
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"content"
,
"Hello"
);
param
.
put
(
"content"
,
"Hello"
);
...
@@ -774,7 +796,7 @@ public class MyCustomer implements Authorization {
...
@@ -774,7 +796,7 @@ public class MyCustomer implements Authorization {
}
}
// 客户详情页_留言_聊天内容
// 客户详情页_留言_聊天内容
@Test
(
description
=
"客户详情页_留言_聊天内容"
,
priority
=
4
4
)
@Test
(
description
=
"客户详情页_留言_聊天内容"
,
priority
=
4
8
)
public
void
客户详情页
_
留言
_
聊天内容
()
throws
IOException
{
public
void
客户详情页
_
留言
_
聊天内容
()
throws
IOException
{
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"pageSize"
,
30
);
param
.
put
(
"pageSize"
,
30
);
...
@@ -787,22 +809,88 @@ public class MyCustomer implements Authorization {
...
@@ -787,22 +809,88 @@ public class MyCustomer implements Authorization {
Long
senderId
=
chatLists
.
get
(
chatLists
.
size
()-
1
).
getSenderId
();
Long
senderId
=
chatLists
.
get
(
chatLists
.
size
()-
1
).
getSenderId
();
long
receiverId
=
chatLists
.
get
(
chatLists
.
size
()-
1
).
getReceiverId
();
long
receiverId
=
chatLists
.
get
(
chatLists
.
size
()-
1
).
getReceiverId
();
String
content
=
chatLists
.
get
(
chatLists
.
size
()-
1
).
getContent
();
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
,
far
.
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
(
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
(
content
,
"Hello"
,
network
.
message
(
param
,
BasicConfig
.
CHAT_LIST
,
"消息内容错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
readFlag
,
1
,
network
.
message
(
param
,
BasicConfig
.
CHAT_LIST
,
"消息已读状态错误"
,
response
.
body
().
asString
()));
}
else
{
}
else
{
Assert
.
assertTrue
(
true
,
network
.
message
(
param
,
BasicConfig
.
CHAT_LIST
,
"聊天记录为空"
,
response
.
body
().
asString
()));
Assert
.
fail
(
network
.
message
(
param
,
BasicConfig
.
CHAT_LIST
,
"聊天记录为空"
,
response
.
body
().
asString
()));
}
}
}
}
// 客户详情页_留言_留言对象是否关注公众号
// 客户详情页_留言_最新信息
@Test
(
description
=
"客户详情页_留言_留言对象是否关注公众号"
,
priority
=
45
)
@Test
(
description
=
"客户详情页_留言_最新信息"
,
priority
=
50
)
public
void
客户详情页
_
留言
_
留言对象是否关注公众号
()
throws
IOException
{
public
void
客户详情页
_
留言
_
最新信息
()
throws
IOException
{
param
=
new
HashMap
<>();
// 获取当前时间戳
param
.
put
(
"targetSid"
,
far
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
));
Date
current
=
new
Date
();
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CHAT_GETSUBSCRIBESTATUS
);
long
timestamp
=
current
.
getTime
();
int
subscribe
=
response
.
jsonPath
().
getInt
(
"data.subscribe"
);
param
.
clear
();
Assert
.
assertEquals
(
subscribe
,
1
,
network
.
message
(
param
,
BasicConfig
.
CHAT_GETSUBSCRIBESTATUS
,
"判断用户是否关注公众号失败"
,
response
.
body
().
asString
()));
param
.
put
(
"role"
,
1
);
param
.
put
(
"sessionId"
,
sessionId
);
param
.
put
(
"lastId"
,
lastMessageId
);
param
.
put
(
"timestamp"
,
timestamp
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CHAT_NEW
);
long
senderId
=
response
.
jsonPath
().
getLong
(
"data.list[0].senderId"
);
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
(
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
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR1_TKU
);
param
.
clear
();
param
.
put
(
"scid"
,
scid
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CHECKUNREAD
);
int
unreadCount
=
response
.
jsonPath
().
getInt
(
"data.unreadCount"
);
String
sessionIds
=
response
.
jsonPath
().
getString
(
"data.seller.sessionId"
);
Assert
.
assertEquals
(
unreadCount
,
1
,
network
.
message
(
param
,
BasicConfig
.
CHECKUNREAD
,
"未读消息数错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
sessionIds
,
sessionId
,
network
.
message
(
param
,
BasicConfig
.
CHECKUNREAD
,
"对话sessionId不符"
,
response
.
body
().
asString
()));
}
// 留言_客户阅读消息
@Test
(
description
=
"留言_客户阅读消息"
,
priority
=
47
)
public
void
留言
_
客户阅读消息
()
throws
IOException
{
// 客户获取最后一条聊天记录ID
param
.
clear
();
param
.
put
(
"pageSize"
,
30
);
param
.
put
(
"isPushMessage"
,
true
);
param
.
put
(
"role"
,
2
);
param
.
put
(
"sessionId"
,
sessionId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CHAT_LIST
);
List
<
ChatList
>
chatLists
=
JsonUtil
.
parseResponseToPageBean
(
response
,
ChatList
.
class
);
lastMessageId
=
chatLists
.
get
(
chatLists
.
size
()-
1
).
getId
();
param
.
clear
();
param
.
put
(
"role"
,
2
);
param
.
put
(
"sessionId"
,
sessionId
);
param
.
put
(
"lastId"
,
lastMessageId
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CHAT_READED
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"OK"
,
network
.
message
(
param
,
BasicConfig
.
CHAT_READED
,
"访客阅读消息失败"
,
response
.
body
().
asString
()));
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR2_TKU
);
}
// 留言_客户回复消息
@Test
(
description
=
"留言_客户回复消息"
,
priority
=
49
)
public
void
留言
_
客户回复消息
()
throws
IOException
{
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR1_TKU
);
param
.
clear
();
param
.
put
(
"content"
,
"你好"
);
param
.
put
(
"role"
,
"2"
);
param
.
put
(
"sessionId"
,
sessionId
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CHAT_SEND
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"OK"
,
network
.
message
(
param
,
BasicConfig
.
CHAT_SEND
,
"消息发送失败"
,
response
.
body
().
asString
()));
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR2_TKU
);
}
}
// 还原用户信息
// 还原用户信息
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
View file @
e94af801
package
com
.
kjj
.
cases
.
assistant
.
whoSawMe
;
package
com
.
kjj
.
cases
.
assistant
.
whoSawMe
;
import
com.beust.jcommander.internal.Lists
;
import
com.beust.jcommander.internal.Lists
;
import
com.kjj.bean.whoSawMe.ArticlePage
;
import
com.kjj.bean.whoSawMe.RankingList
;
import
com.kjj.bean.whoSawMe.RankingList
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.config.BasicConfig
;
...
@@ -31,6 +30,7 @@ public class WhoSawMe implements Authorization {
...
@@ -31,6 +30,7 @@ public class WhoSawMe implements Authorization {
private
String
tagId0
;
private
String
tagId0
;
private
String
contentId
;
private
String
contentId
;
private
Integer
taskId
;
private
Integer
taskId
;
private
String
taskContentId
;
// 团队任务转发的素材contentId
@BeforeClass
@BeforeClass
public
void
setUp
()
throws
IOException
{
public
void
setUp
()
throws
IOException
{
...
@@ -342,86 +342,132 @@ public class WhoSawMe implements Authorization {
...
@@ -342,86 +342,132 @@ public class WhoSawMe implements Authorization {
Assert
.
assertFalse
(
hasSuperior
,
network
.
message
(
param
,
BasicConfig
.
BOSS_ROLE
,
"成员仍有上级"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
hasSuperior
,
network
.
message
(
param
,
BasicConfig
.
BOSS_ROLE
,
"成员仍有上级"
,
response
.
body
().
asString
()));
}
}
// 团队任务
// // 团队任务
// 新建任务_选择素材
// // 新建任务_选择素材
@Test
(
description
=
"新建任务_选择素材"
,
priority
=
23
)
// @Test(description = "新建任务_选择素材", priority = 23)
public
void
新建任务
_
选择素材
()
throws
IOException
{
// public void 新建任务_选择素材() throws IOException{
param
=
new
HashMap
<>();
// param = new HashMap<>();
param
.
put
(
"contentType"
,
"article"
);
// param.put("contentType", "article");
param
.
put
(
"pageIndex"
,
1
);
// param.put("pageIndex", 1);
param
.
put
(
"pageSize"
,
20
);
// param.put("pageSize", 20);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FINDPAGEBYCONTENTTYPE
);
// response = network.getResponse(param, BasicConfig.FINDPAGEBYCONTENTTYPE);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
FINDPAGEBYCONTENTTYPE
,
"接口请求失败"
,
response
.
body
().
asString
()));
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.FINDPAGEBYCONTENTTYPE, "接口请求失败", response.body().asString()));
List
<
ArticlePage
>
articlePages
=
JsonUtil
.
parseResponseToPageBean
(
response
,
ArticlePage
.
class
);
// List<ArticlePage> articlePages = JsonUtil.parseResponseToPageBean(response, ArticlePage.class);
for
(
int
i
=
0
;
i
<
articlePages
.
size
();
i
++){
// for(int i = 0; i < articlePages.size(); i++){
String
contentType
=
articlePages
.
get
(
i
).
getContentType
();
// String contentType = articlePages.get(i).getContentType();
Assert
.
assertEquals
(
contentType
,
"article"
,
network
.
message
(
param
,
BasicConfig
.
FINDPAGEBYCONTENTTYPE
,
"素材类型错误"
,
response
.
body
().
asString
()));
// Assert.assertEquals(contentType, "article", network.message(param, BasicConfig.FINDPAGEBYCONTENTTYPE, "素材类型错误", response.body().asString()));
}
// }
//
contentId
=
articlePages
.
get
(
0
).
getContentId
();
// contentId = articlePages.get(0).getContentId();
}
// }
//
// 新建任务_创建任务
// // 新建任务_创建任务
@Test
(
description
=
"新建任务_创建任务"
,
priority
=
24
)
// @Test(description = "新建任务_创建任务", priority = 24)
public
void
新建任务
_
创建任务
()
throws
IOException
{
// public void 新建任务_创建任务() throws IOException{
String
scid
=
far
.
getContentScId
(
contentId
);
// String scid = far.getContentScId(contentId);
param
=
new
HashMap
<>();
// param = new HashMap<>();
param
.
put
(
"scid"
,
scid
);
// param.put("scid", scid);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
BOSS_CREATE
);
// response = network.postResponse(param, BasicConfig.BOSS_CREATE);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_CREATE
,
"接口请求失败"
,
response
.
body
().
asString
()));
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_CREATE, "接口请求失败", response.body().asString()));
taskId
=
response
.
jsonPath
().
getInt
(
"data"
);
// taskId = response.jsonPath().getInt("data");
Assert
.
assertNotNull
(
taskId
,
network
.
message
(
param
,
BasicConfig
.
BOSS_CREATE
,
"返回taskId为空"
,
response
.
body
().
asString
()));
// Assert.assertNotNull(taskId, network.message(param, BasicConfig.BOSS_CREATE, "返回taskId为空", response.body().asString()));
}
// }
//
// 新建任务_任务详情
// // 新建任务_任务详情
@Test
(
description
=
"新建任务_任务详情"
,
priority
=
25
)
// @Test(description = "新建任务_任务详情", priority = 25)
public
void
新建任务
_
任务详情
()
throws
IOException
{
// public void 新建任务_任务详情() throws IOException{
param
=
new
HashMap
<>();
// param = new HashMap<>();
param
.
put
(
"taskId"
,
taskId
);
// param.put("taskId", taskId);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_DETAIL
);
// response = network.getResponse(param, BasicConfig.BOSS_DETAIL);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_DETAIL
,
"接口请求失败"
,
response
.
body
().
asString
()));
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_DETAIL, "接口请求失败", response.body().asString()));
}
// }
//
// 新建任务_可推送成员
// // 新建任务_可推送成员
@Test
(
description
=
"新建任务_可推送成员"
,
priority
=
26
)
// @Test(description = "新建任务_可推送成员", priority = 26)
public
void
新建任务
_
可推送成员
()
throws
IOException
{
// public void 新建任务_可推送成员() throws IOException{
param
=
new
HashMap
<>();
// param = new HashMap<>();
param
.
put
(
"pageIndex"
,
1
);
// param.put("pageIndex", 1);
param
.
put
(
"pageSize"
,
20
);
// param.put("pageSize", 20);
param
.
put
(
"sellerId"
,
xxxSellerId
);
// param.put("sellerId", xxxSellerId);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
TEAMMEMBER
);
// response = network.getResponse(param, BasicConfig.TEAMMEMBER);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
TEAMMEMBER
,
"接口请求失败"
,
response
.
body
().
asString
()));
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMMEMBER, "接口请求失败", response.body().asString()));
int
totalCount
=
response
.
jsonPath
().
getInt
(
"data.totalCount"
);
// int totalCount = response.jsonPath().getInt("data.totalCount");
String
sellerId
=
response
.
jsonPath
().
getString
(
"data.list["
+(
totalCount
-
1
)+
"].sellerId"
);
// String sellerId = response.jsonPath().getString("data.list["+(totalCount-1)+"].sellerId");
Assert
.
assertEquals
(
totalCount
,
1
,
network
.
message
(
param
,
BasicConfig
.
TEAMMEMBER
,
"可推送成员数有误"
,
response
.
body
().
asString
()));
// 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, far.encodeId(jjSellerId), network.message(param, BasicConfig.TEAMMEMBER, "可推送成员sellerId有误", response.body().asString()));
}
// }
//
// 新建任务_推送任务
// // 新建任务_推送任务
@Test
(
description
=
"新建任务_推送任务"
,
priority
=
27
)
// @Test(description = "新建任务_推送任务", priority = 27)
public
void
新建任务
_
推送任务
()
throws
IOException
{
// public void 新建任务_推送任务() throws IOException{
List
<
String
>
sellerIds
=
Lists
.
newArrayList
();
// List<String> sellerIds = Lists.newArrayList();
List
<
String
>
superiorIds
=
Lists
.
newArrayList
();
// List<String> superiorIds = Lists.newArrayList();
sellerIds
.
add
(
far
.
encodeId
(
jjSellerId
));
// sellerIds.add(far.encodeId(jjSellerId));
param
=
new
HashMap
<>();
// param = new HashMap<>();
param
.
put
(
"effectiveDuration"
,
7
);
// param.put("effectiveDuration", 7);
param
.
put
(
"isAllMen"
,
true
);
// param.put("isAllMen", true);
param
.
put
(
"sellerIds"
,
sellerIds
);
// param.put("sellerIds", sellerIds);
param
.
put
(
"superiorIds"
,
superiorIds
);
// param.put("superiorIds", superiorIds);
param
.
put
(
"taskId"
,
taskId
);
// param.put("taskId", taskId);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
BOSS_PUBLISH
);
// response = network.postResponse(param, BasicConfig.BOSS_PUBLISH);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_PUBLISH
,
"接口请求失败"
,
response
.
body
().
asString
()));
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.BOSS_PUBLISH, "接口请求失败", response.body().asString()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_PUBLISH
,
"推送任务失败"
,
response
.
body
().
asString
()));
// Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.BOSS_PUBLISH, "推送任务失败", response.body().asString()));
}
// }
//
// 新建任务_查看任务
// // 新建任务_查看任务
@Test
(
description
=
"新建任务_查看任务"
,
priority
=
28
)
// @Test(description = "新建任务_查看任务", priority = 28)
public
void
新建任务
_
查看任务
()
throws
IOException
{
// public void 新建任务_查看任务() throws IOException{
param
=
new
HashMap
<>();
// param = new HashMap<>();
param
.
put
(
"pageSize"
,
20
);
// param.put("pageSize", 20);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_TEAMTASKLIST
);
// response = network.getResponse(param, BasicConfig.BOSS_TEAMTASKLIST);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_TEAMTASKLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
// int taskStatus = response.jsonPath().getInt("data.list[0].taskStatus");
}
// Assert.assertEquals(taskStatus, 1, network.message(param, BasicConfig.BOSS_TEAMTASKLIST, "任务状态错误", response.body().asString()));
// }
//
// // 个人中心_下级_新任务提醒
// @Test(description = "个人中心_下级_新任务提醒", priority = 29)
// public void 个人中心_下级_新任务提醒() throws IOException{
// // 切换到下级(吉吉)
// network.agentCookies.put("tku", BasicConfig.AGENT_TKU);
//
// response = network.getResponse(BasicConfig.HASNEWTASK);
// boolean data =response.jsonPath().getBoolean("data");
// Assert.assertTrue(data, network.message(BasicConfig.HASNEWTASK,"查询结果为无新任务", response.body().asString()));
// }
//
// // 个人中心_下级_我的任务首部
// @Test(description = "个人中心_下级_我的任务首部", priority = 30)
// public void 个人中心_下级_我的任务首部() throws IOException{
// response = network.getResponse(BasicConfig.MYTASKHEADER);
// int incompleteTaskNum = response.jsonPath().getInt("data.incompleteTaskNum");
// Assert.assertEquals(incompleteTaskNum, 1, network.message(BasicConfig.MYTASKHEADER, "我的未完成任务数量有误", response.body().asString()));
// }
//
// // 个人中心_下级_我的任务列表_未完成任务
// @Test(description = "我的任务列表_未完成任务", priority = 31)
// public void 我的任务列表_未完成任务() throws IOException{
// param.clear();
// param.put("pageSize", 20);
// param.put("type", 1);
// response = network.getResponse(param, BasicConfig.MYTASKLIST);
// Integer myTaskId = response.jsonPath().getInt("data.list[0].taskId");
// int myTaskStatus = response.jsonPath().getInt("data.list[0].taskStatus");
// taskContentId = response.jsonPath().getString("data.list[0].contentId");
// Assert.assertEquals(myTaskId, taskId, network.message(param, BasicConfig.MYTASKLIST, "未完成任务ID与创建时任务ID不符", response.body().asString()));
// Assert.assertEquals(myTaskStatus, 1, network.message(param, BasicConfig.MYTASKLIST, "任务完成状态错误", response.body().asString()));
// }
//
// // 个人中心_下级_完成任务
// @Test(description = "下级_完成任务", priority = 32)
// public void 下级_完成任务() throws IOException{
// // 生成下级的文章scid
// String scid = far.getContentScId(taskContentId);
// param.clear();
// param.put("scId", scid);
// param.put("forwardType", 1);
// response = network.getResponse(param, BasicConfig.FORWARD);
// Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.FORWARD, "转发文章失败", response.body().asString()));
// }
// 查看今日转发素材列表
// 查看今日转发素材列表
@Test
(
description
=
"查看今日转发素材列表"
,
priority
=
29
)
@Test
(
description
=
"查看今日转发素材列表"
,
priority
=
29
)
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
e94af801
...
@@ -761,6 +761,9 @@ public class BasicConfig {
...
@@ -761,6 +761,9 @@ public class BasicConfig {
public
static
final
String
CHAT_LIST
=
HOST
+
"/kjy/mp/chat/list"
;
public
static
final
String
CHAT_LIST
=
HOST
+
"/kjy/mp/chat/list"
;
public
static
final
String
CHAT_GETSUBSCRIBESTATUS
=
HOST
+
"/kjy/mp/chat/getSubscribeStatus"
;
public
static
final
String
CHAT_GETSUBSCRIBESTATUS
=
HOST
+
"/kjy/mp/chat/getSubscribeStatus"
;
public
static
final
String
CHAT_LINKMANLIST
=
HOST
+
"/kjy/mp/chat/sellerLinkmanList"
;
public
static
final
String
CHAT_LINKMANLIST
=
HOST
+
"/kjy/mp/chat/sellerLinkmanList"
;
public
static
final
String
CHAT_COUNTHISTORY
=
HOST
+
"/kjy/mp/chat/countHistory"
;
public
static
final
String
CHAT_READED
=
HOST
+
"/kjy/mp/chat/readed"
;
public
static
final
String
CHAT_NEW
=
HOST
+
"/kjy/mp/chat/new"
;
// *************** 文章 ***************
// *************** 文章 ***************
...
@@ -845,6 +848,9 @@ public class BasicConfig {
...
@@ -845,6 +848,9 @@ public class BasicConfig {
public
static
final
String
TEAMDATA
=
HOST
+
"/kjy/mp/seller/team/data"
;
public
static
final
String
TEAMDATA
=
HOST
+
"/kjy/mp/seller/team/data"
;
public
static
final
String
TEAMMEMBERNUM
=
HOST
+
"/kjy/mp/seller/team/memberNumber"
;
public
static
final
String
TEAMMEMBERNUM
=
HOST
+
"/kjy/mp/seller/team/memberNumber"
;
public
static
final
String
TEAMRANKINGLIST
=
HOST
+
"/kjy/mp/seller/team/rankingList"
;
public
static
final
String
TEAMRANKINGLIST
=
HOST
+
"/kjy/mp/seller/team/rankingList"
;
public
static
final
String
HASNEWTASK
=
HOST
+
"/kjy/mp/seller/team/task/hasNewTask"
;
public
static
final
String
MYTASKHEADER
=
HOST
+
"/kjy/mp/seller/team/task/myTaskHeader"
;
public
static
final
String
MYTASKLIST
=
HOST
+
"/kjy/mp/seller/team/task/myTaskList"
;
// 团队管理
// 团队管理
public
static
final
String
FINDPAGEBYCONTENTTYPE
=
HOST
+
"/kjy/mp/exclusiveItem/findPageByContentType"
;
public
static
final
String
FINDPAGEBYCONTENTTYPE
=
HOST
+
"/kjy/mp/exclusiveItem/findPageByContentType"
;
public
static
final
String
TEAMMEMBER
=
HOST
+
"/kjy/mp/seller/team/member"
;
public
static
final
String
TEAMMEMBER
=
HOST
+
"/kjy/mp/seller/team/member"
;
...
...
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