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
6e40e65c
Commit
6e40e65c
authored
Jul 23, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增我的转发页面+我的客户页面cases
修改谁看过我页面cases
parent
7cfac76e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
13 deletions
+21
-13
ForwardAndRead.java
...java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
+13
-0
MyForward.java
...test/java/com/kjj/cases/assistant/whoSawMe/MyForward.java
+1
-1
WhoSawMe.java
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
+7
-12
No files found.
src/test/java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
View file @
6e40e65c
...
@@ -10,6 +10,7 @@ import org.testng.Assert;
...
@@ -10,6 +10,7 @@ import org.testng.Assert;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
javax.crypto.MacSpi
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -157,6 +158,18 @@ public class ForwardAndRead implements Authorization {
...
@@ -157,6 +158,18 @@ public class ForwardAndRead implements Authorization {
return
sellerId
;
return
sellerId
;
}
}
// 获取用户信息
public
Map
<
String
,
Object
>
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
()));
String
wxName
=
response
.
jsonPath
().
getString
(
"data.wxName"
);
Map
<
String
,
Object
>
infos
=
new
HashMap
<>();
infos
.
put
(
"wxName"
,
wxName
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
AGENT_TKU
);
return
infos
;
}
// 解密tku
// 解密tku
public
HashMap
<
String
,
Long
>
decodeTku
(
String
tku
){
public
HashMap
<
String
,
Long
>
decodeTku
(
String
tku
){
// 登陆管理后台
// 登陆管理后台
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/MyForward.java
View file @
6e40e65c
...
@@ -200,7 +200,7 @@ public class MyForward implements Authorization {
...
@@ -200,7 +200,7 @@ public class MyForward implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
,
"接口请求失败"
,
response
.
body
().
asString
()));
String
visitorUserIdEncode
=
response
.
jsonPath
().
getString
(
"data.list[0].userId"
);
String
visitorUserIdEncode
=
response
.
jsonPath
().
getString
(
"data.list[0].userId"
);
// 获取访客加密的userId
// 获取访客加密的userId
visitorEncodeUserId
=
far
.
encodeId
(
far
.
decodeTku
(
BasicConfig
.
VISITOR
_TKU
).
get
(
"userId"
));
visitorEncodeUserId
=
far
.
encodeId
(
far
.
decodeTku
(
VISITOR1
_TKU
).
get
(
"userId"
));
Assert
.
assertEquals
(
visitorUserIdEncode
,
visitorEncodeUserId
,
network
.
message
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
,
"转发素材访客记录中首条记录用户userId不正确"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
visitorUserIdEncode
,
visitorEncodeUserId
,
network
.
message
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
,
"转发素材访客记录中首条记录用户userId不正确"
,
response
.
body
().
asString
()));
}
}
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
View file @
6e40e65c
...
@@ -21,16 +21,15 @@ public class WhoSawMe implements Authorization {
...
@@ -21,16 +21,15 @@ public class WhoSawMe implements Authorization {
private
Response
response
;
private
Response
response
;
private
Map
<
String
,
Object
>
param
;
private
Map
<
String
,
Object
>
param
;
private
String
AGENT1_TKU
;
private
ForwardAndRead
far
;
private
ForwardAndRead
far
;
private
Long
childSellerId
;
@BeforeClass
@BeforeClass
public
void
setUp
()
throws
IOException
{
public
void
setUp
()
throws
IOException
{
// 代理人授权
// 代理人授权
agentTku
();
agentTku
();
BaseUtils
.
ssoLogin
();
BaseUtils
.
ssoLogin
();
// 赋值
AGENT1_TKU
=
"T3gM31f18jCeKCBVHf5MANgyXeBZGCm8vTJQTuWYXHFqxAxq2TQ27ozxyRsZykZBimiwFTrzQnGLWkvAs4"
;
far
=
new
ForwardAndRead
();
far
=
new
ForwardAndRead
();
// 关闭数据看板演示数据
// 关闭数据看板演示数据
...
@@ -205,7 +204,7 @@ public class WhoSawMe implements Authorization {
...
@@ -205,7 +204,7 @@ public class WhoSawMe implements Authorization {
public
void
邀请加入团队
()
throws
IOException
{
public
void
邀请加入团队
()
throws
IOException
{
// 切换代理人加入团队
// 切换代理人加入团队
Long
sellerId
=
far
.
getSellerId
();
Long
sellerId
=
far
.
getSellerId
();
network
.
agentCookies
.
put
(
"tku"
,
AGENT
1_TKU
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR
1_TKU
);
// 确定被邀请代理人没有上级
// 确定被邀请代理人没有上级
response
=
network
.
getResponse
(
BasicConfig
.
BOSS_ROLE
);
response
=
network
.
getResponse
(
BasicConfig
.
BOSS_ROLE
);
...
@@ -227,9 +226,9 @@ public class WhoSawMe implements Authorization {
...
@@ -227,9 +226,9 @@ public class WhoSawMe implements Authorization {
@Test
(
description
=
"查看被邀请代理人上级名称"
,
priority
=
16
)
@Test
(
description
=
"查看被邀请代理人上级名称"
,
priority
=
16
)
public
void
查看上级名称
()
throws
IOException
{
public
void
查看上级名称
()
throws
IOException
{
// 获取被邀请代理人sellerId
// 获取被邀请代理人sellerId
Long
sellerId
=
far
.
decodeTku
(
AGENT
1_TKU
).
get
(
"sellerId"
);
childSellerId
=
far
.
decodeTku
(
BasicConfig
.
VISITOR
1_TKU
).
get
(
"sellerId"
);
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"sellerId"
,
s
ellerId
);
param
.
put
(
"sellerId"
,
childS
ellerId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_BOSS
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_BOSS
);
String
bossName
=
response
.
jsonPath
().
getString
(
"data"
);
String
bossName
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_BOSS
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_BOSS
,
"接口请求失败"
,
response
.
body
().
asString
()));
...
@@ -238,9 +237,6 @@ public class WhoSawMe implements Authorization {
...
@@ -238,9 +237,6 @@ public class WhoSawMe implements Authorization {
@Test
(
description
=
"删除团队成员"
,
priority
=
17
)
@Test
(
description
=
"删除团队成员"
,
priority
=
17
)
public
void
删除团队成员
()
throws
IOException
{
public
void
删除团队成员
()
throws
IOException
{
// 获取下级代理人sellerId
Long
childSellerId
=
far
.
decodeTku
(
AGENT1_TKU
).
get
(
"sellerId"
);
// 登陆管理后台调用管理后台接口删除成员
// 登陆管理后台调用管理后台接口删除成员
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"superiorSid"
,
far
.
getSellerId
());
param
.
put
(
"superiorSid"
,
far
.
getSellerId
());
...
@@ -249,7 +245,7 @@ public class WhoSawMe implements Authorization {
...
@@ -249,7 +245,7 @@ public class WhoSawMe implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
MANAGER_SELLERTEAM_REMOVEMEMBER
,
"删除成员失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
MANAGER_SELLERTEAM_REMOVEMEMBER
,
"删除成员失败"
,
response
.
body
().
asString
()));
// 切换到被删除代理人确认已没有上级
// 切换到被删除代理人确认已没有上级
network
.
agentCookies
.
put
(
"tku"
,
AGENT
1_TKU
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR
1_TKU
);
response
=
network
.
getResponse
(
BasicConfig
.
BOSS_ROLE
);
response
=
network
.
getResponse
(
BasicConfig
.
BOSS_ROLE
);
boolean
hasSuperior
=
response
.
jsonPath
().
getBoolean
(
"data.hasSuperior"
);
boolean
hasSuperior
=
response
.
jsonPath
().
getBoolean
(
"data.hasSuperior"
);
Assert
.
assertFalse
(
hasSuperior
,
network
.
message
(
BasicConfig
.
BOSS_ROLE
,
"该代理人还有上级"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
hasSuperior
,
network
.
message
(
BasicConfig
.
BOSS_ROLE
,
"该代理人还有上级"
,
response
.
body
().
asString
()));
...
@@ -357,9 +353,8 @@ public class WhoSawMe implements Authorization {
...
@@ -357,9 +353,8 @@ public class WhoSawMe implements Authorization {
param
.
put
(
"listType"
,
1
);
param
.
put
(
"listType"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageSize"
,
20
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"接口请求失败"
,
response
.
body
().
asString
()));
String
visitorWxName
=
response
.
jsonPath
().
getString
(
"data.list[0].nickName"
);
String
visitorWxName
=
response
.
jsonPath
().
getString
(
"data.list[0].nickName"
);
Assert
.
assertEquals
(
visitorWxName
,
"xxx"
,
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"访客微信昵称不匹配"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
visitorWxName
,
far
.
getUserInfo
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"wxName"
)
,
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"访客微信昵称不匹配"
,
response
.
body
().
asString
()));
}
}
}
}
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