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
a948910d
Commit
a948910d
authored
Aug 10, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/20210807-xmc' into 'master'
Feature/20210807 xmc See merge request test-group/kejiji!94
parents
ba46b1cc
b9db222b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
174 additions
and
88 deletions
+174
-88
ClueStatistics.java
src/test/java/com/kjj/bean/whoSawMe/ClueStatistics.java
+13
-0
ForwardAndRead.java
...java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
+80
-24
MyCustomer.java
...est/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
+38
-23
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
+26
-28
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+9
-2
wechatTestNG.xml
src/test/wechatTestNG.xml
+0
-1
No files found.
src/test/java/com/kjj/bean/whoSawMe/ClueStatistics.java
0 → 100644
View file @
a948910d
package
com
.
kjj
.
bean
.
whoSawMe
;
import
lombok.Data
;
@Data
public
class
ClueStatistics
{
private
int
drawMaterial
;
//领取资料次数
private
int
drawPresentInsuranceCount
;
// 领取赠险次数
private
int
faqCount
;
// 查看FAQ次数
private
int
grassCount
;
// 阅读种草素材次数
private
int
riskTestCount
;
// 参与风险评测次数
private
int
visitCount
;
// 来访次数
}
src/test/java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
View file @
a948910d
...
...
@@ -8,6 +8,7 @@ import io.restassured.response.Response;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.io.IOException
;
import
java.util.*
;
...
...
@@ -16,13 +17,15 @@ 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
;
private
String
insuranceId
;
private
long
forwardTime
;
private
String
questionId
;
public
static
Map
<
String
,
Integer
>
custClueStatistics
;
@BeforeClass
public
void
setUp
()
throws
IOException
{
...
...
@@ -30,8 +33,26 @@ public class ForwardAndRead implements Authorization {
BaseUtils
.
ssoLogin
();
}
// 获取二度访客起始线索数据
@Test
(
description
=
"获取二度访客起始线索数据"
,
priority
=
1
)
public
void
获取二度访客起始线索数据
(){
long
userId
=
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
);
param
=
new
HashMap
<>();
custClueStatistics
=
new
HashMap
<>();
param
.
put
(
"userId"
,
userId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CLUESTATISTICS
);
int
drawMaterial
=
response
.
jsonPath
().
getInt
(
"data.drawMaterial"
);
int
drawPresentInsuranceCount
=
response
.
jsonPath
().
getInt
(
"data.drawPresentInsuranceCount"
);
int
grassCount
=
response
.
jsonPath
().
getInt
(
"data.grassCount"
);
int
visitCount
=
response
.
jsonPath
().
getInt
(
"data.visitCount"
);
custClueStatistics
.
put
(
"drawMaterial"
,
drawMaterial
);
custClueStatistics
.
put
(
"drawPresentInsuranceCount"
,
drawPresentInsuranceCount
);
custClueStatistics
.
put
(
"grassCount"
,
grassCount
);
custClueStatistics
.
put
(
"visitCount"
,
visitCount
);
}
// 代理人转发素材
@Test
(
description
=
"代理人转发文章"
,
priority
=
1
)
@Test
(
description
=
"代理人转发文章"
,
priority
=
2
)
public
void
转发文章
()
throws
IOException
{
// 转发文章前记录一个时间
forwardTime
=
new
Date
().
getTime
();
...
...
@@ -48,7 +69,7 @@ public class ForwardAndRead implements Authorization {
}
@Test
(
description
=
"代理人转发名片"
,
priority
=
2
)
@Test
(
description
=
"代理人转发名片"
,
priority
=
3
)
public
void
转发名片
()
throws
IOException
{
// 获取名片scid
String
scId
=
network
.
getResponse
(
BasicConfig
.
SELLERCARD_topOfDetail
).
jsonPath
().
getString
(
"data.scid"
);
...
...
@@ -63,7 +84,7 @@ public class ForwardAndRead implements Authorization {
}
// 访客访问素材及产生线索
@Test
(
description
=
"访客阅读文章"
,
priority
=
3
)
@Test
(
description
=
"访客阅读文章"
,
priority
=
4
)
public
void
访客阅读文章
()
throws
IOException
{
sellerId
=
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
AGENT_TKU
);
...
...
@@ -78,7 +99,7 @@ public class ForwardAndRead implements Authorization {
Assert
.
assertNotNull
(
jjvisitId
,
network
.
message
(
param
,
BasicConfig
.
CONTENT_READ
,
"visitId为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客领取赠险"
,
priority
=
4
)
@Test
(
description
=
"访客领取赠险"
,
priority
=
5
)
public
void
领取赠险
()
throws
IOException
{
// 获取赠险insuranceId
param
=
new
HashMap
<>();
...
...
@@ -101,7 +122,7 @@ public class ForwardAndRead implements Authorization {
Assert
.
assertEquals
(
data
,
"success"
,
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"领取赠险失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客转发文章"
,
priority
=
5
)
@Test
(
description
=
"访客转发文章"
,
priority
=
6
)
public
void
访客转发文章
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"scId"
,
articleScId
);
...
...
@@ -114,7 +135,7 @@ public class ForwardAndRead implements Authorization {
}
// 获取新用户
@Test
(
description
=
"新用户访问"
,
priority
=
6
)
@Test
(
description
=
"新用户访问"
,
priority
=
7
)
public
void
新用户访问
()
throws
IOException
{
ThreadSleepUtils
.
sleep
(
5000
);
network
.
agentCookies
.
put
(
"tku"
,
BaseUtils
.
tku
);
...
...
@@ -131,7 +152,7 @@ public class ForwardAndRead implements Authorization {
}
// 新用户领取赠险
@Test
(
description
=
"新用户领取赠险"
,
priority
=
7
)
@Test
(
description
=
"新用户领取赠险"
,
priority
=
8
)
public
void
新用户领取赠险
()
throws
IOException
{
param
.
clear
();
param
.
put
(
"clueTypeName"
,
"WELFARE_INSURANCE"
);
...
...
@@ -146,7 +167,7 @@ public class ForwardAndRead implements Authorization {
Assert
.
assertEquals
(
data
,
"success"
,
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"领取赠险失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"二度访客阅读文章"
,
priority
=
8
)
@Test
(
description
=
"二度访客阅读文章"
,
priority
=
9
)
public
void
二度访客阅读文章
()
throws
IOException
{
ThreadSleepUtils
.
sleep
(
5000
);
Long
fromUserId
=
decodeTku
(
BasicConfig
.
AGENT_TKU
).
get
(
"sellerId"
);
...
...
@@ -160,7 +181,7 @@ public class ForwardAndRead implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CONTENT_READ
,
"接口调用失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"添加访问记录"
,
priority
=
9
)
@Test
(
description
=
"添加访问记录"
,
priority
=
10
)
public
void
添加访问记录
()
throws
IOException
{
param
.
clear
();
param
.
put
(
"forwardTime"
,
forwardTime
);
// 添加访问记录的时间要小于代理人转发时间
...
...
@@ -169,7 +190,7 @@ public class ForwardAndRead implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
DYNAMIC_ADDVISIT
,
"添加访问记录失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"二度访客领取赠险"
,
priority
=
1
0
)
@Test
(
description
=
"二度访客领取赠险"
,
priority
=
1
1
)
public
void
二度访客领取赠险
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"clueTypeName"
,
"WELFARE_INSURANCE"
);
...
...
@@ -184,7 +205,7 @@ public class ForwardAndRead implements Authorization {
Assert
.
assertEquals
(
data
,
"success"
,
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"领取赠险失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取文章FAQs"
,
priority
=
1
1
)
@Test
(
description
=
"获取文章FAQs"
,
priority
=
1
2
)
public
void
获取文章
FAQs
()
throws
IOException
{
param
.
clear
();
param
.
put
(
"scid"
,
articleScId
);
...
...
@@ -195,15 +216,39 @@ public class ForwardAndRead implements Authorization {
int
totalCount
=
response
.
jsonPath
().
getInt
(
"data.totalCount"
);
List
<
Object
>
lists
=
response
.
jsonPath
().
getList
(
"data.list"
);
Assert
.
assertEquals
(
totalCount
,
lists
.
size
(),
network
.
message
(
param
,
BasicConfig
.
ARTICLE_ENHANCEDCOLUMN_GETFAQS
,
"FAQ总数与FAQ列表大小不一致"
,
response
.
body
().
asString
()));
questionId
=
response
.
jsonPath
().
getString
(
"data.list[0].questionId"
);
}
@Test
(
description
=
"二度访客发起提问"
,
priority
=
13
)
public
void
二度访客发起提问
()
throws
IOException
{
param
.
clear
();
param
.
put
(
"clueTypeName"
,
"FAQ_VISIT_DETAIL"
);
param
.
put
(
"locationSource"
,
2
);
param
.
put
(
"qId"
,
questionId
);
param
.
put
(
"scId"
,
articleScId
);
param
.
put
(
"sourceId"
,
articleScId
);
param
.
put
(
"sourceType"
,
1
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
);
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
data
,
"success"
,
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"发起提问失败"
,
response
.
body
().
asString
()));
}
// @Test(description = "二度访客点击FAQ", priority = 12)
// public void 二度访客点击FAQ() throws IOException{
//
// }
@Test
(
description
=
"二度访客领取资料"
,
priority
=
14
)
public
void
二度访客领取资料
()
throws
IOException
{
param
.
clear
();
param
.
put
(
"clueTypeName"
,
"FAQ_VISIT_SCAN"
);
param
.
put
(
"locationSource"
,
2
);
param
.
put
(
"qId"
,
questionId
);
param
.
put
(
"scId"
,
articleScId
);
param
.
put
(
"sourceId"
,
articleScId
);
param
.
put
(
"sourceType"
,
1
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
);
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
data
,
"success"
,
network
.
message
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
,
"领取资料失败"
,
response
.
body
().
asString
()));
}
// 通过素材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
);
...
...
@@ -214,7 +259,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
()));
...
...
@@ -228,9 +273,10 @@ public class ForwardAndRead implements Authorization {
}
// 解密tku
public
HashMap
<
String
,
Long
>
decodeTku
(
String
tku
){
public
static
HashMap
<
String
,
Long
>
decodeTku
(
String
tku
){
// 登陆管理后台
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"tku"
,
tku
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
MANAGER_TKU_DECODE
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
MANAGER_TKU_DECODE
,
"接口请求失败"
,
response
.
body
().
asString
()));
...
...
@@ -244,19 +290,29 @@ public class ForwardAndRead implements Authorization {
return
result
;
}
//
加密sellerId
public
String
encodeId
(
Long
Id
){
//
Id加密
public
static
String
encodeId
(
Long
Id
){
// 登陆管理后台
param
=
new
HashMap
<>();
param
.
put
(
"code"
,
Id
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
MANAGER_ID_ENCODE
);
String
idEncode
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertNotNull
(
idEncode
,
network
.
message
(
param
,
BasicConfig
.
MANAGER_ID_ENCODE
,
"加密
seller
Id失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
idEncode
,
network
.
message
(
param
,
BasicConfig
.
MANAGER_ID_ENCODE
,
"加密Id失败"
,
response
.
body
().
asString
()));
return
idEncode
;
}
// Id解密
public
static
Long
decodeId
(
String
Id
){
param
=
new
HashMap
<>();
param
.
put
(
"code"
,
Id
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
MANAGER_ID_DECODE
);
Long
idDecode
=
response
.
jsonPath
().
getLong
(
"data"
);
Assert
.
assertNotNull
(
idDecode
,
network
.
message
(
param
,
BasicConfig
.
MANAGER_ID_DECODE
,
"解密Id失败"
,
response
.
body
().
asString
()));
return
idDecode
;
}
// 关闭数据看板演示数据
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 @
a948910d
...
...
@@ -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
()));
}
...
...
@@ -360,8 +357,15 @@ public class MyCustomer implements Authorization {
param
.
put
(
"userId"
,
visitor1UserId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CLUESTATISTICS
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
drawPresentInsuranceCount
=
response
.
jsonPath
().
getInt
(
"data.drawPresentInsuranceCount"
);
Assert
.
assertTrue
(
drawPresentInsuranceCount
>=
1
,
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"客户领取赠险次数小于1"
,
response
.
body
().
asString
()));
ClueStatistics
clueStatistics
=
JsonUtil
.
parseResponseToBean
(
response
,
ClueStatistics
.
class
);
int
drawPresentInsuranceCount
=
clueStatistics
.
getDrawPresentInsuranceCount
();
int
grassCount
=
clueStatistics
.
getGrassCount
();
int
visitCount
=
clueStatistics
.
getVisitCount
();
int
drawMaterial
=
clueStatistics
.
getDrawMaterial
();
Assert
.
assertEquals
(
drawPresentInsuranceCount
,
ForwardAndRead
.
custClueStatistics
.
get
(
"drawPresentInsuranceCount"
)
+
1
,
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"访客领取赠险记录次数未正确增加"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
grassCount
,
ForwardAndRead
.
custClueStatistics
.
get
(
"grassCount"
)
+
1
,
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"访客阅读种草文章记录次数未正确增加"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
visitCount
,
ForwardAndRead
.
custClueStatistics
.
get
(
"visitCount"
)
+
1
,
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"访客来访记录次数未正确增加"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
drawMaterial
,
ForwardAndRead
.
custClueStatistics
.
get
(
"drawMaterial"
)
+
1
,
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"访客领取资料次数未正确增加"
,
response
.
body
().
asString
()));
}
// 客户详情页_线索统计
...
...
@@ -407,8 +411,19 @@ public class MyCustomer implements Authorization {
Assert
.
assertEquals
(
clueType
,
31
,
network
.
message
(
param
,
BasicConfig
.
CUSTVISITLIST
,
"访问记录详情有误"
,
response
.
body
().
asString
()));
}
// 客户线索跟进
@Test
(
description
=
"客户线索跟进_风险评测"
,
priority
=
24
)
public
void
客户线索跟进
_
风险评测
()
throws
IOException
{
// 跟进建议
param
.
clear
();
param
.
put
(
"userId"
,
visitor1UserId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FOLLOWADVICE
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
param
,
BasicConfig
.
FOLLOWADVICE
,
"接口响应数据为空"
,
response
.
body
().
asString
()));
}
// 客户详情页_任务蒙层
@Test
(
description
=
"客户详情页_任务蒙层"
,
priority
=
2
4
)
@Test
(
description
=
"客户详情页_任务蒙层"
,
priority
=
2
5
)
public
void
客户详情页
_
任务蒙层
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"sceneCode"
,
"noviceTask_visitorsCustomerInfoComplete"
);
...
...
@@ -418,7 +433,7 @@ public class MyCustomer implements Authorization {
}
// 客户详情页_特别关注弹层
@Test
(
description
=
"客户详情页_特别关注弹层"
,
priority
=
2
5
)
@Test
(
description
=
"客户详情页_特别关注弹层"
,
priority
=
2
6
)
public
void
客户详情页
_
特别关注弹层
()
throws
IOException
{
response
=
network
.
getResponse
(
BasicConfig
.
ISDISPLAYSPECIAL
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
...
...
@@ -426,7 +441,7 @@ public class MyCustomer implements Authorization {
}
// 客户详情页_素材访问记录
@Test
(
description
=
"客户详情页_素材访问记录"
,
priority
=
2
6
)
@Test
(
description
=
"客户详情页_素材访问记录"
,
priority
=
2
7
)
public
void
客户详情页
_
素材访问记录
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1UserId
);
...
...
@@ -438,7 +453,7 @@ public class MyCustomer implements Authorization {
}
// 客户详情页_关键线索_提交资料
@Test
(
description
=
"客户详情页_资料信息"
,
priority
=
2
7
)
@Test
(
description
=
"客户详情页_资料信息"
,
priority
=
2
8
)
public
void
关键线索
_
提交资料
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1UserId
);
...
...
@@ -447,7 +462,7 @@ public class MyCustomer implements Authorization {
}
// 客户详情页_关键线索_中奖记录
@Test
(
description
=
"客户详情页_关键信息_中奖记录"
,
priority
=
2
8
)
@Test
(
description
=
"客户详情页_关键信息_中奖记录"
,
priority
=
2
9
)
public
void
关键线索
_
中奖记录
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1UserId
);
...
...
@@ -456,7 +471,7 @@ public class MyCustomer implements Authorization {
}
// 客户详情页_关键信息_喜欢的内容
@Test
(
description
=
"关键信息_喜欢的内容"
,
priority
=
29
)
@Test
(
description
=
"关键信息_喜欢的内容"
,
priority
=
30
)
public
void
关键信息
_
喜欢的内容
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1UserId
);
...
...
@@ -470,7 +485,7 @@ public class MyCustomer implements Authorization {
}
// 客户信息_客户管理_备注和标签
@Test
(
description
=
"备注和标签"
,
priority
=
3
0
)
@Test
(
description
=
"备注和标签"
,
priority
=
3
1
)
public
void
客户信息
_
客户管理
_
备注和标签
()
throws
IOException
{
List
<
String
>
tagIds
=
new
ArrayList
<>();
tagIds
.
add
(
createTagId
);
...
...
@@ -677,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
()));
...
...
@@ -687,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
);
...
...
@@ -776,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
()));
...
...
@@ -808,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
()));
...
...
@@ -833,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 @
a948910d
...
...
@@ -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 @
a948910d
...
...
@@ -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
<>();
...
...
@@ -781,7 +779,7 @@ public class WhoSawMe implements Authorization {
response
=
network
.
getResponse
(
param
,
BasicConfig
.
SALECLUELIST
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
SALECLUELIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
visitClueType
=
response
.
jsonPath
().
getInt
(
"data.list[0].visitClueType"
);
Assert
.
assertEquals
(
visitClueType
,
31
,
network
.
message
(
param
,
BasicConfig
.
SALECLUELIST
,
"线索类型不匹配"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
visitClueType
,
29
,
network
.
message
(
param
,
BasicConfig
.
SALECLUELIST
,
"线索类型不匹配"
,
response
.
body
().
asString
()));
}
// 查看转发动态访问列表
...
...
@@ -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
);
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
a948910d
...
...
@@ -73,9 +73,9 @@ public class BasicConfig {
// 基础线访客 TKU---"请勿打扰"
public
static
String
VISITOR_TKU
=
"T3gM31f18jCGvqvoyJRzyMTdpcPDJWUJJP4VQje7p9sfC4HKmj5NJfCUkxusAyFb5SpkWS31srDTYr6KtV"
;
// 基础线访客(小雪人) TKU
public
static
String
VISITOR1_TKU
=
"T3gM31f18jCFXzk692pKjJCqJZdDv8Nb3htkzNk983cP
MspUQD6pVEn2FNMefM2nieKPicXG9c1tDg8qtN
"
;
public
static
String
VISITOR1_TKU
=
"T3gM31f18jCFXzk692pKjJCqJZdDv8Nb3htkzNk983cP
PrfjggTn4Gv1ytpR3XAQusWRz7uTsHaibp6Es8
"
;
// 基础线访客
public
static
String
VISITOR2_TKU
=
"T3gM31f18jCeKCBVHf5MANgyXeBZGCm8vTJQTuWYXHF
qx97PATsWyUYamGaNdNip8bEs9shoE9tTsAmp8x
"
;
// 二度访客用
public
static
String
VISITOR2_TKU
=
"T3gM31f18jCeKCBVHf5MANgyXeBZGCm8vTJQTuWYXHF
r27f8asoYpZASD6JzN5VJsBpQ8NxvzrJFGz2Ame
"
;
// 二度访客用
// 访客的sids
public
static
final
String
sids
=
"Kj21MjMwNTU"
;
// 访客(SuYi) userID:4425
...
...
@@ -87,6 +87,7 @@ public class BasicConfig {
// *************** 客集集域名 ***************
public
static
final
String
HOST
=
"https://kjj.m.duibatest.com.cn"
;
public
static
final
String
ACTIVITY_HOST
=
"https://kjj-activity.duibatest.com.cn"
;
public
static
final
String
ACTIVITY1_HOST
=
"https://kjj-activity-1.duibatest.com.cn"
;
public
static
final
String
SSO_HOST
=
"https://sso.duibatest.com.cn"
;
public
static
final
String
MANAGER_HOST
=
"https://kjj-mng.duibatest.com.cn"
;
public
static
final
String
MOBILE_HOST
=
"https://live.duibatest.com.cn"
;
...
...
@@ -736,6 +737,7 @@ public class BasicConfig {
public
static
final
String
DYNAMIC_ADDVISIT
=
HOST
+
"/kjy/mp/seller/dynamic/addVisit"
;
public
static
final
String
CLUEINFO
=
HOST
+
"/kjy/mp/whoSawMe/clue/info"
;
public
static
final
String
CLUEADVISE
=
HOST
+
"/kjy/mp/whoSawMe/clue/info/advise"
;
public
static
final
String
FOLLOWADVICE
=
HOST
+
"/kjy/mp/whoSawMe/clue/followAdvice"
;
// *************** 运营周报 ***************
public
static
final
String
WEEKLY_INDEXINFO
=
HOST
+
"/kjy/mp/weekly/getWeeklyIndexInfo"
;
...
...
@@ -803,6 +805,8 @@ public class BasicConfig {
public
static
final
String
ARTICLE_ENHANCEDCOLUMN_GETFAQS
=
HOST
+
"/kjy/mp/enhancedColumn/getFAQs"
;
public
static
final
String
ARTICLE_getQuestionDetail
=
HOST
+
"/kjy/mp/explosioncontent/qa/getQuestionDetail"
;
public
static
final
String
ARTICLE_GETEXPLOSIONCONTENTLIST
=
HOST
+
"/kjy/mp/explosioncontent/getExplosionContentList"
;
// 风险评测
public
static
final
String
RISKTEST_SENDINFO
=
ACTIVITY1_HOST
+
"/kjy/mp/activity/sendInfoForRisk"
;
// ************** 发圈素材 ***************
public
static
final
String
FRIENDS_GETMATERIALTAGS
=
HOST
+
"/kjy/mp/materialContent/getmaterialTags"
;
...
...
@@ -990,6 +994,7 @@ public class BasicConfig {
public
static
final
String
MANAGER_dailyPostersDelete
=
MANAGER_HOST
+
"/kjy/manager/dailyPosters/delete"
;
public
static
final
String
MANAGER_SELLERTEAM_REMOVEMEMBER
=
MANAGER_HOST
+
"/kjy/manager/sellerTeam/removeMember"
;
public
static
final
String
MANAGER_ID_ENCODE
=
MANAGER_HOST
+
"/kjy/manager/testUser/encode"
;
public
static
final
String
MANAGER_ID_DECODE
=
MANAGER_HOST
+
"/kjy/manager/testUser/decode"
;
public
static
final
String
MANAGER_TKU_DECODE
=
MANAGER_HOST
+
"/kjy/manager/testUser/decryptTku"
;
public
static
final
String
MANAGER_getPushContent
=
MANAGER_HOST
+
"/kjy/manager/pushManager/getPushContent"
;
public
static
final
String
MANAGER_addOrUpdateCases
=
MANAGER_HOST
+
"/kjy/manager/successCases/addOrUpdateCases"
;
...
...
@@ -1007,4 +1012,6 @@ public class BasicConfig {
public
static
final
String
MANAGER_encryptTku
=
MANAGER_HOST
+
"/kjy/manager/testUser/encryptTku"
;
public
static
final
String
MANAGER_changeCompany
=
MANAGER_HOST
+
"/kjy/manager/seller/changeCompany"
;
public
static
final
String
MANAGER_feedBackList
=
MANAGER_HOST
+
"/kjy/manager/feedback/list"
;
public
static
final
String
MANAGER_articleInteraction
=
MANAGER_HOST
+
"/kjy/manager/interact/article/searchPageList"
;
public
static
final
String
MANAGER_interactSolution
=
MANAGER_HOST
+
"/kjy/manager/interact/solution/searchPageList"
;
}
src/test/wechatTestNG.xml
View file @
a948910d
...
...
@@ -46,7 +46,6 @@
<class
name=
"com.kjj.cases.assistant.homePage.Upload"
/>
</classes>
</test>
<test
preserve-order=
"true"
name =
"获取访客"
>
<classes>
<class
name=
"com.kjj.cases.assistant.whoSawMe.ForwardAndRead"
/>
...
...
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