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
b36e4c69
Commit
b36e4c69
authored
Sep 03, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复集客助手tku失效
parent
fd36db19
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
26 deletions
+29
-26
Authorization.java
src/test/java/com/kjj/cases/admin/Authorization.java
+2
-2
ForwardAndRead.java
...java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
+4
-2
MyCustomer.java
...est/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
+6
-6
WhoSawMe.java
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
+15
-14
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+2
-2
No files found.
src/test/java/com/kjj/cases/admin/Authorization.java
View file @
b36e4c69
...
...
@@ -32,8 +32,8 @@ public interface Authorization {
//代理人
default
void
visitor2Tku
()
{
network
.
agentCookies
.
put
(
"tku"
,
VISITOR
2_TKU
);
System
.
out
.
println
(
"代理人tku:"
+
VISITOR
2_TKU
);
network
.
agentCookies
.
put
(
"tku"
,
AGENT
2_TKU
);
System
.
out
.
println
(
"代理人tku:"
+
AGENT
2_TKU
);
}
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
View file @
b36e4c69
...
...
@@ -86,7 +86,7 @@ public class ForwardAndRead implements Authorization {
// 访客访问素材及产生线索
@Test
(
description
=
"访客阅读文章"
,
priority
=
4
)
public
void
访客阅读文章
()
throws
IOException
{
sellerId
=
decodeTku
(
BasicConfig
.
VISITOR
2_TKU
).
get
(
"sellerId"
);
sellerId
=
decodeTku
(
BasicConfig
.
AGENT
2_TKU
).
get
(
"sellerId"
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
AGENT_TKU
);
param
=
new
HashMap
<>();
param
.
put
(
"scid"
,
articleScId
);
...
...
@@ -265,10 +265,12 @@ public class ForwardAndRead implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
USER_INFO
,
"接口调用失败"
,
response
.
body
().
asString
()));
String
avatar
=
response
.
jsonPath
().
getString
(
"data.avatar"
);
String
wxName
=
response
.
jsonPath
().
getString
(
"data.wxName"
);
String
sellerName
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
Map
<
String
,
String
>
infos
=
new
HashMap
<>();
infos
.
put
(
"avatar"
,
avatar
);
infos
.
put
(
"wxName"
,
wxName
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR2_TKU
);
infos
.
put
(
"sellerName"
,
sellerName
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
AGENT2_TKU
);
return
infos
;
}
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
View file @
b36e4c69
...
...
@@ -302,7 +302,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
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR
2_TKU
).
get
(
"sellerId"
),
network
.
message
(
param
,
BasicConfig
.
CUSTINFO
,
"访客所属销售员sellerId不符"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
sellerId
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
AGENT
2_TKU
).
get
(
"sellerId"
),
network
.
message
(
param
,
BasicConfig
.
CUSTINFO
,
"访客所属销售员sellerId不符"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
sessionId
,
network
.
message
(
param
,
BasicConfig
.
CUSTINFO
,
"访客sessionId为空"
,
response
.
body
().
asString
()));
}
...
...
@@ -795,7 +795,7 @@ public class MyCustomer implements Authorization {
@Test
(
description
=
"客户详情页_留言_留言对象是否关注公众号"
,
priority
=
44
)
public
void
客户详情页
_
留言
_
留言对象是否关注公众号
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"targetSid"
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR
2_TKU
).
get
(
"sellerId"
));
param
.
put
(
"targetSid"
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
AGENT
2_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
()));
...
...
@@ -827,7 +827,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
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR
2_TKU
).
get
(
"sellerId"
),
network
.
message
(
param
,
BasicConfig
.
CHAT_LIST
,
"发送者sellerId错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
senderId
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
AGENT
2_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
()));
...
...
@@ -852,7 +852,7 @@ 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
)
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR
2_TKU
).
get
(
"sellerId"
),
network
.
message
(
param
,
BasicConfig
.
CHAT_NEW
,
"接收者sellerId错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
receiverId
,
(
long
)
ForwardAndRead
.
decodeTku
(
BasicConfig
.
AGENT
2_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
()));
}
...
...
@@ -892,7 +892,7 @@ public class MyCustomer implements Authorization {
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
.
VISITOR
2_TKU
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
AGENT
2_TKU
);
}
// 留言_客户回复消息
...
...
@@ -907,7 +907,7 @@ public class MyCustomer implements Authorization {
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
.
VISITOR
2_TKU
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
AGENT
2_TKU
);
}
// 还原用户信息
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
View file @
b36e4c69
...
...
@@ -5,11 +5,11 @@ import com.kjj.bean.whoSawMe.*;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.IdMakeUtil
;
import
com.kjj.utils.JsonUtil
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Parameters
;
import
org.testng.annotations.Test
;
import
java.io.IOException
;
...
...
@@ -42,7 +42,7 @@ public class WhoSawMe implements Authorization {
// 关闭数据看板演示数据
ForwardAndRead
.
closeDemoData
();
xxrUserId
=
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
);
xxrUserId
=
ForwardAndRead
.
decodeTku
(
VISITOR1_TKU
).
get
(
"userId"
);
}
// 进入谁看过我主页
...
...
@@ -66,7 +66,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
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR
2_TKU
).
get
(
"userId"
),
network
.
message
(
BasicConfig
.
USER_INFO
,
"代理人userId与预期不符"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
userId
,
ForwardAndRead
.
decodeTku
(
AGENT
2_TKU
).
get
(
"userId"
),
network
.
message
(
BasicConfig
.
USER_INFO
,
"代理人userId与预期不符"
,
response
.
body
().
asString
()));
}
// 获取当前页面Tips
...
...
@@ -86,7 +86,7 @@ public class WhoSawMe implements Authorization {
@Test
(
description
=
"首页_查询使用版本"
,
priority
=
4
)
public
void
查询代理人当前使用版本
()
throws
IOException
{
param
.
clear
();
xxxSellerId
=
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR
2_TKU
).
get
(
"sellerId"
);
xxxSellerId
=
ForwardAndRead
.
decodeTku
(
AGENT
2_TKU
).
get
(
"sellerId"
);
String
sellerIdEncode
=
ForwardAndRead
.
encodeId
(
xxxSellerId
);
param
.
put
(
"sellerId"
,
sellerIdEncode
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
USING_VERSION
);
...
...
@@ -151,8 +151,7 @@ public class WhoSawMe implements Authorization {
// 查看谁看过我首页我的访客列表
@Test
(
description
=
"查看我的访客列表"
,
priority
=
11
)
public
void
查看我的访客列表
()
throws
IOException
{
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR2_TKU
);
response
=
network
.
getResponse
(
BasicConfig
.
USER_INFO
);
network
.
agentCookies
.
put
(
"tku"
,
AGENT2_TKU
);
List
<
Object
>
customerTagIds
=
Lists
.
newArrayList
();
param
=
new
HashMap
<>();
param
.
put
(
"customerTagIds"
,
customerTagIds
);
...
...
@@ -163,7 +162,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
,
ForwardAndRead
.
getUserInfo
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"wxName"
),
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"最近访客微信昵称不匹配"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
visitorWxName
,
ForwardAndRead
.
getUserInfo
(
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"
);
...
...
@@ -269,13 +268,15 @@ public class WhoSawMe implements Authorization {
response
=
network
.
getResponse
(
param
,
BasicConfig
.
WEEKLY_POSTERINFO
);
String
positiveAna
=
response
.
jsonPath
().
getString
(
"data.positiveAna"
);
scid
=
response
.
jsonPath
().
getString
(
"data.scid"
);
String
sellerId
=
response
.
jsonPath
().
getString
(
"data.sellerId"
);
Assert
.
assertEquals
(
sellerId
,
IdMakeUtil
.
managerEncodingId
(
xxxSellerId
));
Assert
.
assertEquals
(
positiveAna
,
"不是所有弯路都值得再走一遍,但是每次分享都值得再读一遍"
,
network
.
message
(
param
,
BasicConfig
.
WEEKLY_POSTERINFO
,
"海报文案内容错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
scid
,
"Kj20MjIyNjk1"
,
network
.
message
(
param
,
BasicConfig
.
WEEKLY_POSTERINFO
,
"海报scid错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"运营周报_生成代理人头像二维码"
,
priority
=
21
)
public
void
运营周报
_
生成代理人头像二维码
()
throws
IOException
{
long
xxxUserId
=
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR
2_TKU
).
get
(
"userId"
);
long
xxxUserId
=
ForwardAndRead
.
decodeTku
(
AGENT
2_TKU
).
get
(
"userId"
);
param
.
clear
();
param
.
put
(
"needAvatarCover"
,
true
);
param
.
put
(
"pageType"
,
1
);
...
...
@@ -387,14 +388,14 @@ public class WhoSawMe implements Authorization {
}
// 代理人加入团队
param
=
new
HashMap
<>();
param
.
put
(
"inviterSid"
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR
2_TKU
).
get
(
"sellerId"
));
param
.
put
(
"inviterSid"
,
ForwardAndRead
.
decodeTku
(
AGENT
2_TKU
).
get
(
"sellerId"
));
param
.
put
(
"inviteType"
,
2
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_BOUND
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
param
,
BasicConfig
.
BOSS_BOUND
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_BOUND
,
"添加代理人进入团队失败"
,
response
.
body
().
asString
()));
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR
2_TKU
);
network
.
agentCookies
.
put
(
"tku"
,
AGENT
2_TKU
);
}
@Test
(
description
=
"查看被邀请代理人上级名称"
,
priority
=
26
)
...
...
@@ -404,7 +405,7 @@ public class WhoSawMe implements Authorization {
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
,
ForwardAndRead
.
getUserInfo
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"wx
Name"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_BOSS
,
"被邀请人上级名称与邀请人不一致"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
bossName
,
ForwardAndRead
.
getUserInfo
(
AGENT2_TKU
).
get
(
"seller
Name"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_BOSS
,
"被邀请人上级名称与邀请人不一致"
,
response
.
body
().
asString
()));
}
// 获取代理人团队信息
...
...
@@ -681,7 +682,7 @@ public class WhoSawMe implements Authorization {
Assert
.
assertEquals
(
myTaskLists
.
size
(),
0
,
network
.
message
(
param
,
BasicConfig
.
MYTASKLIST
,
"未完成列表不为空"
,
response
.
body
().
asString
()));
// 切换回团队主管理员
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR
2_TKU
);
network
.
agentCookies
.
put
(
"tku"
,
AGENT
2_TKU
);
}
// 团队管理员检查任务完成状态
...
...
@@ -842,7 +843,7 @@ 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
,
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
),
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"线索来源访客userId错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
custUserId
,
ForwardAndRead
.
decodeTku
(
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
()));
}
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
b36e4c69
...
...
@@ -78,8 +78,8 @@ public class BasicConfig {
public
static
String
VISITOR_TKU
=
"T3gM31f18jCGvqvoyJRzyMTdpcPDJWUJJP4VQje7p9sfC4HKmj5NJfCUkxusAyFb5SpkWS31srDTYr6KtV"
;
// 基础线访客(小雪人) TKU
public
static
String
VISITOR1_TKU
=
"T3gM31f18jCFXzk692pKjJCqJZdDv8Nb3htkzNk983cPPrfjggTn4Gv1ytpR3XAQusWRz7uTsHaibp6Es8"
;
// 基础线
访客
public
static
String
VISITOR2_TKU
=
"T3gM31f18jCeKCBVHf5MANgyXeBZGCm8vTJQTuWYXHFr27f8asoYpZASD6JzN5VJsBpQ8NxvzrJFGz2Ame"
;
// 二度访客用
// 基础线
代理人
public
static
String
AGENT2_TKU
=
"T3gM31f18jCfGaPSWPdym4Tn1bVYCTxrdndNe7hfwWrSpFCcXxnzbW81VZG9nT2gT8MMB52bE2rguiXBDL"
;
// 访客的sids
public
static
final
String
sids
=
"Kj21MjMwNTU"
;
// 访客(SuYi) userID:4425
...
...
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