Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oto
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
龚小红
oto
Commits
a55633c3
Commit
a55633c3
authored
Aug 07, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改方法函数调用方式
parent
9003940d
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
90 deletions
+83
-90
ForwardAndRead.java
...java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
+39
-39
MyCustomer.java
...est/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
+11
-14
MyForward.java
...test/java/com/kjj/cases/assistant/whoSawMe/MyForward.java
+8
-10
WhoSawMe.java
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
+25
-27
No files found.
src/test/java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
View file @
a55633c3
...
@@ -17,8 +17,8 @@ import static com.kjj.config.BasicConfig.BOSS_EDITCONFIG;
...
@@ -17,8 +17,8 @@ import static com.kjj.config.BasicConfig.BOSS_EDITCONFIG;
// 谁看过我模块测试前执行一次代理人转发素材及访客访问和产生线索
// 谁看过我模块测试前执行一次代理人转发素材及访客访问和产生线索
public
class
ForwardAndRead
implements
Authorization
{
public
class
ForwardAndRead
implements
Authorization
{
private
Response
response
;
private
static
Response
response
;
private
Map
<
String
,
Object
>
param
;
private
static
Map
<
String
,
Object
>
param
;
private
String
articleScId
;
private
String
articleScId
;
private
Long
sellerId
;
private
Long
sellerId
;
private
String
jjvisitId
;
private
String
jjvisitId
;
...
@@ -141,37 +141,37 @@ public class ForwardAndRead implements Authorization {
...
@@ -141,37 +141,37 @@ public class ForwardAndRead implements Authorization {
}
}
// 获取新用户
// 获取新用户
//
@Test(description = "新用户访问", priority = 7)
@Test
(
description
=
"新用户访问"
,
priority
=
7
)
//
public void 新用户访问() throws IOException{
public
void
新用户访问
()
throws
IOException
{
//
ThreadSleepUtils.sleep(5000);
ThreadSleepUtils
.
sleep
(
5000
);
//
network.agentCookies.put("tku", BaseUtils.tku);
network
.
agentCookies
.
put
(
"tku"
,
BaseUtils
.
tku
);
//
response = network.getResponse(BasicConfig.USER_INFO);
response
=
network
.
getResponse
(
BasicConfig
.
USER_INFO
);
//
System.out.println(response.body().asString());
System
.
out
.
println
(
response
.
body
().
asString
());
//
param.clear();
param
.
clear
();
//
param.put("scid", articleScId);
param
.
put
(
"scid"
,
articleScId
);
//
param.put("fromUserId", sellerId);
param
.
put
(
"fromUserId"
,
sellerId
);
//
param.put("cancelPush", false);
param
.
put
(
"cancelPush"
,
false
);
//
param.put("visitPath", 0);
param
.
put
(
"visitPath"
,
0
);
//
response = network.getResponse(param, BasicConfig.CONTENT_READ);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CONTENT_READ
);
//
System.out.println(response.body().asString());
System
.
out
.
println
(
response
.
body
().
asString
());
//
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 = 8)
@Test
(
description
=
"新用户领取赠险"
,
priority
=
8
)
//
public void 新用户领取赠险() throws IOException{
public
void
新用户领取赠险
()
throws
IOException
{
//
param.clear();
param
.
clear
();
//
param.put("clueTypeName", "WELFARE_INSURANCE");
param
.
put
(
"clueTypeName"
,
"WELFARE_INSURANCE"
);
//
param.put("insuranceId", insuranceId);
param
.
put
(
"insuranceId"
,
insuranceId
);
//
param.put("locationSource", 1);
param
.
put
(
"locationSource"
,
1
);
//
param.put("scId", articleScId);
param
.
put
(
"scId"
,
articleScId
);
//
param.put("sourceId", articleScId);
param
.
put
(
"sourceId"
,
articleScId
);
//
param.put("sourceType", 1);
param
.
put
(
"sourceType"
,
1
);
//
response = network.postResponse(param, BasicConfig.SELLERCARD_SENDPUSHFORSCAN);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
SELLERCARD_SENDPUSHFORSCAN
);
//
System.out.println(response.body().asString());
System
.
out
.
println
(
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
()));
//
}
}
@Test
(
description
=
"二度访客阅读文章"
,
priority
=
9
)
@Test
(
description
=
"二度访客阅读文章"
,
priority
=
9
)
public
void
二度访客阅读文章
()
throws
IOException
{
public
void
二度访客阅读文章
()
throws
IOException
{
...
@@ -242,7 +242,7 @@ public class ForwardAndRead implements Authorization {
...
@@ -242,7 +242,7 @@ public class ForwardAndRead implements Authorization {
}
}
// 通过素材contentId获取线索员文章scId
// 通过素材contentId获取线索员文章scId
public
String
getContentScId
(
String
contentId
){
public
static
String
getContentScId
(
String
contentId
){
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"contentId"
,
contentId
);
param
.
put
(
"contentId"
,
contentId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
GETSCID
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
GETSCID
);
...
@@ -253,7 +253,7 @@ public class ForwardAndRead implements Authorization {
...
@@ -253,7 +253,7 @@ public class ForwardAndRead implements Authorization {
}
}
// 获取用户信息
// 获取用户信息
public
Map
<
String
,
String
>
getUserInfo
(
String
userTku
){
public
static
Map
<
String
,
String
>
getUserInfo
(
String
userTku
){
network
.
agentCookies
.
put
(
"tku"
,
userTku
);
network
.
agentCookies
.
put
(
"tku"
,
userTku
);
response
=
network
.
getResponse
(
BasicConfig
.
USER_INFO
);
response
=
network
.
getResponse
(
BasicConfig
.
USER_INFO
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
USER_INFO
,
"接口调用失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
USER_INFO
,
"接口调用失败"
,
response
.
body
().
asString
()));
...
@@ -269,10 +269,10 @@ public class ForwardAndRead implements Authorization {
...
@@ -269,10 +269,10 @@ public class ForwardAndRead implements Authorization {
// 解密tku
// 解密tku
public
static
HashMap
<
String
,
Long
>
decodeTku
(
String
tku
){
public
static
HashMap
<
String
,
Long
>
decodeTku
(
String
tku
){
// 登陆管理后台
// 登陆管理后台
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"tku"
,
tku
);
param
.
put
(
"tku"
,
tku
);
Response
response
=
network
.
getResponse
(
param
,
BasicConfig
.
MANAGER_TKU_DECODE
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
MANAGER_TKU_DECODE
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
MANAGER_TKU_DECODE
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
MANAGER_TKU_DECODE
,
"接口请求失败"
,
response
.
body
().
asString
()));
Long
userId
=
response
.
jsonPath
().
getLong
(
"data.userId"
);
Long
userId
=
response
.
jsonPath
().
getLong
(
"data.userId"
);
Long
sellerId
=
response
.
jsonPath
().
getLong
(
"data.sellerId"
);
Long
sellerId
=
response
.
jsonPath
().
getLong
(
"data.sellerId"
);
...
@@ -285,7 +285,7 @@ public class ForwardAndRead implements Authorization {
...
@@ -285,7 +285,7 @@ public class ForwardAndRead implements Authorization {
}
}
// 加密sellerId
// 加密sellerId
public
String
encodeId
(
Long
Id
){
public
static
String
encodeId
(
Long
Id
){
// 登陆管理后台
// 登陆管理后台
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"code"
,
Id
);
param
.
put
(
"code"
,
Id
);
...
@@ -296,7 +296,7 @@ public class ForwardAndRead implements Authorization {
...
@@ -296,7 +296,7 @@ public class ForwardAndRead implements Authorization {
}
}
// 关闭数据看板演示数据
// 关闭数据看板演示数据
public
void
closeDemoData
()
throws
IOException
{
public
static
void
closeDemoData
()
throws
IOException
{
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"configKey"
,
"boss_board_demon_switch"
);
param
.
put
(
"configKey"
,
"boss_board_demon_switch"
);
param
.
put
(
"configValue"
,
false
);
param
.
put
(
"configValue"
,
false
);
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
View file @
a55633c3
...
@@ -19,7 +19,6 @@ import java.util.*;
...
@@ -19,7 +19,6 @@ import java.util.*;
public
class
MyCustomer
implements
Authorization
{
public
class
MyCustomer
implements
Authorization
{
private
Response
response
;
private
Response
response
;
private
Map
<
String
,
Object
>
param
;
private
Map
<
String
,
Object
>
param
;
private
ForwardAndRead
far
;
private
String
createTagId
;
private
String
createTagId
;
private
long
visitor1UserId
;
private
long
visitor1UserId
;
private
String
sessionId
;
private
String
sessionId
;
...
@@ -31,8 +30,6 @@ public class MyCustomer implements Authorization {
...
@@ -31,8 +30,6 @@ public class MyCustomer implements Authorization {
public
void
setUp
()
throws
IOException
{
public
void
setUp
()
throws
IOException
{
BaseUtils
.
ssoLogin
();
BaseUtils
.
ssoLogin
();
visitor2Tku
();
visitor2Tku
();
far
=
new
ForwardAndRead
();
}
}
// 我的客户首页_客户统计
// 我的客户首页_客户统计
...
@@ -85,7 +82,7 @@ public class MyCustomer implements Authorization {
...
@@ -85,7 +82,7 @@ public class MyCustomer implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
String
newTagId
=
response
.
jsonPath
().
getString
(
"data[0].id"
);
String
newTagId
=
response
.
jsonPath
().
getString
(
"data[0].id"
);
String
newTagName
=
response
.
jsonPath
().
getString
(
"data[0].tagName"
);
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
()));
Assert
.
assertEquals
(
newTagName
,
"新标签"
,
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"新增标签名称错误"
,
response
.
body
().
asString
()));
}
}
...
@@ -104,7 +101,7 @@ public class MyCustomer implements Authorization {
...
@@ -104,7 +101,7 @@ public class MyCustomer implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
String
newTagId
=
response
.
jsonPath
().
getString
(
"data[0].id"
);
String
newTagId
=
response
.
jsonPath
().
getString
(
"data[0].id"
);
String
newTagName
=
response
.
jsonPath
().
getString
(
"data[0].tagName"
);
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
()));
Assert
.
assertEquals
(
newTagName
,
"新标签2"
,
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"新增标签名称错误"
,
response
.
body
().
asString
()));
}
}
...
@@ -132,7 +129,7 @@ public class MyCustomer implements Authorization {
...
@@ -132,7 +129,7 @@ public class MyCustomer implements Authorization {
// 我的客户首页_获取全部客户列表_最近访问
// 我的客户首页_获取全部客户列表_最近访问
@Test
(
description
=
"客户列表_最近访问"
,
priority
=
6
)
@Test
(
description
=
"客户列表_最近访问"
,
priority
=
6
)
public
void
客户列表
_
最近访问
()
throws
IOException
{
public
void
客户列表
_
最近访问
()
throws
IOException
{
visitor1UserId
=
far
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
);
visitor1UserId
=
ForwardAndRead
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
);
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageSize"
,
20
);
...
@@ -266,7 +263,7 @@ public class MyCustomer implements Authorization {
...
@@ -266,7 +263,7 @@ public class MyCustomer implements Authorization {
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CUSTOMERSEARCH
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CUSTOMERSEARCH
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"接口请求失败"
,
response
.
body
().
asString
()));
Long
custUserId
=
response
.
jsonPath
().
getLong
(
"data.list[0].userId"
);
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 {
...
@@ -308,7 +305,7 @@ public class MyCustomer implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTINFO
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTINFO
,
"接口请求失败"
,
response
.
body
().
asString
()));
Long
sellerId
=
response
.
jsonPath
().
getLong
(
"data.sellerId"
);
Long
sellerId
=
response
.
jsonPath
().
getLong
(
"data.sellerId"
);
sessionId
=
response
.
jsonPath
().
getString
(
"data.sessionId"
);
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
()));
Assert
.
assertNotNull
(
sessionId
,
network
.
message
(
param
,
BasicConfig
.
CUSTINFO
,
"访客sessionId为空"
,
response
.
body
().
asString
()));
}
}
...
@@ -695,7 +692,7 @@ public class MyCustomer implements Authorization {
...
@@ -695,7 +692,7 @@ public class MyCustomer implements Authorization {
@Test
(
description
=
"客户信息_客户关系链_统计信息"
,
priority
=
38
)
@Test
(
description
=
"客户信息_客户关系链_统计信息"
,
priority
=
38
)
public
void
客户信息
_
客户关系链
_
统计信息
()
throws
IOException
{
public
void
客户信息
_
客户关系链
_
统计信息
()
throws
IOException
{
param
=
new
HashMap
<>();
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
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
RELATIONINFO_HEADER
);
String
name
=
response
.
jsonPath
().
getString
(
"data.name"
);
String
name
=
response
.
jsonPath
().
getString
(
"data.name"
);
Assert
.
assertEquals
(
name
,
BasicConfig
.
WECHAT_NAME
,
network
.
message
(
param
,
BasicConfig
.
RELATIONINFO_HEADER
,
"客户姓名不正确"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
name
,
BasicConfig
.
WECHAT_NAME
,
network
.
message
(
param
,
BasicConfig
.
RELATIONINFO_HEADER
,
"客户姓名不正确"
,
response
.
body
().
asString
()));
...
@@ -705,7 +702,7 @@ public class MyCustomer implements Authorization {
...
@@ -705,7 +702,7 @@ public class MyCustomer implements Authorization {
@Test
(
description
=
"客户信息_客户关系链_人脉列表"
,
priority
=
39
)
@Test
(
description
=
"客户信息_客户关系链_人脉列表"
,
priority
=
39
)
public
void
客户信息
_
客户关系链
_
人脉列表
()
throws
IOException
{
public
void
客户信息
_
客户关系链
_
人脉列表
()
throws
IOException
{
param
=
new
HashMap
<>();
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
(
"type"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageIndex"
,
1
);
...
@@ -794,7 +791,7 @@ public class MyCustomer implements Authorization {
...
@@ -794,7 +791,7 @@ public class MyCustomer implements Authorization {
@Test
(
description
=
"客户详情页_留言_留言对象是否关注公众号"
,
priority
=
44
)
@Test
(
description
=
"客户详情页_留言_留言对象是否关注公众号"
,
priority
=
44
)
public
void
客户详情页
_
留言
_
留言对象是否关注公众号
()
throws
IOException
{
public
void
客户详情页
_
留言
_
留言对象是否关注公众号
()
throws
IOException
{
param
=
new
HashMap
<>();
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
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CHAT_GETSUBSCRIBESTATUS
);
int
subscribe
=
response
.
jsonPath
().
getInt
(
"data.subscribe"
);
int
subscribe
=
response
.
jsonPath
().
getInt
(
"data.subscribe"
);
Assert
.
assertEquals
(
subscribe
,
1
,
network
.
message
(
param
,
BasicConfig
.
CHAT_GETSUBSCRIBESTATUS
,
"判断用户是否关注公众号失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
subscribe
,
1
,
network
.
message
(
param
,
BasicConfig
.
CHAT_GETSUBSCRIBESTATUS
,
"判断用户是否关注公众号失败"
,
response
.
body
().
asString
()));
...
@@ -826,7 +823,7 @@ public class MyCustomer implements Authorization {
...
@@ -826,7 +823,7 @@ public class MyCustomer implements Authorization {
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
();
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
(
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
()));
Assert
.
assertEquals
(
readFlag
,
1
,
network
.
message
(
param
,
BasicConfig
.
CHAT_LIST
,
"消息已读状态错误"
,
response
.
body
().
asString
()));
...
@@ -851,14 +848,14 @@ public class MyCustomer implements Authorization {
...
@@ -851,14 +848,14 @@ public class MyCustomer implements Authorization {
long
receiverId
=
response
.
jsonPath
().
getLong
(
"data.list[0].receiverId"
);
long
receiverId
=
response
.
jsonPath
().
getLong
(
"data.list[0].receiverId"
);
String
content
=
response
.
jsonPath
().
getString
(
"data.list[0].content"
);
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
(
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
()));
Assert
.
assertEquals
(
content
,
"你好"
,
network
.
message
(
param
,
BasicConfig
.
CHAT_NEW
,
"消息内容错误"
,
response
.
body
().
asString
()));
}
}
// 留言_客户接收消息
// 留言_客户接收消息
@Test
(
description
=
"留言_客户接收消息"
,
priority
=
46
)
@Test
(
description
=
"留言_客户接收消息"
,
priority
=
46
)
public
void
留言
_
客户接收消息
()
throws
IOException
{
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
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR1_TKU
);
param
.
clear
();
param
.
clear
();
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/MyForward.java
View file @
a55633c3
...
@@ -20,7 +20,6 @@ public class MyForward implements Authorization {
...
@@ -20,7 +20,6 @@ public class MyForward implements Authorization {
private
Response
response
;
private
Response
response
;
private
Map
<
String
,
Object
>
param
;
private
Map
<
String
,
Object
>
param
;
private
String
visitorEncodeUserId
;
private
String
visitorEncodeUserId
;
private
ForwardAndRead
far
;
@BeforeClass
@BeforeClass
public
void
setUp
()
throws
IOException
{
public
void
setUp
()
throws
IOException
{
...
@@ -28,9 +27,8 @@ public class MyForward implements Authorization {
...
@@ -28,9 +27,8 @@ public class MyForward implements Authorization {
BaseUtils
.
ssoLogin
();
BaseUtils
.
ssoLogin
();
visitor2Tku
();
visitor2Tku
();
far
=
new
ForwardAndRead
();
// 关闭数据看板演示数据
// 关闭数据看板演示数据
far
.
closeDemoData
();
ForwardAndRead
.
closeDemoData
();
}
}
// 进入我的转发页面获取转发统计头部信息
// 进入我的转发页面获取转发统计头部信息
...
@@ -169,7 +167,7 @@ public class MyForward implements Authorization {
...
@@ -169,7 +167,7 @@ public class MyForward implements Authorization {
@Test
(
description
=
"文章详情_头部信息"
,
priority
=
9
)
@Test
(
description
=
"文章详情_头部信息"
,
priority
=
9
)
public
void
文章详情
_
头部信息
()
throws
IOException
{
public
void
文章详情
_
头部信息
()
throws
IOException
{
param
=
new
HashMap
<>();
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
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_CONTENTHEADER
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
FORWARD_CONTENTHEADER
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
FORWARD_CONTENTHEADER
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
clueNum
=
response
.
jsonPath
().
getInt
(
"data.clueNum"
);
int
clueNum
=
response
.
jsonPath
().
getInt
(
"data.clueNum"
);
...
@@ -184,14 +182,14 @@ public class MyForward implements Authorization {
...
@@ -184,14 +182,14 @@ public class MyForward implements Authorization {
@Test
(
description
=
"文章详情_全部访客记录"
,
priority
=
10
)
@Test
(
description
=
"文章详情_全部访客记录"
,
priority
=
10
)
public
void
文章详情
_
全部访客记录
()
throws
IOException
{
public
void
文章详情
_
全部访客记录
()
throws
IOException
{
param
=
new
HashMap
<>();
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
(
"pageSize"
,
20
);
param
.
put
(
"type"
,
1
);
param
.
put
(
"type"
,
1
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
);
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
(
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
()));
Assert
.
assertEquals
(
visitorUserIdEncode
,
visitorEncodeUserId
,
network
.
message
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
,
"转发素材访客记录中首条记录用户userId不正确"
,
response
.
body
().
asString
()));
}
}
...
@@ -199,7 +197,7 @@ public class MyForward implements Authorization {
...
@@ -199,7 +197,7 @@ public class MyForward implements Authorization {
@Test
(
description
=
"文章详情_访客记录_留下线索"
,
priority
=
11
)
@Test
(
description
=
"文章详情_访客记录_留下线索"
,
priority
=
11
)
public
void
文章详情
_
访客记录
_
留下线索
()
throws
IOException
{
public
void
文章详情
_
访客记录
_
留下线索
()
throws
IOException
{
param
=
new
HashMap
<>();
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
(
"pageSize"
,
20
);
param
.
put
(
"type"
,
2
);
param
.
put
(
"type"
,
2
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
);
...
@@ -215,7 +213,7 @@ public class MyForward implements Authorization {
...
@@ -215,7 +213,7 @@ public class MyForward implements Authorization {
@Test
(
description
=
"文章详情_访客记录_转发素材"
,
priority
=
12
)
@Test
(
description
=
"文章详情_访客记录_转发素材"
,
priority
=
12
)
public
void
文章详情
_
访客记录
_
转发素材
()
throws
IOException
{
public
void
文章详情
_
访客记录
_
转发素材
()
throws
IOException
{
param
=
new
HashMap
<>();
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
(
"pageSize"
,
20
);
param
.
put
(
"type"
,
3
);
param
.
put
(
"type"
,
3
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
);
...
@@ -231,7 +229,7 @@ public class MyForward implements Authorization {
...
@@ -231,7 +229,7 @@ public class MyForward implements Authorization {
@Test
(
description
=
"文章详情_访客记录_多度人脉"
,
priority
=
13
)
@Test
(
description
=
"文章详情_访客记录_多度人脉"
,
priority
=
13
)
public
void
文章详情
_
访客记录
_
多度人脉
()
throws
IOException
{
public
void
文章详情
_
访客记录
_
多度人脉
()
throws
IOException
{
param
=
new
HashMap
<>();
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
(
"pageSize"
,
20
);
param
.
put
(
"type"
,
4
);
param
.
put
(
"type"
,
4
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FORWARD_VISITRECORD
);
...
@@ -244,7 +242,7 @@ public class MyForward implements Authorization {
...
@@ -244,7 +242,7 @@ public class MyForward implements Authorization {
@Test
(
description
=
"文章详情_访客记录_转发关系"
,
priority
=
14
)
@Test
(
description
=
"文章详情_访客记录_转发关系"
,
priority
=
14
)
public
void
文章详情
_
访客记录
_
转发关系
()
throws
IOException
{
public
void
文章详情
_
访客记录
_
转发关系
()
throws
IOException
{
param
=
new
HashMap
<>();
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
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageSize"
,
20
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
INVITATIONCHAIN
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
INVITATIONCHAIN
);
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
View file @
a55633c3
This diff is collapsed.
Click to expand it.
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