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
55679348
Commit
55679348
authored
Jul 26, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增我的转发页面+我的客户页面cases
修改谁看过我页面cases
parent
23dfc2d3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
20 deletions
+81
-20
HomePage.java
...com/kjj/cases/assistant/whoSawMe/MyCustomer/HomePage.java
+76
-18
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+5
-2
No files found.
src/test/java/com/kjj/cases/assistant/whoSawMe/MyCustomer/HomePage.java
View file @
55679348
...
...
@@ -11,9 +11,11 @@ import io.restassured.response.Response;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
org.testng.collections.Lists
;
import
java.io.IOException
;
import
java.lang.reflect.AccessibleObject
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -23,7 +25,8 @@ public class HomePage implements Authorization {
private
Response
response
;
private
Map
<
String
,
Object
>
param
;
private
ForwardAndRead
far
;
private
Object
createTagId
;
private
String
createTagId
;
private
long
visitor1_UserId
;
@BeforeClass
public
void
setUp
()
throws
IOException
{
...
...
@@ -95,8 +98,24 @@ public class HomePage implements Authorization {
Assert
.
assertEquals
(
newTagName
,
"新标签2"
,
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"新增标签名称错误"
,
response
.
body
().
asString
()));
}
// 标签管理_删除标签
@Test
(
description
=
"标签管理_删除标签"
,
priority
=
5
)
public
void
标签管理
_
删除标签
()
throws
IOException
{
// 删除标签
param
=
new
HashMap
<>();
List
<
String
>
ids
=
Lists
.
newArrayList
();
ids
.
add
(
createTagId
);
param
.
put
(
"ids"
,
ids
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
TAG_DELETE
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
TAG_DELETE
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
TAG_DELETE
,
"标签删除失败"
,
response
.
body
().
asString
()));
// 查看标签列表
response
=
network
.
getResponse
(
BasicConfig
.
TAG_GETLIST
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
}
// 我的客户首页_获取全部客户列表_最近访问
@Test
(
description
=
"客户列表_最近访问"
,
priority
=
3
)
@Test
(
description
=
"客户列表_最近访问"
,
priority
=
6
)
public
void
客户列表
_
最近访问
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
...
...
@@ -109,7 +128,7 @@ public class HomePage implements Authorization {
}
// 我的客户首页_获取全部客户列表_按照访问次数排列
@Test
(
description
=
"客户列表_访问次数"
,
priority
=
4
)
@Test
(
description
=
"客户列表_访问次数"
,
priority
=
7
)
public
void
客户列表
_
访问次数
()
throws
IOException
{
// 降序排列
param
=
new
HashMap
<>();
...
...
@@ -143,7 +162,7 @@ public class HomePage implements Authorization {
}
// 我的客户首页_获取全部客户列表_按客户意向排列
@Test
(
description
=
"客户列表_客户意向"
,
priority
=
5
)
@Test
(
description
=
"客户列表_客户意向"
,
priority
=
8
)
public
void
客户列表
_
客户意向
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
...
...
@@ -161,7 +180,7 @@ public class HomePage implements Authorization {
}
//我的客户首页_获取客户列表_特别关注客户
@Test
(
description
=
"客户列表_特别关注"
,
priority
=
6
)
@Test
(
description
=
"客户列表_特别关注"
,
priority
=
9
)
public
void
客户列表
_
特别关注
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"isSpecialCustomer"
,
1
);
...
...
@@ -175,7 +194,7 @@ public class HomePage implements Authorization {
}
// 我的客户首页_获取客户列表_筛选客户
@Test
(
description
=
"客户列表_七日活跃"
,
priority
=
7
)
@Test
(
description
=
"客户列表_七日活跃"
,
priority
=
10
)
public
void
客户列表
_
七日活跃
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"activeType"
,
1
);
...
...
@@ -189,7 +208,7 @@ public class HomePage implements Authorization {
}
// 我的客户首页_获取客户列表_筛选客户
@Test
(
description
=
"客户列表_直接转发"
,
priority
=
8
)
@Test
(
description
=
"客户列表_直接转发"
,
priority
=
11
)
public
void
客户列表
_
直接转发
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custOrigin"
,
1
);
...
...
@@ -203,7 +222,7 @@ public class HomePage implements Authorization {
}
// 我的客户首页_获取客户列表_筛选客户
@Test
(
description
=
"客户列表_好友转发"
,
priority
=
9
)
@Test
(
description
=
"客户列表_好友转发"
,
priority
=
12
)
public
void
客户列表
_
好友转发
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custOrigin"
,
2
);
...
...
@@ -212,12 +231,13 @@ public class HomePage implements Authorization {
param
.
put
(
"sortType"
,
3
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CUSTOMERSEARCH
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"接口请求失败"
,
response
.
body
().
asString
()));
System
.
out
.
println
(
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
,
far
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"
通过
好友转发的访客userId与预期不一致"
,
response
.
body
().
asString
()));
}
// 我的客户首页_搜索客户
@Test
(
description
=
"搜索客户"
,
priority
=
20
)
@Test
(
description
=
"搜索客户"
,
priority
=
13
)
public
void
客户列表
_
搜索客户
()
throws
IOException
{
param
=
new
HashMap
<>();
// 获取用户微信昵称
...
...
@@ -235,12 +255,14 @@ public class HomePage implements Authorization {
}
// 客户详情页_头部信息栏
@Test
(
description
=
"客户详情页_头部信息栏"
,
priority
=
1
0
)
@Test
(
description
=
"客户详情页_头部信息栏"
,
priority
=
1
4
)
public
void
客户详情页
_
头部信息栏
()
throws
IOException
{
visitor1_UserId
=
far
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
);
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
far
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
)
);
param
.
put
(
"custUserId"
,
visitor1_UserId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTINFOHEADER
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTINFOHEADER
,
"接口请求失败"
,
response
.
body
().
asString
()));
System
.
out
.
println
(
response
.
body
().
asString
());
List
<
CustOrigins
>
custOrigins
=
JsonUtil
.
parseResponseToPageBean
(
response
,
CustOrigins
.
class
);
Assert
.
assertEquals
(
custOrigins
.
size
(),
3
,
network
.
message
(
param
,
BasicConfig
.
CUSTINFOHEADER
,
"用户被邀链路长度不为3"
,
response
.
body
().
asString
()));
Long
selfUserId
=
custOrigins
.
get
(
2
).
getUserId
();
...
...
@@ -252,10 +274,10 @@ public class HomePage implements Authorization {
}
// 客户详情页_客户信息
@Test
(
description
=
"客户详情页_客户信息"
,
priority
=
2
)
@Test
(
description
=
"客户详情页_客户信息"
,
priority
=
15
)
public
void
客户详情页
_
客户信息
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"userId"
,
far
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
)
);
param
.
put
(
"userId"
,
visitor1_UserId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTINFO
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTINFO
,
"接口请求失败"
,
response
.
body
().
asString
()));
List
<
CustOrigins
>
origins
=
JsonUtil
.
parseResponseToPageBean
(
response
,
CustOrigins
.
class
);
...
...
@@ -268,10 +290,10 @@ public class HomePage implements Authorization {
}
// 客户详情页_意向详情
@Test
(
description
=
"客户详情页_意向详情"
,
priority
=
3
)
@Test
(
description
=
"客户详情页_意向详情"
,
priority
=
16
)
public
void
客户详情页
_
意向详情
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"userId"
,
far
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
)
);
param
.
put
(
"userId"
,
visitor1_UserId
);
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"
);
...
...
@@ -279,13 +301,49 @@ public class HomePage implements Authorization {
}
// 客户详情页_人脉统计
@Test
(
description
=
"客户详情页_人脉统计"
,
priority
=
4
)
@Test
(
description
=
"客户详情页_人脉统计"
,
priority
=
17
)
public
void
客户详情页
_
人脉统计
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
far
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
)
);
param
.
put
(
"custUserId"
,
visitor1_UserId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTRELATION
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTRELATION
,
"接口请求失败"
,
response
.
body
().
asString
()));
Integer
num
=
response
.
jsonPath
().
getInt
(
"data.hasNew"
);
Assert
.
assertNotNull
(
num
,
network
.
message
(
param
,
BasicConfig
.
CUSTRELATION
,
"客户人脉统计数量为null"
,
response
.
body
().
asString
()));
}
// 客户详情页_阅读偏好
@Test
(
description
=
"客户详情页_阅读偏好"
,
priority
=
18
)
public
void
客户详情页
_
阅读偏好
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1_UserId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTREADPERFERENCE
);
System
.
out
.
println
(
response
.
body
().
asString
());
}
// 客户详情页_最近线索
@Test
(
description
=
"获取客户最近线索统计"
,
priority
=
19
)
public
void
获取客户最近线索统计
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1_UserId
);
param
.
put
(
"type"
,
2
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTSTATISTIC
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTSTATISTIC
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
welfareInsuranceNum
=
response
.
jsonPath
().
getInt
(
"data.welfareInsuranceNum"
);
Assert
.
assertTrue
(
welfareInsuranceNum
>=
1
,
network
.
message
(
param
,
BasicConfig
.
CLUESTATISTICS
,
"客户最近领取赠险次数小于1"
,
response
.
body
().
asString
()));
}
// 客户详情页_最近访问详情列表
@Test
(
description
=
"客户详情页_最近访问详情列表"
,
priority
=
20
)
public
void
客户详情页
_
最近访问详情列表
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"custUserId"
,
visitor1_UserId
);
param
.
put
(
"filterType"
,
1
);
param
.
put
(
"timeType"
,
2
);
param
.
put
(
"timeOrderType"
,
2
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTVISITLIST
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTVISITLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
System
.
out
.
println
(
response
.
body
().
asString
());
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
55679348
...
...
@@ -73,6 +73,8 @@ public class BasicConfig {
public
static
String
VISITOR_TKU
=
"T3gM31f18jCGvqvoyJRzyMTdpcPDJWUJJP4VQje7p9sfC4HKmj5NJfCUkxusAyFb5SpkWS31srDTYr6KtV"
;
// 基础线访客(小雪人) TKU
public
static
String
VISITOR1_TKU
=
"T3gM31f18jCFXzk692pKjJCqJZdDv8Nb3htkzNk983cPMspUQD6pVEn2FNMefM2nieKPicXG9c1tDg8qtN"
;
// 基础线访客(做二度访客) TKU
public
static
String
VISITOR2_TKU
=
""
;
// 访客的sids
public
static
final
String
sids
=
"Kj21MjMwNTU"
;
// 访客的userId(固定)
...
...
@@ -718,7 +720,7 @@ public class BasicConfig {
public
static
final
String
CLUESTATISTICS
=
HOST
+
"/kjy/mp/whoSawMe/clue/statistics"
;
public
static
final
String
CUSTRELATION
=
HOST
+
"/kjy/mp/seller/customer/relation"
;
public
static
final
String
CUSTOMERSTATISTICS
=
HOST
+
"/kjy/mp/whoSawMe/customerStatistics"
;
public
static
final
String
CUSTREADPERFERENCE
=
HOST
+
"
n
/kjy/mp/seller/customer/getReadPerference"
;
public
static
final
String
CUSTREADPERFERENCE
=
HOST
+
"/kjy/mp/seller/customer/getReadPerference"
;
public
static
final
String
CUSTSTATISTIC
=
HOST
+
"/kjy/mp/whoSawMe/customerInfo/statistic"
;
public
static
final
String
CUSTVISITLIST
=
HOST
+
"/kjy/mp/whoSawMe/customerInfo/list"
;
public
static
final
String
ISDISPLAYSPECIAL
=
HOST
+
"/kjy/mp/whoSawMe/isDisplaySpecialCustomerLayer"
;
...
...
@@ -726,7 +728,8 @@ public class BasicConfig {
public
static
final
String
INVITATIONCHAIN
=
HOST
+
"/kjy/mp/whoSawMe/forward/forwardList"
;
// *************** 标签管理 ***************
public
static
final
String
TAG_ADDORUPDATE
=
HOST
+
"/kjy/mp/sellerTag/addOrUpdateTag"
;
public
static
final
String
TAG_GETLIST
=
HOST
+
"kjy/mp/sellerTag/getTagList"
;
public
static
final
String
TAG_GETLIST
=
HOST
+
"/kjy/mp/sellerTag/getTagList"
;
public
static
final
String
TAG_DELETE
=
HOST
+
"/kjy/mp/sellerTag/deleteTag"
;
// *************** 文章 ***************
...
...
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