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
5e6a7d12
Commit
5e6a7d12
authored
Jul 28, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码存档
parent
4254bf77
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
927 additions
and
152 deletions
+927
-152
ArticlePage.java
src/test/java/com/kjj/bean/assistant/ArticlePage.java
+9
-0
RankingList.java
src/test/java/com/kjj/bean/assistant/RankingList.java
+8
-0
Authorization.java
src/test/java/com/kjj/cases/admin/Authorization.java
+88
-48
GameLottery.java
...java/com/kjj/cases/assistant/markettools/GameLottery.java
+2
-2
GreetingCrad.java
...ava/com/kjj/cases/assistant/markettools/GreetingCrad.java
+1
-1
ForwardAndRead.java
...java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
+17
-5
MyCustomer.java
...est/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
+442
-0
MyForward.java
...test/java/com/kjj/cases/assistant/whoSawMe/MyForward.java
+1
-3
WhoSawMe.java
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
+315
-91
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+44
-2
No files found.
src/test/java/com/kjj/bean/assistant/ArticlePage.java
0 → 100644
View file @
5e6a7d12
package
com
.
kjj
.
bean
.
assistant
;
import
lombok.Data
;
@Data
public
class
ArticlePage
{
private
String
contentType
;
private
String
contentId
;
}
src/test/java/com/kjj/bean/assistant/RankingList.java
0 → 100644
View file @
5e6a7d12
package
com
.
kjj
.
bean
.
assistant
;
import
lombok.Data
;
@Data
public
class
RankingList
{
private
String
sellerId
;
}
src/test/java/com/kjj/cases/admin/Authorization.java
View file @
5e6a7d12
...
@@ -20,8 +20,9 @@ public interface Authorization {
...
@@ -20,8 +20,9 @@ public interface Authorization {
System
.
out
.
println
(
"用户AUTH_KEY:"
+
ADMIN_KEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
ADMIN_KEY
);
}
}
/**
/**
* 集客助手
相关
授权
* 集客助手授权
*/
*/
//代理人
//代理人
default
void
agentTku
()
{
default
void
agentTku
()
{
...
@@ -30,191 +31,230 @@ public interface Authorization {
...
@@ -30,191 +31,230 @@ public interface Authorization {
}
}
// 获取访客tku:Su Yi
//代理人
default
void
userTku
()
{
default
void
visitor2Tku
()
{
network
.
agentCookies
.
put
(
"tku"
,
VISITOR_UserTku
);
network
.
agentCookies
.
put
(
"tku"
,
VISITOR2_TKU
);
System
.
out
.
println
(
"访客tku:"
+
VISITOR_UserTku
);
System
.
out
.
println
(
"代理人tku:"
+
VISITOR2_TKU
);
}
}
// 获取访客tku
:请勿打扰
// 获取访客tku
default
void
userTku
1
()
{
default
void
userTku
()
{
network
.
agentCookies
.
put
(
"tku"
,
VISITOR_TKU
);
network
.
agentCookies
.
put
(
"tku"
,
VISITOR_TKU
);
System
.
out
.
println
(
"访客tku:"
+
VISITOR_TKU
);
System
.
out
.
println
(
"访客tku:"
+
VISITOR_TKU
);
}
}
// 获取访客tku:小雪人
default
void
userTku2
()
{
network
.
agentCookies
.
put
(
"tku"
,
VISITOR1_TKU
);
System
.
out
.
println
(
"访客tku:"
+
VISITOR1_TKU
);
}
/**
/**
*
直播业务相关
*
代理人(yl)授权,ID:826
*/
*/
//代理人(yl)授权,ID:826
default
void
agentAuth
(){
default
void
agentAuth
(){
// 创建用户 并传到network里
// 创建用户 并传到network里
network
.
agentCookies
.
put
(
"authKey"
,
AUTH_KEY
);
network
.
agentCookies
.
put
(
"authKey"
,
AUTH_KEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
AUTH_KEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
AUTH_KEY
);
}
}
/**
//代理人(小疙瘩人寿)授权,ID:995
* 代理人(小疙瘩人寿)授权,ID:995
*/
default
void
agentAuth1
(){
default
void
agentAuth1
(){
// 创建用户 并传到network里
// 创建用户 并传到network里
network
.
agentCookies
.
put
(
"authKey"
,
agentAuth
);
network
.
agentCookies
.
put
(
"authKey"
,
agentAuth
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
agentAuth
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
agentAuth
);
}
}
//访客A(志勇)授权,代理人指定中奖用户,ID:107
/**
* 访客A(志勇)授权,代理人指定中奖用户,ID:107
*/
default
void
visitorAuth
()
{
default
void
visitorAuth
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth
);
}
}
//访客B(茶仔)授权,用户ID:122
/**
* 访客B(茶仔)授权,用户ID:122
*/
default
void
visitorAuth2
()
{
default
void
visitorAuth2
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth2
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth2
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth2
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth2
);
}
}
//访客C(刘超)授权,地域指定用户ID:811
/**
* 访客C(刘超)授权,地域指定用户ID:811
*/
default
void
visitorAuth3
()
{
default
void
visitorAuth3
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth3
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth3
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth3
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth3
);
}
}
//访客D(李执)授权,地域指定用户ID:89
/**
* 访客D(李执)授权,地域指定用户ID:89
*/
default
void
visitorAuth4
()
{
default
void
visitorAuth4
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth4
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth4
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth4
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth4
);
}
}
/**
//访客E(周成)授权,企业指定中奖用户,用户ID:812
* 访客E(周成)授权,企业指定中奖用户,用户ID:812
*/
default
void
visitorAuth5
()
{
default
void
visitorAuth5
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth5
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth5
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth5
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth5
);
}
}
//访客F(新强)授权,用户ID:82
/**
* 访客F(新强)授权,用户ID:82
*/
default
void
visitorAuth6
()
{
default
void
visitorAuth6
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth6
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth6
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth6
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth6
);
}
}
//访客G(熊二)授权,黑名单用户,ID:719
/**
* 访客G(熊二)授权,黑名单用户,ID:719
*/
default
void
visitorAuth7
()
{
default
void
visitorAuth7
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth7
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth7
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth7
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth7
);
}
}
//访客I(熊大)授权 ID:1239
/**
* 访客I(熊大)授权 ID:1239
*/
default
void
visitorAuth8
()
{
default
void
visitorAuth8
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth8
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth8
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth8
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth8
);
}
}
/**
//访客H(吉吉)非实名用户授权,ID:907
* 访客H(吉吉)非实名用户授权,ID:907
*/
default
void
visitorAuth9
()
{
default
void
visitorAuth9
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth9
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth9
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth9
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth9
);
}
}
//访客J(日落)授权,ID:703
/**
* 访客J(日落)授权,ID:703
*/
default
void
visitorAuth10
()
{
default
void
visitorAuth10
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth10
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth10
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth10
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth10
);
}
}
//访客K(沈小四)授权,ID:108
/**
* 访客K(沈小四)授权,ID:108
*/
default
void
visitorAuth11
()
{
default
void
visitorAuth11
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth11
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth11
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth11
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth11
);
}
}
//访客L(饺子)授权,ID:97
/**
* 访客L(饺子)授权,ID:97
*/
default
void
visitorAuth12
()
{
default
void
visitorAuth12
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth12
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth12
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth12
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth12
);
}
}
//访客M(大妹子)非实名用户授权,ID:299
/**
* 访客M(大妹子)非实名用户授权,ID:299
*/
default
void
visitorAuth13
()
{
default
void
visitorAuth13
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth13
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth13
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth13
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth13
);
}
}
//访客N(光头强)非实名用户授权,ID:540
/**
* 访客N(光头强)非实名用户授权,ID:540
*/
default
void
visitorAuth14
()
{
default
void
visitorAuth14
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth14
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth14
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth14
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth14
);
}
}
//访客O(少侠)授权,ID:79
/**
* 访客O(少侠)授权,ID:79
*/
default
void
visitorAuth15
()
{
default
void
visitorAuth15
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth15
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth15
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth15
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth15
);
}
}
//访客P(抬头有飞碟)授权,ID:99
/**
* 访客P(抬头有飞碟)授权,ID:99
*/
default
void
visitorAuth16
()
{
default
void
visitorAuth16
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth16
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth16
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth16
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth16
);
}
}
//访客Q(枫城)授权,ID:77
/**
* 访客Q(枫城)授权,ID:77
*/
default
void
visitorAuth17
()
{
default
void
visitorAuth17
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth17
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth17
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth17
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth17
);
}
}
//访客R(小老弟来了)非实名用户授权,ID:94
/**
* 访客R(小老弟来了)非实名用户授权,ID:94
*/
default
void
visitorAuth18
()
{
default
void
visitorAuth18
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth18
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth18
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth18
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth18
);
}
}
//访客T(林国芸)ID:786
/**
* 访客T(林国芸)ID:786
*/
default
void
visitorAuth19
()
{
default
void
visitorAuth19
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth19
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth19
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth19
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth19
);
}
}
//访客Y(孙心桂)ID:785
/**
* 访客Y(孙心桂)ID:785
*/
default
void
visitorAuth20
()
{
default
void
visitorAuth20
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth20
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth20
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth20
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth20
);
}
}
//访客W(谢翊美)ID:791
/**
* 访客W(谢翊美)ID:791
*/
default
void
visitorAuth21
()
{
default
void
visitorAuth21
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth21
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth21
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth21
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth21
);
}
}
//访客V(zzz666)ID:849
/**
* 访客V(zzz666)ID:849
*/
default
void
visitorAuth22
()
{
default
void
visitorAuth22
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth22
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth22
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth22
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth22
);
}
}
//访客u(七凉)ID:179
/**
* 访客u(七凉)ID:179
*/
default
void
visitorAuth23
()
{
default
void
visitorAuth23
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth23
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth23
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth23
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth23
);
}
}
//访客S(奶汪)ID:1170 实名
/**
* 访客S(奶汪)ID:1170 实名
*/
default
void
visitorAuth24
()
{
default
void
visitorAuth24
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth24
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth24
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth24
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth24
);
}
}
//访客S(亦心)ID:96 实名
/**
* 访客S(亦心)ID:96 实名
*/
default
void
visitorAuth25
()
{
default
void
visitorAuth25
()
{
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth25
);
network
.
agentCookies
.
put
(
"authKey"
,
visitorAuth25
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth25
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
visitorAuth25
);
...
...
src/test/java/com/kjj/cases/assistant/markettools/GameLottery.java
View file @
5e6a7d12
...
@@ -298,7 +298,7 @@ public class GameLottery implements Authorization {
...
@@ -298,7 +298,7 @@ public class GameLottery implements Authorization {
@Test
(
description
=
"访客_打开抽奖链接"
,
priority
=
13
)
@Test
(
description
=
"访客_打开抽奖链接"
,
priority
=
13
)
public
void
访客
_
打开抽奖链接
(){
public
void
访客
_
打开抽奖链接
(){
//切换为访客-请勿打扰
//切换为访客-请勿打扰
userTku1
();
//
userTku1();
//添加访问记录
//添加访问记录
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
...
@@ -541,7 +541,7 @@ public class GameLottery implements Authorization {
...
@@ -541,7 +541,7 @@ public class GameLottery implements Authorization {
@Test
(
description
=
"访客_第二个客户未中奖"
,
priority
=
21
)
@Test
(
description
=
"访客_第二个客户未中奖"
,
priority
=
21
)
public
void
访客
_
第二个客户未中奖
(){
public
void
访客
_
第二个客户未中奖
(){
//切换为请勿打扰
//切换为请勿打扰
userTku1
();
//
userTku1();
//添加访问记录
//添加访问记录
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
...
...
src/test/java/com/kjj/cases/assistant/markettools/GreetingCrad.java
View file @
5e6a7d12
...
@@ -658,7 +658,7 @@ public class GreetingCrad implements Authorization{
...
@@ -658,7 +658,7 @@ public class GreetingCrad implements Authorization{
@Test
(
description
=
"访客_礼物被领取完领取失败"
,
priority
=
35
)
@Test
(
description
=
"访客_礼物被领取完领取失败"
,
priority
=
35
)
public
void
访客
_
礼物被领取完领取失败
(){
public
void
访客
_
礼物被领取完领取失败
(){
//切换为访客
//切换为访客
userTku1
();
//
userTku1();
//查看阅读记录
//查看阅读记录
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/ForwardAndRead.java
View file @
5e6a7d12
...
@@ -24,7 +24,7 @@ public class ForwardAndRead implements Authorization {
...
@@ -24,7 +24,7 @@ public class ForwardAndRead implements Authorization {
@BeforeClass
@BeforeClass
public
void
setUp
()
throws
IOException
{
public
void
setUp
()
throws
IOException
{
agent
Tku
();
visitor2
Tku
();
BaseUtils
.
ssoLogin
();
BaseUtils
.
ssoLogin
();
}
}
...
@@ -58,8 +58,8 @@ public class ForwardAndRead implements Authorization {
...
@@ -58,8 +58,8 @@ public class ForwardAndRead implements Authorization {
// 访客访问素材及产生线索
// 访客访问素材及产生线索
@Test
(
description
=
"访客阅读文章"
,
priority
=
3
)
@Test
(
description
=
"访客阅读文章"
,
priority
=
3
)
public
void
访客阅读文章
()
throws
IOException
{
public
void
访客阅读文章
()
throws
IOException
{
sellerId
=
(
Long
)
getUserInfo
(
BasicConfig
.
AGENT
_TKU
).
get
(
"sellerId"
);
sellerId
=
(
Long
)
getUserInfo
(
BasicConfig
.
VISITOR2
_TKU
).
get
(
"sellerId"
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR
_TKU
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
AGENT
_TKU
);
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"scid"
,
articleScId
);
param
.
put
(
"scid"
,
articleScId
);
param
.
put
(
"fromUserId"
,
sellerId
);
param
.
put
(
"fromUserId"
,
sellerId
);
...
@@ -73,6 +73,8 @@ public class ForwardAndRead implements Authorization {
...
@@ -73,6 +73,8 @@ public class ForwardAndRead implements Authorization {
@Test
(
description
=
"访客领取赠险"
,
priority
=
4
)
@Test
(
description
=
"访客领取赠险"
,
priority
=
4
)
public
void
领取赠险
()
throws
IOException
{
public
void
领取赠险
()
throws
IOException
{
response
=
network
.
getResponse
(
BasicConfig
.
USER_INFO
);
System
.
out
.
println
(
response
.
body
().
asString
());
// 获取赠险insuranceId
// 获取赠险insuranceId
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"scid"
,
articleScId
);
param
.
put
(
"scid"
,
articleScId
);
...
@@ -94,6 +96,16 @@ public class ForwardAndRead implements Authorization {
...
@@ -94,6 +96,16 @@ public class ForwardAndRead implements Authorization {
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 = 5)
// public void 增加动态访问记录() throws IOException{
// param = new HashMap<>();
// param.put("scid", articleScId);
// response = network.postResponse(param, BasicConfig.DYNAMIC_ADDVISIT);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.DYNAMIC_ADDVISIT, "接口请求失败", response.body().asString()));
// Assert.assertTrue(response.jsonPath().getBoolean("data"), network.message(param, BasicConfig.DYNAMIC_ADDVISIT, "增加访问记录失败", response.body().asString()));
// }
@Test
(
description
=
"访客转发文章"
,
priority
=
5
)
@Test
(
description
=
"访客转发文章"
,
priority
=
5
)
public
void
访客转发文章
()
throws
IOException
{
public
void
访客转发文章
()
throws
IOException
{
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
...
@@ -108,7 +120,7 @@ public class ForwardAndRead implements Authorization {
...
@@ -108,7 +120,7 @@ public class ForwardAndRead implements Authorization {
@Test
(
description
=
"二度访客阅读文章"
,
priority
=
6
)
@Test
(
description
=
"二度访客阅读文章"
,
priority
=
6
)
public
void
二度访客阅读文章
()
throws
IOException
{
public
void
二度访客阅读文章
()
throws
IOException
{
Long
fromUserId
=
decodeTku
(
BasicConfig
.
VISITOR
_TKU
).
get
(
"sellerId"
);
Long
fromUserId
=
decodeTku
(
BasicConfig
.
AGENT
_TKU
).
get
(
"sellerId"
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR1_TKU
);
// 切换二度访客
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR1_TKU
);
// 切换二度访客
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"scid"
,
articleScId
);
param
.
put
(
"scid"
,
articleScId
);
...
@@ -158,7 +170,7 @@ public class ForwardAndRead implements Authorization {
...
@@ -158,7 +170,7 @@ public class ForwardAndRead implements Authorization {
infos
.
put
(
"wxName"
,
wxName
);
infos
.
put
(
"wxName"
,
wxName
);
infos
.
put
(
"sellerId"
,
sellerId
);
infos
.
put
(
"sellerId"
,
sellerId
);
infos
.
put
(
"userId"
,
userId
);
infos
.
put
(
"userId"
,
userId
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
AGENT
_TKU
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR2
_TKU
);
return
infos
;
return
infos
;
}
}
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/MyCustomer.java
0 → 100644
View file @
5e6a7d12
package
com
.
kjj
.
cases
.
assistant
.
whoSawMe
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.JsonUtil
;
import
com.kjj.utils.ThreadSleepUtils
;
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.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
// 我的客户-首页
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
;
private
int
visitCount
;
@BeforeClass
public
void
setUp
()
throws
IOException
{
BaseUtils
.
ssoLogin
();
visitor2Tku
();
far
=
new
ForwardAndRead
();
}
// 我的客户首页_客户统计
@Test
(
description
=
"首页_客户统计"
,
priority
=
1
)
public
void
首页
_
客户统计
()
throws
IOException
{
response
=
network
.
getResponse
(
BasicConfig
.
CUSTOMERSTATISTICS
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
CUSTOMERSTATISTICS
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
sevenDaysActiveCount
=
response
.
jsonPath
().
getInt
(
"data.sevenDaysActiveCount"
);
int
totalCount
=
response
.
jsonPath
().
getInt
(
"data.totalCount"
);
Assert
.
assertTrue
(
sevenDaysActiveCount
>=
1
,
network
.
message
(
BasicConfig
.
CUSTOMERSTATISTICS
,
"七日活跃客户数小于1"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
totalCount
>=
1
,
network
.
message
(
BasicConfig
.
CUSTOMERSTATISTICS
,
"累计获客数小于1"
,
response
.
body
().
asString
()));
}
// 我的客户首页_查询未读信息
@Test
(
description
=
"首页_查询未读信息"
,
priority
=
2
)
public
void
首页
_
查询未读信息
()
throws
IOException
{
response
=
network
.
getResponse
(
BasicConfig
.
SELLERUNREADMESSAGE
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
SELLERUNREADMESSAGE
,
"接口请求失败"
,
response
.
body
().
asString
()));
Object
unreadCount
=
response
.
jsonPath
().
getJsonObject
(
"data.unreadCount"
);
Assert
.
assertNotNull
(
unreadCount
,
network
.
message
(
BasicConfig
.
SELLERUNREADMESSAGE
,
"获取未读消息数失败"
,
response
.
body
().
asString
()));
}
// 标签管理页_新建标签
@Test
(
description
=
"标签管理_新建标签"
,
priority
=
3
)
public
void
标签管理
_
新建标签
()
throws
IOException
{
// 添加标签
param
=
new
HashMap
<>();
param
.
put
(
"tagName"
,
"新标签"
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
TAG_ADDORUPDATE
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
TAG_ADDORUPDATE
,
"接口请求失败"
,
response
.
body
().
asString
()));
createTagId
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
createTagId
,
network
.
message
(
param
,
BasicConfig
.
TAG_ADDORUPDATE
,
"data数据为空"
,
response
.
body
().
asString
()));
// 查看标签列表
response
=
network
.
getResponse
(
BasicConfig
.
TAG_GETLIST
);
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
(
newTagName
,
"新标签"
,
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"新增标签名称错误"
,
response
.
body
().
asString
()));
}
// 标签管理_修改标签
@Test
(
description
=
"标签管理_修改标签"
,
priority
=
4
)
public
void
标签管理
_
修改标签
()
throws
IOException
{
// 修改标签
param
=
new
HashMap
<>();
param
.
put
(
"id"
,
createTagId
);
param
.
put
(
"tagName"
,
"新标签2"
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
TAG_ADDORUPDATE
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
TAG_ADDORUPDATE
,
"接口请求失败"
,
response
.
body
().
asString
()));
// 查看标签列表
response
=
network
.
getResponse
(
BasicConfig
.
TAG_GETLIST
);
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
(
newTagName
,
"新标签2"
,
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"新增标签名称错误"
,
response
.
body
().
asString
()));
}
// 标签管理_删除标签
@Test
(
description
=
"标签管理_删除标签"
,
priority
=
5
)
public
void
标签管理
_
删除标签
()
throws
IOException
{
// 删除标签
List
<
String
>
ids
=
Lists
.
newArrayList
();
ids
.
add
(
createTagId
);
param
=
new
HashMap
<>();
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
);
List
<
Object
>
tagLists
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
for
(
int
i
=
0
;
i
<
tagLists
.
size
();
i
++){
String
tagId
=
response
.
jsonPath
().
getString
(
"data["
+
i
+
"].id"
);
Assert
.
assertNotEquals
(
tagId
,
createTagId
,
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"标签未删除成功"
,
response
.
body
().
asString
()));
}
}
// 我的客户首页_获取全部客户列表_最近访问
@Test
(
description
=
"客户列表_最近访问"
,
priority
=
6
)
public
void
客户列表
_
最近访问
()
throws
IOException
{
visitor1UserId
=
far
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
);
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"sortType"
,
3
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CUSTOMERSEARCH
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"接口请求失败"
,
response
.
body
().
asString
()));
long
userId
=
response
.
jsonPath
().
getLong
(
"data.list[0].userId"
);
System
.
out
.
println
(
userId
);
Assert
.
assertEquals
(
userId
,
visitor1UserId
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"最新访问记录首位用户userId错误"
,
response
.
body
().
asString
()));
}
// 我的客户首页_获取全部客户列表_按照访问次数排列
@Test
(
description
=
"客户列表_访问次数"
,
priority
=
7
)
public
void
客户列表
_
访问次数
()
throws
IOException
{
// 降序排列
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"sortType"
,
1
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CUSTOMERSEARCH
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
visitCountFirst
=
response
.
jsonPath
().
getInt
(
"data.list[0].visitCount"
);
int
visitCountSecond
=
response
.
jsonPath
().
getInt
(
"data.list[1].visitCount"
);
int
visitCountThird
=
response
.
jsonPath
().
getInt
(
"data.list[2].visitCount"
);
boolean
compareOne
=
visitCountFirst
>=
visitCountSecond
;
boolean
compareTwo
=
visitCountSecond
>=
visitCountThird
;
Assert
.
assertTrue
(
compareOne
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"访问次数筛选结果排列顺序错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
compareTwo
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"访问次数筛选结果排列顺序错误"
,
response
.
body
().
asString
()));
// 升序排列
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"sortType"
,
2
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CUSTOMERSEARCH
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"接口请求失败"
,
response
.
body
().
asString
()));
visitCountFirst
=
response
.
jsonPath
().
getInt
(
"data.list[0].visitCount"
);
visitCountSecond
=
response
.
jsonPath
().
getInt
(
"data.list[1].visitCount"
);
visitCountThird
=
response
.
jsonPath
().
getInt
(
"data.list[2].visitCount"
);
compareOne
=
visitCountFirst
<=
visitCountSecond
;
compareTwo
=
visitCountSecond
<=
visitCountThird
;
Assert
.
assertTrue
(
compareOne
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"访问次数筛选结果排列顺序错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
compareTwo
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"访问次数筛选结果排列顺序错误"
,
response
.
body
().
asString
()));
}
// 我的客户首页_获取全部客户列表_按客户意向排列
@Test
(
description
=
"客户列表_客户意向"
,
priority
=
8
)
public
void
客户列表
_
客户意向
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"sortType"
,
5
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CUSTOMERSEARCH
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
customerIntentionFirst
=
response
.
jsonPath
().
getInt
(
"data.list[0].customerIntention"
);
int
customerIntentionSecond
=
response
.
jsonPath
().
getInt
(
"data.list[1].customerIntention"
);
int
customerIntentionThird
=
response
.
jsonPath
().
getInt
(
"data.list[2].customerIntention"
);
boolean
compareOne
=
customerIntentionFirst
>=
customerIntentionSecond
;
boolean
compareTwo
=
customerIntentionSecond
>=
customerIntentionThird
;
Assert
.
assertTrue
(
compareOne
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"客户意向筛选结果排列顺序错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
compareTwo
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"客户意向筛选结果排列顺序错误"
,
response
.
body
().
asString
()));
}
//我的客户首页_获取客户列表_特别关注客户
@Test
(
description
=
"客户列表_特别关注"
,
priority
=
10
)
public
void
客户列表
_
特别关注
()
throws
IOException
{
ThreadSleepUtils
.
sleep
(
5000
);
param
=
new
HashMap
<>();
param
.
put
(
"isSpecialCustomer"
,
1
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"sortType"
,
3
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CUSTOMERSEARCH
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"接口请求失败"
,
response
.
body
().
asString
()));
long
userId
=
response
.
jsonPath
().
getLong
(
"data.list[0].userId"
);
Assert
.
assertEquals
(
userId
,
visitor1UserId
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"客户userId不匹配"
,
response
.
body
().
asString
()));
List
<
Object
>
specialCustLists
=
response
.
jsonPath
().
getJsonObject
(
"data.list"
);
for
(
int
i
=
0
;
i
<
specialCustLists
.
size
();
i
++){
int
isSpecialCustomer
=
response
.
jsonPath
().
getInt
(
"data.list["
+
i
+
"].isSpecialCustomer"
);
Assert
.
assertEquals
(
isSpecialCustomer
,
1
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"筛选结果包含非特殊关注客户"
,
response
.
body
().
asString
()));
}
// 特别关注客户总数
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"sortType"
,
3
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
totalSpecial
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
totalSpecial
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
specialCustomerTotal
=
response
.
jsonPath
().
getInt
(
"data.specialCustomerTotal"
);
Assert
.
assertEquals
(
specialCustomerTotal
,
specialCustLists
.
size
(),
network
.
message
(
param
,
BasicConfig
.
totalSpecial
,
"特别关注客户总数错误"
,
response
.
body
().
asString
()));
}
// 我的客户首页_获取客户列表_筛选客户
@Test
(
description
=
"客户列表_七日活跃"
,
priority
=
12
)
public
void
客户列表
_
七日活跃
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"activeType"
,
1
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"sortType"
,
3
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CUSTOMERSEARCH
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"接口请求失败"
,
response
.
body
().
asString
()));
List
<
Object
>
lists
=
response
.
jsonPath
().
getList
(
"data.list"
);
Assert
.
assertTrue
(
lists
.
size
()
>=
1
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"七日活跃客户数为0"
,
response
.
body
().
asString
()));
}
// 我的客户首页_获取客户列表_筛选客户
@Test
(
description
=
"客户列表_直接转发"
,
priority
=
13
)
public
void
客户列表
_
直接转发
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custOrigin"
,
1
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"sortType"
,
3
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
CUSTOMERSEARCH
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"接口请求失败"
,
response
.
body
().
asString
()));
List
<
Object
>
lists
=
response
.
jsonPath
().
getList
(
"data.list"
);
Assert
.
assertTrue
(
lists
.
size
()
>=
1
,
network
.
message
(
param
,
BasicConfig
.
CUSTOMERSEARCH
,
"直接转发客户数为0"
,
response
.
body
().
asString
()));
}
// 我的客户首页_获取客户列表_筛选客户
@Test
(
description
=
"客户列表_好友转发"
,
priority
=
14
)
public
void
客户列表
_
好友转发
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custOrigin"
,
2
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"sortType"
,
3
);
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
()));
}
// // 我的客户首页_搜索客户
// @Test(description = "搜索客户", priority = 15)
// public void 客户列表_搜索客户() throws IOException{
// param = new HashMap<>();
// // 获取用户微信昵称
// network.agentCookies.put("tku", BasicConfig.VISITOR_TKU);
// response = network.getResponse(BasicConfig.USER_INFO);
// String customerName = response.jsonPath().getString("data.wxName");
//
// // 代理人搜索客户
// network.agentCookies.put("tku", BasicConfig.VISITOR2_TKU);
// param.put("content", customerName);
// param.put("pageIndex", 1);
// param.put("pageSize", 20);
// response = network.getResponse(param, BasicConfig.SEARCHCUSTOMERBYCONTENT);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.SEARCHCUSTOMERBYCONTENT, "接口请求失败", response.body().asString()));
// List<Object> cusLists = response.jsonPath().getList("data.list");
// Assert.assertTrue(cusLists.size() > 0, network.message(param, BasicConfig.SEARCHCUSTOMERBYCONTENT, "查询无匹配结果", response.body().asString()));
// }
// 客户详情页_头部信息栏
@Test
(
description
=
"客户详情页_头部信息栏"
,
priority
=
16
)
public
void
客户详情页
_
头部信息栏
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1UserId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTINFOHEADER
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTINFOHEADER
,
"接口请求失败"
,
response
.
body
().
asString
()));
List
<
Object
>
custOrigins
=
response
.
jsonPath
().
getList
(
"data.custOrigins"
);
Assert
.
assertEquals
(
custOrigins
.
size
(),
3
,
network
.
message
(
param
,
BasicConfig
.
CUSTINFOHEADER
,
"二度客户来源链路长度不为3"
,
response
.
body
().
asString
()));
int
cameFrom
=
response
.
jsonPath
().
getInt
(
"data.cameFrom"
);
Assert
.
assertEquals
(
cameFrom
,
2
,
network
.
message
(
param
,
BasicConfig
.
CUSTINFOHEADER
,
"访客来源不为二度访客"
,
response
.
body
().
asString
()));
}
// 客户详情页_客户信息
@Test
(
description
=
"客户详情页_客户信息"
,
priority
=
17
)
public
void
客户详情页
_
客户信息
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"userId"
,
visitor1UserId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTINFO
);
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
(
"sessionId"
);
Assert
.
assertEquals
(
sellerId
,
far
.
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
()));
}
// 客户详情页_设置特别关注
@Test
(
description
=
"客户详情页_设置特别关注"
,
priority
=
9
)
public
void
客户详情页
_
设置特别关注
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1UserId
);
param
.
put
(
"isSpecialCustomer"
,
1
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
UPDATESPECIAL
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
UPDATESPECIAL
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
UPDATESPECIAL
,
"设置特别关注失败"
,
response
.
body
().
asString
()));
}
// 客户详情页_取消特别关注
@Test
(
description
=
"客户详情页_设置特别关注"
,
priority
=
11
)
public
void
客户详情页
_
取消特别关注
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1UserId
);
param
.
put
(
"isSpecialCustomer"
,
0
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
UPDATESPECIAL
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
UPDATESPECIAL
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
UPDATESPECIAL
,
"取消特别关注失败"
,
response
.
body
().
asString
()));
}
// 客户详情页_设置备注
@Test
(
description
=
"客户详情页_设置备注"
,
priority
=
18
)
public
void
客户详情页
_
设置备注
()
throws
IOException
{
// 设置备注
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1UserId
);
param
.
put
(
"remarkName"
,
"备注名"
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
UPDATEREMARKNAME
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
UPDATEREMARKNAME
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
UPDATEREMARKNAME
,
"设置备注失败"
,
response
.
body
().
asString
()));
// 查看用户头部信息
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1UserId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTINFOHEADER
);
String
remarkName
=
response
.
jsonPath
().
getString
(
"data.remarkName"
);
Assert
.
assertEquals
(
remarkName
,
"备注名"
,
network
.
message
(
param
,
BasicConfig
.
CUSTINFOHEADER
,
"用户备注名与预期不符"
,
response
.
body
().
asString
()));
}
// 客户详情页_意向详情
@Test
(
description
=
"客户详情页_意向详情"
,
priority
=
19
)
public
void
客户详情页
_
意向详情
()
throws
IOException
{
param
=
new
HashMap
<>();
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
()));
}
// // 客户详情页_人脉统计
// @Test(description = "客户详情页_人脉统计", priority = 20)
// public void 客户详情页_人脉统计() throws IOException{
// param = new HashMap<>();
// param.put("custUserId", far.decodeTku(BasicConfig.VISITOR_TKU).get("userId"));
// response = network.getResponse(param, BasicConfig.CUSTRELATION);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.CUSTRELATION, "接口请求失败", response.body().asString()));
// int num = response.jsonPath().getInt("data.num");
// Assert.assertTrue(num >= 1, network.message(param, BasicConfig.CUSTRELATION, "客户人脉统计数量小于1", response.body().asString()));
// }
// 客户详情页_线索统计
@Test
(
description
=
"客户详情页_线索统计"
,
priority
=
21
)
public
void
客户详情页
_
线索统计
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1UserId
);
param
.
put
(
"type"
,
2
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTSTATISTIC
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTSTATISTIC
,
"接口请求失败"
,
response
.
body
().
asString
()));
visitCount
=
response
.
jsonPath
().
getInt
(
"data.visitCount"
);
int
grassNum
=
response
.
jsonPath
().
getInt
(
"data.grassNum"
);
Assert
.
assertTrue
(
visitCount
>=
1
,
network
.
message
(
param
,
BasicConfig
.
CUSTSTATISTIC
,
"用户来访次数小于1"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
grassNum
>=
1
,
network
.
message
(
param
,
BasicConfig
.
CUSTSTATISTIC
,
"用户阅读种草文章次数小于1"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
visitCount
,
grassNum
,
network
.
message
(
param
,
BasicConfig
.
CUSTSTATISTIC
,
"用户来访次数与阅读种草文章次数不相等"
,
response
.
body
().
asString
()));
}
// 客户详情页_阅读偏好
@Test
(
description
=
"客户详情页_阅读偏好"
,
priority
=
22
)
public
void
客户详情页
_
阅读偏好
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1UserId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CUSTREADPERFERENCE
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CUSTREADPERFERENCE
,
"接口请求失败"
,
response
.
body
().
asString
()));
}
// 客户详情页_来访记录
@Test
(
description
=
"客户详情页_来访记录"
,
priority
=
23
)
public
void
客户详情页
_
来访记录
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"custUserId"
,
visitor1UserId
);
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
()));
List
<
Object
>
visitLists
=
response
.
jsonPath
().
getList
(
"data.list"
);
Assert
.
assertEquals
(
visitLists
.
size
(),
visitCount
,
network
.
message
(
param
,
BasicConfig
.
CUSTVISITLIST
,
"访客来访记录数目与来访次数不符"
,
response
.
body
().
asString
()));
}
// 客户详情页_任务蒙层
@Test
(
description
=
"客户详情页_任务蒙层"
,
priority
=
24
)
public
void
客户详情页
_
任务蒙层
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"sceneCode"
,
"noviceTask_visitorsCustomerInfoComplete"
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
NOVICE_MONGOLIANLAYERISPLAY
);
boolean
isDisplay
=
response
.
jsonPath
().
getBoolean
(
"data.isDisplay"
);
Assert
.
assertFalse
(
isDisplay
,
network
.
message
(
param
,
BasicConfig
.
NOVICE_MONGOLIANLAYERISPLAY
,
"任务蒙层展示判断错误"
,
response
.
body
().
asString
()));
}
// 客户详情页_特别关注弹层
@Test
(
description
=
"客户详情页_特别关注弹层"
,
priority
=
25
)
public
void
客户详情页
_
特别关注弹层
()
throws
IOException
{
response
=
network
.
getResponse
(
BasicConfig
.
ISDISPLAYSPECIAL
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
param
,
BasicConfig
.
ISDISPLAYSPECIAL
,
"接口返回数据为空"
,
response
.
body
().
asString
()));
}
// 客户详情页_素材访问记录
@Test
(
description
=
"客户详情页_素材访问记录"
,
priority
=
26
)
public
void
客户详情页
_
素材访问记录
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
visitor1UserId
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"paheSize"
,
30
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CONTENTVISITRECORD
);
int
totalCount
=
response
.
jsonPath
().
getInt
(
"data.totalCount"
);
Assert
.
assertEquals
(
totalCount
,
visitCount
,
network
.
message
(
param
,
BasicConfig
.
CONTENTVISITRECORD
,
"访问记录总数与来访次数不符"
,
response
.
body
().
asString
()));
}
// 客户详情页_资料信息
@Test
(
description
=
"客户详情页_资料信息"
,
priority
=
27
)
public
void
客户详情页
_
资料信息
()
throws
IOException
{
}
}
src/test/java/com/kjj/cases/assistant/whoSawMe/MyForward.java
View file @
5e6a7d12
...
@@ -27,8 +27,7 @@ public class MyForward implements Authorization {
...
@@ -27,8 +27,7 @@ public class MyForward implements Authorization {
public
void
setUp
()
throws
IOException
{
public
void
setUp
()
throws
IOException
{
// 登陆管理后台
// 登陆管理后台
BaseUtils
.
ssoLogin
();
BaseUtils
.
ssoLogin
();
// 代理人授权
visitor2Tku
();
agentTku
();
far
=
new
ForwardAndRead
();
far
=
new
ForwardAndRead
();
// 关闭数据看板演示数据
// 关闭数据看板演示数据
...
@@ -237,7 +236,6 @@ public class MyForward implements Authorization {
...
@@ -237,7 +236,6 @@ public class MyForward implements Authorization {
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
);
System
.
out
.
println
(
response
.
body
().
asString
());
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
encodeUserId
=
response
.
jsonPath
().
getString
(
"data.list[0].userId"
);
String
encodeUserId
=
response
.
jsonPath
().
getString
(
"data.list[0].userId"
);
Assert
.
assertEquals
(
encodeUserId
,
far
.
encodeId
((
Long
)
far
.
getUserInfo
(
VISITOR1_TKU
).
get
(
"userId"
)),
network
.
message
(
param
,
FORWARD_VISITRECORD
,
"筛选结果首条记录userId与预期不符"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
encodeUserId
,
far
.
encodeId
((
Long
)
far
.
getUserInfo
(
VISITOR1_TKU
).
get
(
"userId"
)),
network
.
message
(
param
,
FORWARD_VISITRECORD
,
"筛选结果首条记录userId与预期不符"
,
response
.
body
().
asString
()));
...
...
src/test/java/com/kjj/cases/assistant/whoSawMe/WhoSawMe.java
View file @
5e6a7d12
package
com
.
kjj
.
cases
.
assistant
.
whoSawMe
;
package
com
.
kjj
.
cases
.
assistant
.
whoSawMe
;
import
com.beust.jcommander.internal.Lists
;
import
com.beust.jcommander.internal.Lists
;
import
com.kjj.bean.assistant.ArticlePage
;
import
com.kjj.bean.assistant.RankingList
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.JsonUtil
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
...
@@ -14,20 +18,24 @@ import java.util.HashMap;
...
@@ -14,20 +18,24 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
AGENT_TKU
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
BOSS_EDITCONFIG
;
public
class
WhoSawMe
implements
Authorization
{
public
class
WhoSawMe
implements
Authorization
{
private
Response
response
;
private
Response
response
;
private
Map
<
String
,
Object
>
param
;
private
Map
<
String
,
Object
>
param
;
private
ForwardAndRead
far
;
private
ForwardAndRead
far
;
private
Long
xxxSellerId
;
private
Long
childSellerId
;
private
Long
childSellerId
;
private
Long
clueId
;
private
Long
xxrUserId
;
private
Long
jjSellerId
;
private
String
tagId0
;
private
String
contentId
;
private
Integer
taskId
;
@BeforeClass
@BeforeClass
public
void
setUp
()
throws
IOException
{
public
void
setUp
()
throws
IOException
{
// 代理人授权
// 代理人授权
agent
Tku
();
visitor2
Tku
();
BaseUtils
.
ssoLogin
();
BaseUtils
.
ssoLogin
();
far
=
new
ForwardAndRead
();
far
=
new
ForwardAndRead
();
...
@@ -44,7 +52,7 @@ public class WhoSawMe implements Authorization {
...
@@ -44,7 +52,7 @@ public class WhoSawMe implements Authorization {
param
.
put
(
"vipGuideType"
,
2
);
param
.
put
(
"vipGuideType"
,
2
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
HOST
+
"/kjy/mp/rookieGuide/isNewVipByType"
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
HOST
+
"/kjy/mp/rookieGuide/isNewVipByType"
);
Boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertEquals
(
success
,
Boolean
.
TRUE
,
network
.
message
(
BasicConfig
.
HOST
+
"/kjy/mp/rookieGuide/isNewVipByType"
,
"
判断代理人是否新会员
失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
success
,
Boolean
.
TRUE
,
network
.
message
(
BasicConfig
.
HOST
+
"/kjy/mp/rookieGuide/isNewVipByType"
,
"
接口请求
失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
BasicConfig
.
HOST
+
"/kjy/mp/rookieGuide/isNewVipByType"
,
"新老会员判断错误,预期为新会员判断为老会员"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
BasicConfig
.
HOST
+
"/kjy/mp/rookieGuide/isNewVipByType"
,
"新老会员判断错误,预期为新会员判断为老会员"
,
response
.
body
().
asString
()));
}
}
...
@@ -54,9 +62,9 @@ public class WhoSawMe implements Authorization {
...
@@ -54,9 +62,9 @@ public class WhoSawMe implements Authorization {
// 获取代理人用户信息
// 获取代理人用户信息
response
=
network
.
getResponse
(
BasicConfig
.
USER_INFO
);
response
=
network
.
getResponse
(
BasicConfig
.
USER_INFO
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
USER_INFO
,
"
获取代理人用户信息
失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
USER_INFO
,
"
接口请求
失败"
,
response
.
body
().
asString
()));
String
wxName
=
response
.
jsonPath
().
getString
(
"data.wxName
"
);
Long
userId
=
response
.
jsonPath
().
getLong
(
"data.userId
"
);
Assert
.
assertEquals
(
wxName
,
BasicConfig
.
WECHAT_NAME
,
network
.
message
(
BasicConfig
.
USER_INFO
,
"代理人微信昵称获取有误,预期为"
+
BasicConfig
.
WECHAT_NAME
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
userId
,
far
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"userId"
),
network
.
message
(
BasicConfig
.
USER_INFO
,
"代理人userId与预期不符"
,
response
.
body
().
asString
()));
}
}
// 获取当前页面Tips
// 获取当前页面Tips
...
@@ -67,95 +75,105 @@ public class WhoSawMe implements Authorization {
...
@@ -67,95 +75,105 @@ public class WhoSawMe implements Authorization {
String
page
=
"who_saw_me"
;
String
page
=
"who_saw_me"
;
param
.
put
(
"page"
,
page
);
param
.
put
(
"page"
,
page
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
GETTIPSBYPAGE
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
GETTIPSBYPAGE
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
GETTIPSBYPAGE
,
"接口请求失败"
,
response
.
body
().
asString
()));
Boolean
isShowTips
=
response
.
jsonPath
().
getBoolean
(
"data.isShowTips"
);
Object
id
=
response
.
jsonPath
().
getJsonObject
(
"data.id"
);
Integer
jumpType
=
response
.
jsonPath
().
getInt
(
"data.jumpType"
);
Assert
.
assertNotNull
(
id
,
network
.
message
(
param
,
BasicConfig
.
GETTIPSBYPAGE
,
"获取页面Tips失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
GETTIPSBYPAGE
,
"获取当前页面tips失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
BasicConfig
.
GETTIPSBYPAGE
,
"获取当前页面tips失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
isShowTips
,
network
.
message
(
BasicConfig
.
GETTIPSBYPAGE
,
"获取isShowTips值失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
jumpType
,
network
.
message
(
BasicConfig
.
GETTIPSBYPAGE
,
"获取跳转类型失败"
,
response
.
body
().
asString
()));
}
}
// 查询代理人当前使用版本
// 查询代理人当前使用版本
@Test
(
description
=
"首页_查询使用版本"
,
priority
=
4
)
@Test
(
description
=
"首页_查询使用版本"
,
priority
=
4
)
public
void
查询代理人当前使用版本
()
throws
IOException
{
public
void
查询代理人当前使用版本
()
throws
IOException
{
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
String
sellerIdEncode
=
far
.
encodeId
((
Long
)
far
.
getUserInfo
(
AGENT_TKU
).
get
(
"sellerId"
));
xxxSellerId
=
far
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
);
String
sellerIdEncode
=
far
.
encodeId
(
xxxSellerId
);
param
.
put
(
"sellerId"
,
sellerIdEncode
);
param
.
put
(
"sellerId"
,
sellerIdEncode
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
USING_VERSION
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
USING_VERSION
);
String
userVersion
=
response
.
jsonPath
().
getString
(
"data.userVersion"
);
String
userVersion
=
response
.
jsonPath
().
getString
(
"data.userVersion"
);
Assert
.
assertEquals
(
userVersion
,
"2"
,
network
.
message
(
BasicConfig
.
USING_VERSION
,
"代理人当前使用版本错误,实际为2.保险专业版"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
userVersion
,
"2"
,
network
.
message
(
BasicConfig
.
USING_VERSION
,
"代理人当前使用版本错误,实际为2.保险专业版"
,
response
.
body
().
asString
()));
}
}
// 判断是否展示续费弹窗
// 判断是否展示续费弹窗
@Test
(
description
=
"判断是否展示续费弹窗"
,
priority
=
6
)
@Test
(
description
=
"判断是否展示续费弹窗"
,
priority
=
5
)
public
void
判断是否展示续费弹窗
()
throws
IOException
{
public
void
判断是否展示续费弹窗
()
throws
IOException
{
// 判断是否展示续费弹窗
// 判断是否展示续费弹窗
response
=
network
.
getResponse
(
BasicConfig
.
LAYER_RENEW
);
response
=
network
.
getResponse
(
BasicConfig
.
LAYER_RENEW
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
LAYER_RENEW
,
"接口请求失败"
,
response
.
body
().
asString
()));
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
BasicConfig
.
LAYER_RENEW
,
"判断是否展示续费弹窗失败,data为空"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
BasicConfig
.
LAYER_RENEW
,
"判断是否展示续费弹窗失败,data为空"
,
response
.
body
().
asString
()));
}
}
// 判断是否展示邀请弹窗
// 判断是否展示邀请弹窗
@Test
(
description
=
"展示邀请活动弹窗"
,
priority
=
7
)
@Test
(
description
=
"展示邀请活动弹窗"
,
priority
=
6
)
public
void
展示邀请活动弹窗
()
throws
IOException
{
public
void
展示邀请活动弹窗
()
throws
IOException
{
// 邀请活动弹窗
// 邀请活动弹窗
response
=
network
.
getResponse
(
BasicConfig
.
DISTRIBUTION_LAYER
);
response
=
network
.
getResponse
(
BasicConfig
.
DISTRIBUTION_LAYER
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
DISTRIBUTION_LAYER
,
"接口请求失败"
,
response
.
body
().
asString
()));
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
DISTRIBUTION_LAYER
,
"判断是否展示邀请活动弹窗失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
BasicConfig
.
DISTRIBUTION_LAYER
,
"判断是否展示邀请活动弹窗失败,data为空"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
BasicConfig
.
DISTRIBUTION_LAYER
,
"判断是否展示邀请活动弹窗失败,data为空"
,
response
.
body
().
asString
()));
}
}
// 判断是否展示线索页新手引导
// 判断是否展示线索页新手引导
@Test
(
description
=
"获取线索页新手引导"
,
priority
=
8
)
@Test
(
description
=
"获取线索页新手引导"
,
priority
=
7
)
public
void
获取线索页新手引导
()
throws
IOException
{
public
void
获取线索页新手引导
()
throws
IOException
{
// 获取线索页新手引导
// 获取线索页新手引导
response
=
network
.
getResponse
(
BasicConfig
.
ROOKIECLUEGUIDE
);
response
=
network
.
getResponse
(
BasicConfig
.
ROOKIECLUEGUIDE
);
Boolean
showClueGuide
=
response
.
jsonPath
().
getBoolean
(
"data.showClueGuide"
);
Object
showClueGuide
=
response
.
jsonPath
().
getJsonObject
(
"data.showClueGuide"
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
ROOKIECLUEGUIDE
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
ROOKIECLUEGUIDE
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
response
.
jsonPath
().
getJsonObject
(
"data"
),
network
.
message
(
BasicConfig
.
ROOKIECLUEGUIDE
,
"获取线索页新手引导失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
showClueGuide
,
network
.
message
(
BasicConfig
.
ROOKIECLUEGUIDE
,
"获取showClueGuide值失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
showClueGuide
,
network
.
message
(
BasicConfig
.
ROOKIECLUEGUIDE
,
"获取showClueGuide值失败"
,
response
.
body
().
asString
()));
}
}
// 获取周报首页数据
// 获取周报首页数据
@Test
(
description
=
"获取周报首页数据"
,
priority
=
9
)
@Test
(
description
=
"获取周报首页数据"
,
priority
=
8
)
public
void
获取周报首页数据
()
throws
IOException
{
public
void
获取周报首页数据
()
throws
IOException
{
// 获取周报首页数据
// 获取周报首页数据
response
=
network
.
getResponse
(
BasicConfig
.
SELLERWEEKLY
);
response
=
network
.
getResponse
(
BasicConfig
.
SELLERWEEKLY
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
SELLERWEEKLY
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
SELLERWEEKLY
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
BasicConfig
.
SELLERWEEKLY
,
"获取周报首页数据失败"
,
response
.
body
().
asString
()));
}
// 获取代理人标签列表
@Test
(
description
=
"获取代理人标签列表"
,
priority
=
10
)
public
void
获取代理人标签列表
()
throws
IOException
{
// 获取代理人标签列表
response
=
network
.
getResponse
(
BasicConfig
.
HOST
+
"/kjy/mp/sellerTag/getTagList"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
HOST
+
"/kjy/mp/sellerTag/getTagList"
,
"接口请求失败"
,
response
.
body
().
asString
()));
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
BasicConfig
.
HOST
+
"/kjy/mp/sellerTag/getTagList"
,
"获取代理人标签列表
失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
BasicConfig
.
SELLERWEEKLY
,
"获取周报首页数据
失败"
,
response
.
body
().
asString
()));
}
}
// 获取首页来访统计
// 获取首页来访统计
@Test
(
description
=
"获取谁看过我首页来访统计"
,
priority
=
1
1
)
@Test
(
description
=
"获取谁看过我首页来访统计"
,
priority
=
1
0
)
public
void
来访统计
()
throws
IOException
{
public
void
来访统计
()
throws
IOException
{
response
=
network
.
getResponse
(
BasicConfig
.
VISITHEADER
);
response
=
network
.
getResponse
(
BasicConfig
.
VISITHEADER
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
VISITHEADER
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
VISITHEADER
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
todayClueNum
=
response
.
jsonPath
().
getInt
(
"data.todayClueNum"
);
int
todayClueNum
=
response
.
jsonPath
().
getInt
(
"data.todayClueNum"
);
int
todayVisitNum
=
response
.
jsonPath
().
getInt
(
"data.todayVisitNum"
);
int
todayVisitNum
=
response
.
jsonPath
().
getInt
(
"data.todayVisitNum"
);
Assert
.
assertTrue
(
todayClueNum
>=
1
,
network
.
message
(
BasicConfig
.
VISITHEADER
,
"获取今日线索数小于1"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
todayClueNum
>=
2
,
network
.
message
(
BasicConfig
.
VISITHEADER
,
"获取今日线索数有误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
todayVisitNum
>=
1
,
network
.
message
(
BasicConfig
.
VISITHEADER
,
"获取今日访问数小于1"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
todayVisitNum
>=
2
,
network
.
message
(
BasicConfig
.
VISITHEADER
,
"获取今日访问数有误"
,
response
.
body
().
asString
()));
}
// 查看谁看过我首页我的访客列表
@Test
(
description
=
"查看我的访客列表"
,
priority
=
11
)
public
void
查看我的访客列表
()
throws
IOException
{
List
<
Object
>
customerTagIds
=
Lists
.
newArrayList
();
param
=
new
HashMap
<>();
param
.
put
(
"customerTagIds"
,
customerTagIds
);
param
.
put
(
"lastClueId"
,
0
);
param
.
put
(
"listType"
,
1
);
param
.
put
(
"pageSize"
,
20
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"接口请求失败"
,
response
.
body
().
asString
()));
String
visitorWxName
=
response
.
jsonPath
().
getString
(
"data.list[0].nickName"
);
Assert
.
assertEquals
(
visitorWxName
,
far
.
getUserInfo
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"wxName"
),
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"访客微信昵称不匹配"
,
response
.
body
().
asString
()));
clueId
=
response
.
jsonPath
().
getLong
(
"data.list[0].clueId"
);
}
// 获取代理人标签列表
@Test
(
description
=
"获取代理人标签列表"
,
priority
=
12
)
public
void
获取代理人标签列表
()
throws
IOException
{
response
=
network
.
getResponse
(
BasicConfig
.
TAG_GETLIST
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
TAG_GETLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
tagId0
=
response
.
jsonPath
().
getString
(
"data[0].id"
);
Assert
.
assertNotNull
(
tagId0
,
network
.
message
(
BasicConfig
.
TAG_GETLIST
,
"标签id为null"
,
response
.
body
().
asString
()));
}
}
// 进入运营周报首页
// 进入运营周报首页
@Test
(
description
=
"进入运营周报首页"
,
priority
=
1
2
)
@Test
(
description
=
"进入运营周报首页"
,
priority
=
1
3
)
public
void
进入运营周报首页
()
throws
IOException
{
public
void
进入运营周报首页
()
throws
IOException
{
response
=
network
.
getResponse
(
BasicConfig
.
WEEKLY_LIST
);
response
=
network
.
getResponse
(
BasicConfig
.
WEEKLY_LIST
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
...
@@ -163,27 +181,35 @@ public class WhoSawMe implements Authorization {
...
@@ -163,27 +181,35 @@ public class WhoSawMe implements Authorization {
}
}
// 进入团队看板首页
// 进入团队看板首页
@Test
(
description
=
"进入团队看板首页"
,
priority
=
1
3
)
@Test
(
description
=
"进入团队看板首页"
,
priority
=
1
4
)
public
void
进入团队看板首页
()
throws
IOException
{
public
void
进入团队看板首页
()
throws
IOException
{
// 获取当前页面Tips
// 获取当前页面Tips
param
.
clear
();
param
.
clear
();
param
.
put
(
"page"
,
"data_board"
);
param
.
put
(
"page"
,
"data_board"
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
GETTIPSBYPAGE
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
GETTIPSBYPAGE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
String
tipsContent
=
response
.
jsonPath
().
getString
(
"data.tipsContent"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
GETTIPSBYPAGE
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
GETTIPSBYPAGE
,
"接口请求失败"
,
response
.
body
().
asString
()));
String
tipsContent
=
response
.
jsonPath
().
getString
(
"data.tipsContent"
);
Assert
.
assertEquals
(
tipsContent
,
"数据看板-tips"
,
network
.
message
(
param
,
BasicConfig
.
GETTIPSBYPAGE
,
"当前页面Tips错误,实际为 数据看板"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
tipsContent
,
"数据看板-tips"
,
network
.
message
(
param
,
BasicConfig
.
GETTIPSBYPAGE
,
"当前页面Tips错误,实际为 数据看板"
,
response
.
body
().
asString
()));
// 获取我的上级名称
// 获取我的上级名称
param
.
clear
();
param
.
clear
();
param
.
put
(
"sellerId"
,
far
.
getUserInfo
(
AGENT_TKU
).
get
(
"sellerId"
)
);
param
.
put
(
"sellerId"
,
xxxSellerId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_BOSS
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_BOSS
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
BOSS_BOSS
,
"获取上级名称失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
BasicConfig
.
BOSS_BOSS
,
"接口请求失败"
,
response
.
body
().
asString
()));
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertNull
(
data
,
network
.
message
(
param
,
BasicConfig
.
BOSS_BOSS
,
"代理人上级名称不为空"
,
response
.
body
().
asString
()));
// 获取当前使用版本
response
=
network
.
getResponse
(
BasicConfig
.
version_info
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
BasicConfig
.
version_info
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
userVersion
=
response
.
jsonPath
().
getInt
(
"data[0].userVersion"
);
Assert
.
assertEquals
(
userVersion
,
2
,
network
.
message
(
BasicConfig
.
version_info
,
"获取版本错误"
,
response
.
body
().
asString
()));
}
}
// 邀请成员加入团队
// 邀请成员加入团队
@Test
(
description
=
"生成团队邀请码"
,
priority
=
1
4
)
@Test
(
description
=
"生成团队邀请码"
,
priority
=
1
5
)
public
void
生成团队邀请码
()
throws
IOException
{
public
void
生成团队邀请码
()
throws
IOException
{
Integer
inviteType
=
2
;
Integer
inviteType
=
2
;
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
...
@@ -193,11 +219,10 @@ public class WhoSawMe implements Authorization {
...
@@ -193,11 +219,10 @@ public class WhoSawMe implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
param
,
BasicConfig
.
BOSS_CODE
,
"获取团队邀请码失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
param
,
BasicConfig
.
BOSS_CODE
,
"获取团队邀请码失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"其他代理人加入该代理人团队"
,
priority
=
1
5
)
@Test
(
description
=
"其他代理人加入该代理人团队"
,
priority
=
1
6
)
public
void
邀请加入团队
()
throws
IOException
{
public
void
邀请加入团队
()
throws
IOException
{
// 切换代理人加入团队
// 切换代理人加入团队
Long
sellerId
=
(
Long
)
far
.
getUserInfo
(
AGENT_TKU
).
get
(
"sellerId"
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
AGENT_TKU
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR1_TKU
);
// 确定被邀请代理人没有上级
// 确定被邀请代理人没有上级
response
=
network
.
getResponse
(
BasicConfig
.
BOSS_ROLE
);
response
=
network
.
getResponse
(
BasicConfig
.
BOSS_ROLE
);
...
@@ -206,51 +231,179 @@ public class WhoSawMe implements Authorization {
...
@@ -206,51 +231,179 @@ public class WhoSawMe implements Authorization {
// 代理人加入团队
// 代理人加入团队
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"inviterSid"
,
sellerId
);
param
.
put
(
"inviterSid"
,
far
.
decodeTku
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
)
);
param
.
put
(
"inviteType"
,
2
);
param
.
put
(
"inviteType"
,
2
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_BOUND
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_BOUND
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
param
,
BasicConfig
.
BOSS_BOUND
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
param
,
BasicConfig
.
BOSS_BOUND
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_BOUND
,
"添加代理人进入团队失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_BOUND
,
"添加代理人进入团队失败"
,
response
.
body
().
asString
()));
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
AGENT
_TKU
);
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR2
_TKU
);
}
}
@Test
(
description
=
"查看被邀请代理人上级名称"
,
priority
=
1
6
)
@Test
(
description
=
"查看被邀请代理人上级名称"
,
priority
=
1
7
)
public
void
查看上级名称
()
throws
IOException
{
public
void
查看上级名称
()
throws
IOException
{
// 获取被邀请代理人sellerId
// 获取被邀请代理人sellerId
childSellerId
=
far
.
decodeTku
(
BasicConfig
.
VISITOR1
_TKU
).
get
(
"sellerId"
);
childSellerId
=
far
.
decodeTku
(
BasicConfig
.
AGENT
_TKU
).
get
(
"sellerId"
);
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"sellerId"
,
childSellerId
);
param
.
put
(
"sellerId"
,
childSellerId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_BOSS
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_BOSS
);
String
bossName
=
response
.
jsonPath
().
getString
(
"data"
);
String
bossName
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_BOSS
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_BOSS
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
bossName
,
BasicConfig
.
WECHAT_NAME
,
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
()));
}
}
@Test
(
description
=
"删除团队成员"
,
priority
=
17
)
// 获取代理人团队信息
public
void
删除团队成员
()
throws
IOException
{
@Test
(
description
=
"代理人团队信息"
,
priority
=
19
)
// 登陆管理后台调用管理后台接口删除成员
public
void
代理人团队信息
()
throws
IOException
{
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"superiorSid"
,
far
.
getUserInfo
(
AGENT_TKU
).
get
(
"sellerId"
));
param
.
put
(
"sellerId"
,
xxxSellerId
);
param
.
put
(
"childSid"
,
childSellerId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_ROLE
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
MANAGER_removeMember
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_ROLE
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
MANAGER_removeMember
,
"删除成员失败"
,
response
.
body
().
asString
()));
boolean
hasSubordinate
=
response
.
jsonPath
().
getBoolean
(
"data.hasSubordinate"
);
int
teamNumber
=
response
.
jsonPath
().
getInt
(
"data.teamNumber"
);
Assert
.
assertTrue
(
hasSubordinate
,
network
.
message
(
param
,
BasicConfig
.
BOSS_ROLE
,
"用户查询无下级"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
teamNumber
,
2
,
network
.
message
(
param
,
BasicConfig
.
BOSS_ROLE
,
"代理人团队人数有误"
,
response
.
body
().
asString
()));
}
// 切换到被删除代理人确认已没有上级
// 代理人团队成员数
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR1_TKU
);
@Test
(
description
=
"代理人团队成员数"
,
priority
=
20
)
response
=
network
.
getResponse
(
BasicConfig
.
BOSS_ROLE
);
public
void
代理人团队成员数
()
throws
IOException
{
boolean
hasSuperior
=
response
.
jsonPath
().
getBoolean
(
"data.hasSuperior"
);
param
=
new
HashMap
<>();
Assert
.
assertFalse
(
hasSuperior
,
network
.
message
(
BasicConfig
.
BOSS_ROLE
,
"该代理人还有上级"
,
response
.
body
().
asString
()));
param
.
put
(
"superiorId"
,
xxxSellerId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
TEAMMEMBERNUM
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
TEAMMEMBERNUM
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
personalNum
=
response
.
jsonPath
().
getInt
(
"data.personalNum"
);
Assert
.
assertEquals
(
personalNum
,
2
,
network
.
message
(
param
,
BasicConfig
.
TEAMMEMBERNUM
,
"代理人团队人数有误"
,
response
.
body
().
asString
()));
}
network
.
agentCookies
.
put
(
"tku"
,
AGENT_TKU
);
// // 获取今日团队数据
// @Test(description = "获取今日团队数据", priority = 21)
// public void 获取今日团队数据() throws IOException{
// param = new HashMap<>();
// param.put("superiorId", xxxSellerId);
// param.put("sortType", 4);
// param.put("team", false);
// response = network.getResponse(param, BasicConfig.TEAMDATA);
// Assert.assertTrue(response.jsonPath().getBoolean("success"), network.message(param, BasicConfig.TEAMDATA, "接口请求失败", response.body().asString()));
// int forwardMaterialNum = response.jsonPath().getInt("data.forwardMaterialNum");
// int forwardCardNum = response.jsonPath().getInt("data.forwardCardNum");
// int gainSaleClueNum = response.jsonPath().getInt("data.gainSaleClueNum");
// Assert.assertEquals(forwardCardNum, 4, network.message(param, BasicConfig.TEAMDATA, "转发卡片数量不为1", response.body().asString()));
// Assert.assertEquals(forwardMaterialNum, 4, network.message(param, BasicConfig.TEAMDATA, "转发素材数量不为1", response.body().asString()));
// Assert.assertEquals(gainSaleClueNum, 8, network.message(param, BasicConfig.TEAMDATA, "获得线索数量不为2", response.body().asString()));
// }
// 获取个人排行列表
@Test
(
description
=
"获取个人排行列表"
,
priority
=
22
)
public
void
获取个人排行列表
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"sortType"
,
4
);
param
.
put
(
"superiorId"
,
xxxSellerId
);
param
.
put
(
"listType"
,
4
);
param
.
put
(
"team"
,
false
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
TEAMRANKINGLIST
);
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"
)));
Assert
.
assertEquals
(
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
());
Assert
.
assertTrue
(
isExist
,
network
.
message
(
param
,
BasicConfig
.
TEAMRANKINGLIST
,
"排行榜内成员sid有误"
,
response
.
body
().
asString
()));
}
}
// 团队任务
// 新建任务_选择素材
@Test
(
description
=
"新建任务_选择素材"
,
priority
=
23
)
public
void
新建任务
_
选择素材
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"contentType"
,
"article"
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
FINDPAGEBYCONTENTTYPE
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
FINDPAGEBYCONTENTTYPE
,
"接口请求失败"
,
response
.
body
().
asString
()));
List
<
ArticlePage
>
articlePages
=
JsonUtil
.
parseResponseToPageBean
(
response
,
ArticlePage
.
class
);
for
(
int
i
=
0
;
i
<
articlePages
.
size
();
i
++){
String
contentType
=
articlePages
.
get
(
i
).
getContentType
();
Assert
.
assertEquals
(
contentType
,
"article"
,
network
.
message
(
param
,
BasicConfig
.
FINDPAGEBYCONTENTTYPE
,
"素材类型错误"
,
response
.
body
().
asString
()));
}
}
contentId
=
articlePages
.
get
(
0
).
getContentId
();
}
// 新建任务_创建任务
@Test
(
description
=
"新建任务_创建任务"
,
priority
=
24
)
public
void
新建任务
_
创建任务
()
throws
IOException
{
String
scid
=
far
.
getContentScId
(
contentId
);
param
=
new
HashMap
<>();
param
.
put
(
"scid"
,
scid
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
BOSS_CREATE
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_CREATE
,
"接口请求失败"
,
response
.
body
().
asString
()));
taskId
=
response
.
jsonPath
().
getInt
(
"data"
);
Assert
.
assertNotNull
(
taskId
,
network
.
message
(
param
,
BasicConfig
.
BOSS_CREATE
,
"返回taskId为空"
,
response
.
body
().
asString
()));
}
// 新建任务_任务详情
@Test
(
description
=
"新建任务_任务详情"
,
priority
=
25
)
public
void
新建任务
_
任务详情
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"taskId"
,
taskId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_DETAIL
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_DETAIL
,
"接口请求失败"
,
response
.
body
().
asString
()));
}
// 新建任务_可推送成员
@Test
(
description
=
"新建任务_可推送成员"
,
priority
=
26
)
public
void
新建任务
_
可推送成员
()
throws
IOException
{
jjSellerId
=
far
.
decodeTku
(
BasicConfig
.
AGENT_TKU
).
get
(
"sellerId"
);
param
=
new
HashMap
<>();
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"sellerId"
,
xxxSellerId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
TEAMMEMBER
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
TEAMMEMBER
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
totalCount
=
response
.
jsonPath
().
getInt
(
"data.totalCount"
);
String
sellerId
=
response
.
jsonPath
().
getString
(
"data.list["
+(
totalCount
-
1
)+
"].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
()));
}
// 新建任务_推送任务
@Test
(
description
=
"新建任务_推送任务"
,
priority
=
27
)
public
void
新建任务
_
推送任务
()
throws
IOException
{
List
<
String
>
sellerIds
=
Lists
.
newArrayList
();
List
<
String
>
superiorIds
=
Lists
.
newArrayList
();
sellerIds
.
add
(
far
.
encodeId
(
jjSellerId
));
param
=
new
HashMap
<>();
param
.
put
(
"effectiveDuration"
,
7
);
param
.
put
(
"isAllMen"
,
true
);
param
.
put
(
"sellerIds"
,
sellerIds
);
param
.
put
(
"superiorIds"
,
superiorIds
);
param
.
put
(
"taskId"
,
taskId
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
BOSS_PUBLISH
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_PUBLISH
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_PUBLISH
,
"推送任务失败"
,
response
.
body
().
asString
()));
}
// 新建任务_查看任务
@Test
(
description
=
"新建任务_查看任务"
,
priority
=
28
)
public
void
新建任务
_
查看任务
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"pageSize"
,
20
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
BOSS_TEAMTASKLIST
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
BOSS_TEAMTASKLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
}
// 查看今日转发素材列表
// 查看今日转发素材列表
@Test
(
description
=
"查看今日转发素材列表"
,
priority
=
1
9
)
@Test
(
description
=
"查看今日转发素材列表"
,
priority
=
2
9
)
public
void
查看转发素材列表
()
throws
IOException
{
public
void
查看转发素材列表
()
throws
IOException
{
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"sellerId"
,
far
.
getUserInfo
(
AGENT_TKU
).
get
(
"sellerId"
)
);
param
.
put
(
"sellerId"
,
xxxSellerId
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"sortType"
,
4
);
param
.
put
(
"sortType"
,
4
);
...
@@ -261,10 +414,10 @@ public class WhoSawMe implements Authorization {
...
@@ -261,10 +414,10 @@ public class WhoSawMe implements Authorization {
}
}
// 查看转发名片记录列表
// 查看转发名片记录列表
@Test
(
description
=
"查看转发名片记录列表"
,
priority
=
21
)
@Test
(
description
=
"查看转发名片记录列表"
,
priority
=
30
)
public
void
查看转发名片记录列表
()
throws
IOException
{
public
void
查看转发名片记录列表
()
throws
IOException
{
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"sellerId"
,
far
.
getUserInfo
(
AGENT_TKU
).
get
(
"sellerId"
)
);
param
.
put
(
"sellerId"
,
xxxSellerId
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"sortType"
,
4
);
param
.
put
(
"sortType"
,
4
);
...
@@ -274,7 +427,7 @@ public class WhoSawMe implements Authorization {
...
@@ -274,7 +427,7 @@ public class WhoSawMe implements Authorization {
}
}
// 使用工具
// 使用工具
@Test
(
description
=
"使用工具"
,
priority
=
22
)
@Test
(
description
=
"使用工具"
,
priority
=
31
)
public
void
使用工具
()
throws
IOException
{
public
void
使用工具
()
throws
IOException
{
// 生成抽奖转盘素材scId
// 生成抽奖转盘素材scId
String
lottery_scId
=
far
.
getContentScId
(
BasicConfig
.
LOTTERY_CONTENTID
);
String
lottery_scId
=
far
.
getContentScId
(
BasicConfig
.
LOTTERY_CONTENTID
);
...
@@ -289,10 +442,10 @@ public class WhoSawMe implements Authorization {
...
@@ -289,10 +442,10 @@ public class WhoSawMe implements Authorization {
}
}
// 查看使用工具记录列表
// 查看使用工具记录列表
@Test
(
description
=
"查看使用工具记录列表"
,
priority
=
23
)
@Test
(
description
=
"查看使用工具记录列表"
,
priority
=
32
)
public
void
查看使用工具记录列表
()
throws
IOException
{
public
void
查看使用工具记录列表
()
throws
IOException
{
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"sellerId"
,
far
.
getUserInfo
(
AGENT_TKU
).
get
(
"sellerId"
)
);
param
.
put
(
"sellerId"
,
xxxSellerId
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"sortType"
,
4
);
param
.
put
(
"sortType"
,
4
);
...
@@ -303,10 +456,10 @@ public class WhoSawMe implements Authorization {
...
@@ -303,10 +456,10 @@ public class WhoSawMe implements Authorization {
}
}
// 查看获得线索记录列表
// 查看获得线索记录列表
@Test
(
description
=
"查看获得线索记录列表"
,
priority
=
24
)
@Test
(
description
=
"查看获得线索记录列表"
,
priority
=
33
)
public
void
查看获得线索记录列表
()
throws
IOException
{
public
void
查看获得线索记录列表
()
throws
IOException
{
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"sellerId"
,
far
.
getUserInfo
(
AGENT_TKU
).
get
(
"sellerId"
)
);
param
.
put
(
"sellerId"
,
xxxSellerId
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"sortType"
,
4
);
param
.
put
(
"sortType"
,
4
);
...
@@ -317,11 +470,11 @@ public class WhoSawMe implements Authorization {
...
@@ -317,11 +470,11 @@ public class WhoSawMe implements Authorization {
}
}
// 查看转发动态访问列表
// 查看转发动态访问列表
@Test
(
description
=
"查看转发
动态访问列表"
,
priority
=
25
)
@Test
(
description
=
"查看转发
素材访问列表"
,
priority
=
34
)
public
void
查看转发
动态
访问列表
()
throws
IOException
{
public
void
查看转发
素材
访问列表
()
throws
IOException
{
// 获取首条素材列表中首条动态id
// 获取首条素材列表中首条动态id
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"sellerId"
,
far
.
getUserInfo
(
AGENT
_TKU
).
get
(
"sellerId"
));
param
.
put
(
"sellerId"
,
far
.
getUserInfo
(
BasicConfig
.
VISITOR2
_TKU
).
get
(
"sellerId"
));
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageSize"
,
20
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"pageIndex"
,
1
);
param
.
put
(
"sortType"
,
4
);
param
.
put
(
"sortType"
,
4
);
...
@@ -336,18 +489,89 @@ public class WhoSawMe implements Authorization {
...
@@ -336,18 +489,89 @@ public class WhoSawMe implements Authorization {
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
GETVISITLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
GETVISITLIST
,
"接口请求失败"
,
response
.
body
().
asString
()));
}
}
// 查看谁看过我首页我的访客列表
// 销售线索_新线索引导
@Test
(
description
=
"查看我的访客列表"
,
priority
=
26
)
@Test
(
description
=
"销售线索详情_新线索引导"
,
priority
=
35
)
public
void
查看我的访客列表
()
throws
IOException
{
public
void
销售线索详情
_
新线索引导
()
throws
IOException
{
List
<
Object
>
customerTagIds
=
Lists
.
newArrayList
();
param
=
new
HashMap
<>();
param
=
new
HashMap
<>();
param
.
put
(
"customerTagIds"
,
customerTagIds
);
param
.
put
(
"guideType"
,
34
);
param
.
put
(
"lastClueId"
,
0
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
COMPLETEGUIDE
);
param
.
put
(
"listType"
,
1
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
COMPLETEGUIDE
,
"接口请求失败"
,
response
.
body
().
asString
()));
param
.
put
(
"pageSize"
,
20
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
COMPLETEGUIDE
,
"完成该引导失败"
,
response
.
body
().
asString
()));
response
=
network
.
postResponse
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
);
}
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"接口请求失败"
,
response
.
body
().
asString
()));
String
visitorWxName
=
response
.
jsonPath
().
getString
(
"data.list[0].nickName"
);
// 销售线索_线索详情
Assert
.
assertEquals
(
visitorWxName
,
far
.
getUserInfo
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"wxName"
),
network
.
message
(
param
,
BasicConfig
.
WHOSAWME_CUSTCLUELISTV3
,
"访客微信昵称不匹配"
,
response
.
body
().
asString
()));
@Test
(
description
=
"销售线索_线索详情"
,
priority
=
36
)
public
void
销售线索
_
线索详情
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"clueId"
,
clueId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CLUEINFO
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CLUEINFO
,
"接口请求失败"
,
response
.
body
().
asString
()));
int
visitClueType
=
response
.
jsonPath
().
getInt
(
"data.visitClueType"
);
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
()));
}
// 销售线索_跟进建议
@Test
(
description
=
"销售线索_跟进建议"
,
priority
=
37
)
public
void
销售线索
_
跟进建议
()
throws
IOException
{
param
=
new
HashMap
<>();
param
.
put
(
"clueId"
,
clueId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
CLUEADVISE
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
CLUEADVISE
,
"接口请求失败"
,
response
.
body
().
asString
()));
List
<
Object
>
adviseList
=
response
.
jsonPath
().
getJsonObject
(
"data.adviceList"
);
Assert
.
assertNotNull
(
adviseList
,
network
.
message
(
param
,
BasicConfig
.
CLUEADVISE
,
"跟进建议内容为空"
,
response
.
body
().
asString
()));
}
// 管理客户信息
@Test
(
description
=
"管理客户信息"
,
priority
=
38
)
public
void
管理客户信息
()
throws
IOException
{
xxrUserId
=
far
.
decodeTku
(
BasicConfig
.
VISITOR1_TKU
).
get
(
"userId"
);
List
<
String
>
tagIds
=
Lists
.
newArrayList
();
tagIds
.
add
(
tagId0
);
param
=
new
HashMap
<>();
param
.
put
(
"custUserId"
,
xxrUserId
);
param
.
put
(
"memo"
,
"备忘录"
);
param
.
put
(
"remarkName"
,
"备注"
);
param
.
put
(
"tagIds"
,
tagIds
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
UPDATETAGANDMEMO
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
UPDATETAGANDMEMO
,
"接口请求失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
UPDATETAGANDMEMO
,
"更新客户信息失败"
,
response
.
body
().
asString
()));
}
// 销售线索_获取访客管理信息
@Test
(
description
=
"销售线索_获取访客管理信息"
,
priority
=
39
)
public
void
销售线索
_
获取访客管理信息
()
throws
IOException
{
String
encodeUserId
=
far
.
encodeId
(
xxrUserId
);
param
=
new
HashMap
<>();
param
.
put
(
"userId"
,
encodeUserId
);
response
=
network
.
getResponse
(
param
,
BasicConfig
.
GETCUSTAGANDMEMO
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"success"
),
network
.
message
(
param
,
BasicConfig
.
GETCUSTAGANDMEMO
,
"接口请求失败"
,
response
.
body
().
asString
()));
String
memo
=
response
.
jsonPath
().
getString
(
"data.memo"
);
String
remarkName
=
response
.
jsonPath
().
getString
(
"data.remarkName"
);
boolean
tagIsMark
=
response
.
jsonPath
().
getBoolean
(
"data.tagList[0].isMark"
);
Assert
.
assertEquals
(
memo
,
"备忘录"
,
network
.
message
(
param
,
BasicConfig
.
GETCUSTAGANDMEMO
,
"用户备忘录内容错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
remarkName
,
"备注"
,
network
.
message
(
param
,
BasicConfig
.
GETCUSTAGANDMEMO
,
"用户备注错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
tagIsMark
,
network
.
message
(
param
,
BasicConfig
.
GETCUSTAGANDMEMO
,
"用户标签错误"
,
response
.
body
().
asString
()));
}
@AfterClass
public
void
tearDown
()
throws
IOException
{
// 登陆管理后台调用管理后台接口删除成员
param
=
new
HashMap
<>();
param
.
put
(
"superiorSid"
,
far
.
getUserInfo
(
BasicConfig
.
VISITOR2_TKU
).
get
(
"sellerId"
));
param
.
put
(
"childSid"
,
childSellerId
);
response
=
network
.
postResponse
(
param
,
BasicConfig
.
MANAGER_SELLERTEAM_REMOVEMEMBER
);
Assert
.
assertTrue
(
response
.
jsonPath
().
getBoolean
(
"data"
),
network
.
message
(
param
,
BasicConfig
.
MANAGER_SELLERTEAM_REMOVEMEMBER
,
"删除成员失败"
,
response
.
body
().
asString
()));
// 切换到被删除代理人确认已没有上级
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
AGENT_TKU
);
response
=
network
.
getResponse
(
BasicConfig
.
BOSS_ROLE
);
boolean
hasSuperior
=
response
.
jsonPath
().
getBoolean
(
"data.hasSuperior"
);
Assert
.
assertFalse
(
hasSuperior
,
network
.
message
(
BasicConfig
.
BOSS_ROLE
,
"该代理人还有上级"
,
response
.
body
().
asString
()));
network
.
agentCookies
.
put
(
"tku"
,
BasicConfig
.
VISITOR2_TKU
);
}
}
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
5e6a7d12
...
@@ -74,6 +74,8 @@ public class BasicConfig {
...
@@ -74,6 +74,8 @@ public class BasicConfig {
public
static
String
VISITOR_TKU
=
"T3gM31f18jCGvqvoyJRzyMTdpcPDJWUJJP4VQje7p9sfC4HKmj5NJfCUkxusAyFb5SpkWS31srDTYr6KtV"
;
public
static
String
VISITOR_TKU
=
"T3gM31f18jCGvqvoyJRzyMTdpcPDJWUJJP4VQje7p9sfC4HKmj5NJfCUkxusAyFb5SpkWS31srDTYr6KtV"
;
// 基础线访客(小雪人) TKU
// 基础线访客(小雪人) TKU
public
static
String
VISITOR1_TKU
=
"T3gM31f18jCFXzk692pKjJCqJZdDv8Nb3htkzNk983cPMspUQD6pVEn2FNMefM2nieKPicXG9c1tDg8qtN"
;
public
static
String
VISITOR1_TKU
=
"T3gM31f18jCFXzk692pKjJCqJZdDv8Nb3htkzNk983cPMspUQD6pVEn2FNMefM2nieKPicXG9c1tDg8qtN"
;
// 基础线访客
public
static
String
VISITOR2_TKU
=
"T3gM31f18jCeKCBVHf5MANgyXeBZGCm8vTJQTuWYXHFqx97PATsWyUYamGaNdNip8bEs9shoE9tTsAmp8x"
;
// 二度访客用
// 访客的sids
// 访客的sids
public
static
final
String
sids
=
"Kj21MjMwNTU"
;
public
static
final
String
sids
=
"Kj21MjMwNTU"
;
// 访客(SuYi) userID:4425
// 访客(SuYi) userID:4425
...
@@ -231,6 +233,9 @@ public class BasicConfig {
...
@@ -231,6 +233,9 @@ public class BasicConfig {
public
static
final
String
MOBILE_result
=
MOBILE_HOST
+
"/clue/guess/number/red/result"
;
public
static
final
String
MOBILE_result
=
MOBILE_HOST
+
"/clue/guess/number/red/result"
;
public
static
final
String
MANAGER_encode
=
MANAGER_HOST
+
"/kjy/manager/testUser/encode"
;
// *************** 宝箱裂变 ***************
// *************** 宝箱裂变 ***************
public
static
final
String
MANAGER_getList4Admin
=
MANAGER_HOST
+
"/kjy/manager/welfare/pre/conf/getList4Admin"
;
public
static
final
String
MANAGER_getList4Admin
=
MANAGER_HOST
+
"/kjy/manager/welfare/pre/conf/getList4Admin"
;
public
static
final
String
MANAGER_saveTreasureConf
=
MANAGER_HOST
+
"/kjy/manager/live/treasure/saveTreasureConf"
;
public
static
final
String
MANAGER_saveTreasureConf
=
MANAGER_HOST
+
"/kjy/manager/live/treasure/saveTreasureConf"
;
...
@@ -684,6 +689,7 @@ public class BasicConfig {
...
@@ -684,6 +689,7 @@ public class BasicConfig {
// *************** 新手任务 ***************
// *************** 新手任务 ***************
public
static
final
String
NOVICE_LIST
=
HOST
+
"/kjy/mp/seller/novice/list"
;
public
static
final
String
NOVICE_LIST
=
HOST
+
"/kjy/mp/seller/novice/list"
;
public
static
final
String
NOVICE_MONGOLIANLAYERISPLAY
=
HOST
+
"/kjy/mp/seller/novice/mongolianLayerDisplay"
;
public
static
final
String
NOVICE_MONGOLIANLAYERISPLAY
=
HOST
+
"/kjy/mp/seller/novice/mongolianLayerDisplay"
;
public
static
final
String
COMPLETEGUIDE
=
HOST
+
"/kjy/mp/rookieGuide/completeGuide"
;
// *************** 谁看过我 ***************
// *************** 谁看过我 ***************
...
@@ -693,10 +699,34 @@ public class BasicConfig {
...
@@ -693,10 +699,34 @@ public class BasicConfig {
public
static
final
String
FORWARD_LIST
=
HOST
+
"/kjy/mp/whoSawMe/forward/list/v2"
;
public
static
final
String
FORWARD_LIST
=
HOST
+
"/kjy/mp/whoSawMe/forward/list/v2"
;
public
static
final
String
FORWARD_CONTENTHEADER
=
HOST
+
"/kjy/mp/whoSawMe/forward/contentHeader"
;
public
static
final
String
FORWARD_CONTENTHEADER
=
HOST
+
"/kjy/mp/whoSawMe/forward/contentHeader"
;
public
static
final
String
FORWARD_VISITRECORD
=
HOST
+
"/kjy/mp/whoSawMe/forward/visitRecordList/v2"
;
public
static
final
String
FORWARD_VISITRECORD
=
HOST
+
"/kjy/mp/whoSawMe/forward/visitRecordList/v2"
;
public
static
final
String
SELLERUNREADMESSAGE
=
HOST
+
"/kjy/mp/custmarketing/sellerUnreadMsg"
;
public
static
final
String
CUSTOMERSEARCH
=
HOST
+
"/kjy/mp/whoSawMe/customerSearch"
;
public
static
final
String
SEARCHCUSTOMERBYCONTENT
=
HOST
+
"/kjy/mp/custmarketing/searchCustomer"
;
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
CUSTINFOHEADER
=
HOST
+
"/kjy/mp/whoSawMe/custInfoHeader"
;
public
static
final
String
CUSTINFO
=
HOST
+
"/kjy/mp/seller/v2/custInfo"
;
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
+
"/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"
;
public
static
final
String
CONTENTVISITRECORD
=
HOST
+
"/kjy/mp/whoSawMe/contentVisitRecord"
;
public
static
final
String
INVITATIONCHAIN
=
HOST
+
"/kjy/mp/whoSawMe/forward/forwardList"
;
public
static
final
String
INVITATIONCHAIN
=
HOST
+
"/kjy/mp/whoSawMe/forward/forwardList"
;
public
static
final
String
UPDATESPECIAL
=
HOST
+
"/kjy/mp/whoSawMe/updateSpecial"
;
public
static
final
String
totalSpecial
=
HOST
+
"/kjy/mp/whoSawMe/customerTotalStatistics"
;
public
static
final
String
UPDATEREMARKNAME
=
HOST
+
"/kjy/mp/seller/customer/updateRemarkName"
;
public
static
final
String
GETCUSTAGANDMEMO
=
HOST
+
"/kjy/mp/seller/getCustomerTagAndMemoInfo"
;
public
static
final
String
UPDATETAGANDMEMO
=
HOST
+
"/kjy/mp/seller/updateTagAndMemoInfo"
;
// *************** 标签管理 ***************
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_DELETE
=
HOST
+
"/kjy/mp/sellerTag/deleteTag"
;
// *************** 文章 ***************
// *************** 文章 ***************
...
@@ -766,12 +796,24 @@ public class BasicConfig {
...
@@ -766,12 +796,24 @@ public class BasicConfig {
public
static
final
String
BOSS_CODE
=
HOST
+
"/kjy/mp/seller/team/invite/code"
;
public
static
final
String
BOSS_CODE
=
HOST
+
"/kjy/mp/seller/team/invite/code"
;
public
static
final
String
BOSS_BOSS
=
HOST
+
"/kjy/mp/seller/team/boss"
;
public
static
final
String
BOSS_BOSS
=
HOST
+
"/kjy/mp/seller/team/boss"
;
public
static
final
String
BOSS_EDITCONFIG
=
HOST
+
"/kjy/mp/sellerConfig/editConfig"
;
public
static
final
String
BOSS_EDITCONFIG
=
HOST
+
"/kjy/mp/sellerConfig/editConfig"
;
public
static
final
String
BOSS_ISDEMO
=
HOST
+
"/kjy/mp/seller/team/isDemo"
;
public
static
final
String
BOSS_TEAMTASKLIST
=
HOST
+
"/kjy/mp/seller/team/task/teamTaskList"
;
public
static
final
String
BOSS_CREATE
=
HOST
+
"/kjy/mp/seller/team/task/create"
;
public
static
final
String
BOSS_DETAIL
=
HOST
+
"/kjy/mp/seller/team/task/detail"
;
public
static
final
String
BOSS_PUBLISH
=
HOST
+
"/kjy/mp/seller/team/task/publish"
;
public
static
final
String
BOSS_RECEIVERLIST
=
HOST
+
"/kjy/mp/seller/team/task/receiverList"
;
public
static
final
String
BOSS_BOUND
=
HOST
+
"/kjy/mp/seller/team/bound"
;
public
static
final
String
BOSS_BOUND
=
HOST
+
"/kjy/mp/seller/team/bound"
;
public
static
final
String
MATERIALLIST
=
HOST
+
"/kjy/mp/seller/dynamic/getMaterialList"
;
public
static
final
String
MATERIALLIST
=
HOST
+
"/kjy/mp/seller/dynamic/getMaterialList"
;
public
static
final
String
FORWARDCARDLIST
=
HOST
+
"/kjy/mp/seller/dynamic/getForwardCardList"
;
public
static
final
String
FORWARDCARDLIST
=
HOST
+
"/kjy/mp/seller/dynamic/getForwardCardList"
;
public
static
final
String
MARKETINGTOOLLIST
=
HOST
+
"/kjy/mp/seller/dynamic/getMarketingToolList"
;
public
static
final
String
MARKETINGTOOLLIST
=
HOST
+
"/kjy/mp/seller/dynamic/getMarketingToolList"
;
public
static
final
String
SALECLUELIST
=
HOST
+
"/kjy/mp/seller/dynamic/getSaleClueList"
;
public
static
final
String
SALECLUELIST
=
HOST
+
"/kjy/mp/seller/dynamic/getSaleClueList"
;
public
static
final
String
GETVISITLIST
=
HOST
+
"/kjy/mp/seller/dynamic/getVisitList"
;
public
static
final
String
GETVISITLIST
=
HOST
+
"/kjy/mp/seller/dynamic/getVisitList"
;
public
static
final
String
TEAMDATA
=
HOST
+
"/kjy/mp/seller/team/data"
;
public
static
final
String
TEAMMEMBERNUM
=
HOST
+
"/kjy/mp/seller/team/memberNumber"
;
public
static
final
String
TEAMRANKINGLIST
=
HOST
+
"/kjy/mp/seller/team/rankingList"
;
// 团队任务
public
static
final
String
FINDPAGEBYCONTENTTYPE
=
HOST
+
"/kjy/mp/exclusiveItem/findPageByContentType"
;
public
static
final
String
TEAMMEMBER
=
HOST
+
"/kjy/mp/seller/team/member"
;
...
@@ -842,7 +884,7 @@ public class BasicConfig {
...
@@ -842,7 +884,7 @@ public class BasicConfig {
public
static
final
String
MANAGER_findId
=
MANAGER_HOST
+
"/kjy/manager/dailyPosters/findById"
;
public
static
final
String
MANAGER_findId
=
MANAGER_HOST
+
"/kjy/manager/dailyPosters/findById"
;
public
static
final
String
MANAGER_addOrUpdate
=
MANAGER_HOST
+
"/kjy/manager/dailyPosters/addOrUpdate"
;
public
static
final
String
MANAGER_addOrUpdate
=
MANAGER_HOST
+
"/kjy/manager/dailyPosters/addOrUpdate"
;
public
static
final
String
MANAGER_dailyPostersDelete
=
MANAGER_HOST
+
"/kjy/manager/dailyPosters/delete"
;
public
static
final
String
MANAGER_dailyPostersDelete
=
MANAGER_HOST
+
"/kjy/manager/dailyPosters/delete"
;
public
static
final
String
MANAGER_
removeMember
=
MANAGER_HOST
+
"/kjy/manager/sellerTeam/removeMember"
;
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_ENCODE
=
MANAGER_HOST
+
"/kjy/manager/testUser/encode"
;
public
static
final
String
MANAGER_TKU_DECODE
=
MANAGER_HOST
+
"/kjy/manager/testUser/decryptTku"
;
public
static
final
String
MANAGER_TKU_DECODE
=
MANAGER_HOST
+
"/kjy/manager/testUser/decryptTku"
;
public
static
final
String
MANAGER_searchTemplateList
=
MANAGER_HOST
+
"/kjy/manager/game/searchTemplateList"
;
public
static
final
String
MANAGER_searchTemplateList
=
MANAGER_HOST
+
"/kjy/manager/game/searchTemplateList"
;
...
...
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