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
cfd1a190
Commit
cfd1a190
authored
Jul 15, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加了我的名片、文章中名片的测试用例
parent
fccdce50
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
844 additions
and
98 deletions
+844
-98
Authorization.java
src/test/java/com/kjj/cases/admin/Authorization.java
+1
-0
ArticalPersonCard.java
...est/java/com/kjj/cases/basics/card/ArticalPersonCard.java
+333
-0
PersonCard.java
src/test/java/com/kjj/cases/basics/card/PersonCard.java
+476
-86
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+18
-1
wechatTestNG.xml
src/test/wechatTestNG.xml
+16
-11
No files found.
src/test/java/com/kjj/cases/admin/Authorization.java
View file @
cfd1a190
...
...
@@ -34,6 +34,7 @@ public interface Authorization {
default
void
userTku
()
{
AGENT_TKU
=
BaseUtils
.
createTku
();
VISITOR_TKU
=
BaseUtils
.
getTku
(
VISITOR_USERID
);
network
.
agentCookies
.
put
(
"tku"
,
VISITOR_TKU
);
System
.
out
.
println
(
"访客tku:"
+
VISITOR_TKU
);
}
...
...
src/test/java/com/kjj/cases/basics/card/ArticalPersonCard.java
0 → 100644
View file @
cfd1a190
package
com
.
kjj
.
cases
.
basics
.
card
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.utils.NetworkUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.*
;
import
org.testng.annotations.Test
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
ArticalPersonCard
implements
Authorization
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
public
String
sid
;
// 加密的销售ID
public
String
articleContentId
;
// 文章的contentId
public
String
scid
;
// getScid后的文章scid
public
String
scId
;
// 底部名片获取的scid
public
int
userId
;
// 代理人用户ID
public
String
visitId
;
// 访问记录ID
@BeforeClass
public
void
setUp
()
{
agentAuth
();
}
//文章内容页
@Test
(
description
=
"代理人_获取用户信息"
,
priority
=
1
)
public
void
代理人
_
获取用户信息
()
{
Response
response
=
network
.
getResponse
(
USER_INFO
);
userId
=
response
.
jsonPath
().
getInt
(
"data.userId"
);
Assert
.
assertNotNull
(
response
.
jsonPath
().
getJsonObject
(
"data"
),
network
.
message
(
USER_INFO
,
"获取用户信息失败"
,
response
.
body
().
asString
()));
}
//文章内容页
@Test
(
description
=
"代理人_种草爆文列表页"
,
priority
=
2
)
public
void
代理人
_
种草爆文列表页
()
{
Response
response
=
network
.
getResponse
(
ARTICLE_GETEXPLOSIONCONTENTLIST
);
articleContentId
=
response
.
jsonPath
().
getString
(
"data[0].contentId"
);
Assert
.
assertNotNull
(
articleContentId
,
network
.
message
(
ARTICLE_GETEXPLOSIONCONTENTLIST
,
"获取爆款素材文章失败"
,
response
.
body
().
asString
()));
}
//文章内容页
@Test
(
description
=
"代理人_文章内容页"
,
priority
=
3
)
public
void
代理人
_
文章内容页
()
{
//根据ContentId获取Scid
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"contentId"
,
articleContentId
);
Response
response
=
network
.
getResponse
(
params
,
GETSCID
);
System
.
out
.
println
(
response
.
body
().
asString
());
scid
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertNotNull
(
scid
,
network
.
message
(
params
,
GETSCID
,
"获取scid失败"
,
response
.
body
().
asString
()));
Map
<
String
,
Object
>
infoParams
=
new
HashMap
<
String
,
Object
>();
infoParams
.
put
(
"scid"
,
scid
);
response
=
network
.
getResponse
(
infoParams
,
ARTICLE_H5INFO
);
String
id
=
response
.
jsonPath
().
getString
(
"data.id"
);
Assert
.
assertEquals
(
articleContentId
,
id
,
network
.
message
(
infoParams
,
ARTICLE_H5INFO
,
"获取文章内容页失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人_获取名片配置"
,
priority
=
4
)
public
void
代理人
_
获取名片配置
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETSELLERCARDCONFIG
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_GETSELLERCARDCONFIG
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_GETSELLERCARDCONFIG
,
"配置列表为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人_获取名片风格配置"
,
priority
=
5
)
public
void
代理人
_
获取名片风格配置
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETSELLERCARDSTYLE
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_GETSELLERCARDSTYLE
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
SELLERCARD_GETSELLERCARDSTYLE
,
"配置列表为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人_获取互动区设置"
,
priority
=
6
)
public
void
代理人
_
获取互动区设置
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"sid"
,
sid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETINTERACTIONCONFIG
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_GETINTERACTIONCONFIG
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_GETINTERACTIONCONFIG
,
"配置列表为空"
,
response
.
body
().
asString
()));
}
// 头部名片
@Test
(
description
=
"代理人_头部名片详情"
,
priority
=
7
)
public
void
代理人
_
头部名片详情
(){
//获取加密的销售ID
Response
response
=
network
.
getResponse
(
USER_INFO
);
sid
=
response
.
jsonPath
().
getString
(
"data.encodeSellerId"
);
String
sellerName
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
//获取名片的姓名、公司等
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"sid"
,
sid
);
params
.
put
(
"timestamp"
,
System
.
currentTimeMillis
());
response
=
network
.
getResponse
(
params
,
SELLERCARD_TOPOFCONTENT
);
String
name
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
Assert
.
assertEquals
(
name
,
sellerName
,
network
.
message
(
params
,
SELLERCARD_TOPOFCONTENT
,
",名片信息错误"
,
response
.
body
().
asString
()));
}
// 底部名片
@Test
(
description
=
"代理人_底部名片详情"
,
priority
=
8
)
public
void
代理人
_
底部名片详情
()
{
//获取加密的销售ID
Response
response
=
network
.
getResponse
(
USER_INFO
);
String
sellerName
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
//获取名片的姓名、公司等
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"sid"
,
sid
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_BOTTOMOFCONTENT
);
scId
=
response
.
jsonPath
().
getString
(
"data.scid"
);
String
name
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
Assert
.
assertEquals
(
name
,
sellerName
,
network
.
message
(
params
,
SELLERCARD_BOTTOMOFCONTENT
,
",名片信息错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人_修改名片配置"
,
priority
=
9
)
public
void
代理人
_
修改名片配置
(){
//修改名片背景
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"configKey"
,
"card_background_color"
);
params
.
put
(
"configValue"
,
"3"
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCONFIG_EDITCONFIG
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCONFIG_EDITCONFIG
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
SELLERCONFIG_EDITCONFIG
,
"修改配置失败"
,
response
.
body
().
asString
()));
//修改展示配置
//关闭名片展示
params
.
put
(
"configKey"
,
"card_share_document"
);
//文章观点
params
.
put
(
"configValue"
,
false
);
response
=
network
.
postResponse
(
params
,
SELLERCONFIG_EDITCONFIG
);
params
.
put
(
"configKey"
,
"card_visit_avatar"
);
//访客头像
params
.
put
(
"configValue"
,
false
);
response
=
network
.
postResponse
(
params
,
SELLERCONFIG_EDITCONFIG
);
params
.
put
(
"configKey"
,
"show_view_business_card"
);
//查看名片
params
.
put
(
"configValue"
,
false
);
response
=
network
.
postResponse
(
params
,
SELLERCONFIG_EDITCONFIG
);
//查看是否修改成功
params
.
clear
();
params
.
put
(
"id"
,
scid
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETSELLERCARDSTYLE
);
System
.
out
.
println
(
params
);
System
.
out
.
println
(
SELLERCARD_GETSELLERCARDSTYLE
);
System
.
out
.
println
(
response
.
body
().
asString
());
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
list
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
String
card_background_color
=
response
.
jsonPath
().
getString
(
"data.find {it.code == 'card_background_color'}.val"
);
boolean
card_share_document
=
response
.
jsonPath
().
getBoolean
(
"data.find {it.code == 'card_share_document'}.val"
);
boolean
card_visit_avatar
=
response
.
jsonPath
().
getBoolean
(
"data.find {it.code == 'card_visit_avatar'}.val"
);
boolean
show_view_business_card
=
response
.
jsonPath
().
getBoolean
(
"data.find {it.code == 'show_view_business_card'}.val"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_GETSELLERCARDSTYLE
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
SELLERCARD_GETSELLERCARDSTYLE
,
"配置列表为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card_background_color
,
"3"
,
network
.
message
(
params
,
SELLERCARD_GETSELLERCARDSTYLE
,
"背景颜色更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
card_share_document
,
network
.
message
(
params
,
SELLERCARD_GETSELLERCARDSTYLE
,
"文章观点更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
card_visit_avatar
,
network
.
message
(
params
,
SELLERCARD_GETSELLERCARDSTYLE
,
"访客头像更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
show_view_business_card
,
network
.
message
(
params
,
SELLERCARD_GETSELLERCARDSTYLE
,
"查看名片更新失败"
,
response
.
body
().
asString
()));
//还原
params
.
clear
();
params
.
put
(
"configKey"
,
"card_background_color"
);
//名片背景
params
.
put
(
"configValue"
,
"1"
);
response
=
network
.
postResponse
(
params
,
SELLERCONFIG_EDITCONFIG
);
params
.
put
(
"configKey"
,
"card_share_document"
);
//文章观点
params
.
put
(
"configValue"
,
false
);
response
=
network
.
postResponse
(
params
,
SELLERCONFIG_EDITCONFIG
);
params
.
put
(
"configKey"
,
"card_visit_avatar"
);
//访客头像
params
.
put
(
"configValue"
,
false
);
response
=
network
.
postResponse
(
params
,
SELLERCONFIG_EDITCONFIG
);
params
.
put
(
"configKey"
,
"show_view_business_card"
);
//名片展示
params
.
put
(
"configValue"
,
false
);
response
=
network
.
postResponse
(
params
,
SELLERCONFIG_EDITCONFIG
);
}
// ******************************** 访客 ****************************
@Test
(
description
=
"访客_记录查看素材"
,
priority
=
10
)
public
void
访客
_
记录查看素材
(){
//切换为访客
userTku
();
sleep
(
1000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
//代理人的scid
params
.
put
(
"cancelPush"
,
false
);
params
.
put
(
"fromUserId"
,
userId
);
// 代理人的用户id
params
.
put
(
"visitPath"
,
1
);
//访问路径来源 0未知,1个人,2朋友圈,3群
Response
response
=
network
.
getResponse
(
params
,
CONTENT_READ
);
System
.
out
.
println
(
params
);
System
.
out
.
println
(
response
.
body
().
asString
());
visitId
=
response
.
jsonPath
().
getString
(
"data.visitId"
);
Assert
.
assertNotNull
(
visitId
,
network
.
message
(
params
,
CONTENT_READ
,
"访客视角-获取访问记录失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客_点赞"
,
priority
=
11
)
public
void
访客
_
点赞
(){
//统计点赞数量
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scId"
,
scId
);
Response
response
=
network
.
getResponse
(
params
,
HASALREADYLIKE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
int
favourTimes
=
response
.
jsonPath
().
getInt
(
"data.favourTimes"
);
System
.
out
.
println
(
params
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
HASALREADYLIKE
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
HASALREADYLIKE
,
"返回数据为空 "
,
response
.
body
().
asString
()));
//点赞
params
.
clear
();
params
.
put
(
"scId"
,
scId
);
params
.
put
(
"visitTableId"
,
visitId
);
response
=
network
.
postResponse
(
params
,
INTERACTION_LIKE
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
params
);
System
.
out
.
println
(
response
.
body
().
asString
());
int
likeFavourTimes
=
response
.
jsonPath
().
getInt
(
"data.favourTimes"
);
boolean
favourResult
=
response
.
jsonPath
().
getBoolean
(
"data.favourResult"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
INTERACTION_LIKE
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
INTERACTION_LIKE
,
"返回数据为空 "
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
likeFavourTimes
!=
0
,
network
.
message
(
params
,
INTERACTION_LIKE
,
"接口返回失败"
,
response
.
body
().
asString
()));
if
(
favourTimes
==
10
){
//最多只允许点赞10次
Assert
.
assertTrue
(
likeFavourTimes
==
favourTimes
,
network
.
message
(
params
,
INTERACTION_LIKE
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
favourResult
,
network
.
message
(
params
,
INTERACTION_LIKE
,
"接口返回失败"
,
response
.
body
().
asString
()));
}
else
{
Assert
.
assertTrue
(
likeFavourTimes
==
favourTimes
+
1
,
network
.
message
(
params
,
INTERACTION_LIKE
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
favourResult
,
network
.
message
(
params
,
INTERACTION_LIKE
,
"接口返回失败"
,
response
.
body
().
asString
()));
}
//查看是否点赞成功
params
.
clear
();
params
.
put
(
"scId"
,
scId
);
response
=
network
.
getResponse
(
params
,
HASALREADYLIKE
);
int
favourTimesNew
=
response
.
jsonPath
().
getInt
(
"data.favourTimes"
);
System
.
out
.
println
(
params
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
favourResult
,
network
.
message
(
params
,
HASALREADYLIKE
,
"接口返回失败"
,
response
.
body
().
asString
()));
if
(
favourTimes
==
10
){
//最多只允许点赞10次
Assert
.
assertEquals
(
favourTimesNew
,
favourTimes
,
network
.
message
(
params
,
HASALREADYLIKE
,
"点赞后数量错误"
,
response
.
body
().
asString
()));
}
else
{
Assert
.
assertEquals
(
favourTimesNew
,
favourTimes
+
1
,
network
.
message
(
params
,
HASALREADYLIKE
,
"点赞后数量错误"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客_换成我的名片"
,
priority
=
12
)
public
void
访客
_
换成我的名片
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETSELLERPROMOTEINFO
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_GETSELLERPROMOTEINFO
,
"获取专业解读列表有误"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_GETSELLERPROMOTEINFO
,
"获取专业解读列表有误"
,
response
.
body
().
asString
()));
}
// 获取互动区-专业解读
@Test
(
description
=
"代理人_互动区-专业解读"
,
priority
=
13
)
public
void
代理人
_
互动区
_
专业解读
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
ARTICLE_ENHANCEDCOLUMN_GETCONTENTS
);
boolean
hasList
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
)
>
0
;
Assert
.
assertTrue
(
hasList
,
network
.
message
(
params
,
ARTICLE_ENHANCEDCOLUMN_GETCONTENTS
,
"获取专业解读列表有误"
,
response
.
body
().
asString
()));
}
// 获取互动区-互动问答
@Test
(
description
=
"代理人_互动区-互动问答"
,
priority
=
14
)
public
void
代理人
_
互动区
_
互动问答
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
2
);
Response
response
=
network
.
getResponse
(
params
,
ARTICLE_ENHANCEDCOLUMN_GETFAQS
);
boolean
hasList
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
)
>
0
;
Assert
.
assertTrue
(
hasList
,
network
.
message
(
params
,
ARTICLE_ENHANCEDCOLUMN_GETFAQS
,
"代理人-获取个人专栏列表有误"
,
response
.
body
().
asString
()));
String
answer
=
response
.
jsonPath
().
getString
(
"data.list[0].answer"
);
Assert
.
assertNotNull
(
answer
,
network
.
message
(
params
,
ARTICLE_ENHANCEDCOLUMN_GETFAQS
,
"获取问答内容有误"
,
response
.
body
().
asString
()));
}
// 获取互动区-风险评测
@Test
(
description
=
"代理人_互动区-风险评测"
,
priority
=
15
)
public
void
代理人
_
互动区
_
风险评测
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
ARTICLE_ISDISPLAYACTIVITY
);
boolean
isDisplay
=
response
.
jsonPath
().
getBoolean
(
"data.isDisplay"
);
String
riskScid
=
response
.
jsonPath
().
getString
(
"data.scid"
);
Assert
.
assertTrue
(
isDisplay
,
network
.
message
(
params
,
ARTICLE_ISDISPLAYACTIVITY
,
"互动区-风险评测显示有误"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
riskScid
,
network
.
message
(
params
,
ARTICLE_ISDISPLAYACTIVITY
,
"互动区-风险评测内容有误"
,
response
.
body
().
asString
()));
}
// 获取代理人个人专栏
@Test
(
description
=
"访客_查询是否存在未读消息"
,
priority
=
16
)
public
void
访客
_
查询是否存在未读消息
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"t"
,
System
.
currentTimeMillis
());
Response
response
=
network
.
getResponse
(
params
,
CHECKUNREAD
);
String
desc
=
response
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
desc
,
"OK"
,
network
.
message
(
params
,
CHECKUNREAD
,
"访客-获取私信有误"
,
response
.
body
().
asString
()));
}
@AfterClass
public
static
void
tearDown
(){
network
.
agentCookies
.
put
(
"tku"
,
AGENT_TKU
);
//tku 切换为访客的
apiCount
+=
16
;
}
}
src/test/java/com/kjj/cases/basics/card/PersonCard.java
View file @
cfd1a190
package
com
.
kjj
.
cases
.
basics
.
card
;
import
com.kjj.bean.card.GoodMajor
;
import
com.kjj.bean.card.WechatCard
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.JsonUtil
;
import
com.kjj.utils.NetworkUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
utils
.
ThreadSleepUtils
.
sleep
;
public
class
PersonCard
implements
Authorization
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
public
String
scid
;
public
String
visitor_scid
;
public
String
sellerCaseId
;
public
String
personalProductId
;
public
String
appraiseId
;
long
userId
;
String
questionId
;
@BeforeClass
public
void
setUp
()
{
...
...
@@ -35,8 +37,8 @@ public class PersonCard implements Authorization {
public
void
获取用户信息
(){
Response
response
=
network
.
getResponse
(
USER_INFO
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
long
userId
=
response
.
jsonPath
().
getLong
(
"data.userId"
);
Object
data
=
response
.
jsonPath
().
get
Boolean
(
"data"
);
userId
=
response
.
jsonPath
().
getLong
(
"data.userId"
);
Object
data
=
response
.
jsonPath
().
get
JsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
USER_INFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
USER_INFO
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
userId
,
5495
,
network
.
message
(
USER_INFO
,
"用户不是吉吉"
,
response
.
body
().
asString
()));
...
...
@@ -49,20 +51,21 @@ public class PersonCard implements Authorization {
Response
response
=
network
.
getResponse
(
params
,
VERSION_INFO
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
int
userVersion
=
response
.
jsonPath
().
getInt
(
"data.find {it.openType == 1}.userVersion"
);
Object
data
=
response
.
jsonPath
().
get
Boolean
(
"data"
);
Object
data
=
response
.
jsonPath
().
get
JsonObject
(
"data"
);
boolean
vip
=
response
.
jsonPath
().
getBoolean
(
"data.find {it.openType == 1}.vip"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
VERSION_INFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
VERSION_INFO
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
vip
,
network
.
message
(
VERSION_INFO
,
"开启但不是VIP"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
userVersion
,
2
,
network
.
message
(
VERSION_INFO
,
"用户不是保险专业版"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
VERSION_INFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
VERSION_INFO
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
vip
,
network
.
message
(
params
,
VERSION_INFO
,
"开启但不是VIP"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
userVersion
,
2
,
network
.
message
(
params
,
VERSION_INFO
,
"用户不是保险专业版"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取名片顶部信息"
,
priority
=
3
)
public
void
获取名片顶部信息
(){
Response
response
=
network
.
getResponse
(
SELLERCARD_TOPOFDETAIL
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
get
Boolean
(
"data"
);
Object
data
=
response
.
jsonPath
().
get
JsonObject
(
"data"
);
WechatCard
card
=
JsonUtil
.
parseResponseToBean
(
response
,
WechatCard
.
class
);
System
.
out
.
println
(
response
.
body
().
asString
());
scid
=
response
.
jsonPath
().
getString
(
"data.scid"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_TOPOFDETAIL
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
SELLERCARD_TOPOFDETAIL
,
"返回数据为空"
,
response
.
body
().
asString
()));
...
...
@@ -86,22 +89,22 @@ public class PersonCard implements Authorization {
params
.
put
(
"avatarStyle"
,
1
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITBASEINFO
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_EDITBASEINFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITBASEINFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
//查看修改是否成功
response
=
network
.
getResponse
(
SELLERCARD_TOPOFDETAIL
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
get
Boolean
(
"data"
);
Object
data
=
response
.
jsonPath
().
get
JsonObject
(
"data"
);
WechatCard
card
=
JsonUtil
.
parseResponseToBean
(
response
,
WechatCard
.
class
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_TOPOFDETAIL
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
SELLERCARD_TOPOFDETAIL
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getSellerName
(),
"自动化测试"
,
network
.
message
(
SELLERCARD_TOPOFDETAIL
,
"名字修改失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getJobPost
(),
"啦啦啦"
,
network
.
message
(
SELLERCARD_TOPOFDETAIL
,
"职业修改失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getPhoneNumber
(),
"13043214321"
,
network
.
message
(
SELLERCARD_TOPOFDETAIL
,
"电话修改失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getWechatNumber
(),
"wx654321"
,
network
.
message
(
SELLERCARD_TOPOFDETAIL
,
"微信号修改失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getAddress
(),
"重庆市轨道集团建设大楼"
,
network
.
message
(
SELLERCARD_TOPOFDETAIL
,
"地址修改失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getAddressLocation
(),
"106.544362,29.559164"
,
network
.
message
(
SELLERCARD_TOPOFDETAIL
,
"地址经纬度修改失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getAvatarStyle
(),
1
,
network
.
message
(
SELLERCARD_TOPOFDETAIL
,
"专业风格修改失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_TOPOFDETAIL
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_TOPOFDETAIL
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getSellerName
(),
"自动化测试"
,
network
.
message
(
params
,
SELLERCARD_TOPOFDETAIL
,
"名字修改失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getJobPost
(),
"啦啦啦"
,
network
.
message
(
params
,
SELLERCARD_TOPOFDETAIL
,
"职业修改失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getPhoneNumber
(),
"13043214321"
,
network
.
message
(
params
,
SELLERCARD_TOPOFDETAIL
,
"电话修改失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getWechatNumber
(),
"wx654321"
,
network
.
message
(
params
,
SELLERCARD_TOPOFDETAIL
,
"微信号修改失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getAddress
(),
"重庆市轨道集团建设大楼"
,
network
.
message
(
params
,
SELLERCARD_TOPOFDETAIL
,
"地址修改失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getAddressLocation
(),
"106.544362,29.559164"
,
network
.
message
(
params
,
SELLERCARD_TOPOFDETAIL
,
"地址经纬度修改失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getAvatarStyle
(),
1
,
network
.
message
(
params
,
SELLERCARD_TOPOFDETAIL
,
"专业风格修改失败"
,
response
.
body
().
asString
()));
//还原用户信息
params
.
clear
();
...
...
@@ -114,14 +117,14 @@ public class PersonCard implements Authorization {
params
.
put
(
"avatarStyle"
,
3
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITBASEINFO
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_TOPOFDETAIL
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITBASEINFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取用户个人介绍
模块
"
,
priority
=
5
)
public
void
获取用户个人介绍
模块
(){
@Test
(
description
=
"获取用户个人介绍"
,
priority
=
5
)
public
void
获取用户个人介绍
(){
Response
response
=
network
.
getResponse
(
SELLERCARD_PERSONALPROFILE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
get
Boolean
(
"data"
);
Object
data
=
response
.
jsonPath
().
get
JsonObject
(
"data"
);
String
personalIntro
=
response
.
jsonPath
().
getString
(
"data.personalIntro"
);
int
exprLength
=
response
.
jsonPath
().
getInt
(
"data.exprLength"
);
Object
majors
=
response
.
jsonPath
().
getBoolean
(
"data.goodAtMajor"
);
...
...
@@ -138,11 +141,11 @@ public class PersonCard implements Authorization {
params
.
put
(
"pageSize"
,
30
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETPERSONINTROTEMPLATE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
get
Boolean
(
"data"
);
Object
data
=
response
.
jsonPath
().
get
JsonObject
(
"data"
);
int
totalCount
=
response
.
jsonPath
().
getInt
(
"data.totalCount"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFIL
E
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
SELLERCARD_PERSONALPROFIL
E
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
totalCount
>
1
,
network
.
message
(
SELLERCARD_PERSONALPROFIL
E
,
"模板列表为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_GETPERSONINTROTEMPLAT
E
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_GETPERSONINTROTEMPLAT
E
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
totalCount
>
1
,
network
.
message
(
params
,
SELLERCARD_GETPERSONINTROTEMPLAT
E
,
"模板列表为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改个人介绍模块"
,
priority
=
7
)
...
...
@@ -153,7 +156,7 @@ public class PersonCard implements Authorization {
params
.
put
(
"exprLength"
,
"4"
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITBASEINFO
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_EDITBASEINFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITBASEINFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
//修改专业标签
params
.
clear
();
...
...
@@ -161,21 +164,21 @@ public class PersonCard implements Authorization {
params
.
put
(
"goodAtCustom"
,
""
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITMAJORGOODAUTH
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_EDITMAJORGOODAUTH
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITMAJORGOODAUTH
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
//查看修改是否成功
response
=
network
.
getResponse
(
SELLERCARD_PERSONALPROFILE
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
get
Boolean
(
"data"
);
Object
data
=
response
.
jsonPath
().
get
JsonObject
(
"data"
);
String
personalIntro
=
response
.
jsonPath
().
getString
(
"data.personalIntro"
);
int
exprLength
=
response
.
jsonPath
().
getInt
(
"data.exprLength"
);
List
<
GoodMajor
>
majors
=
JsonUtil
.
parseResponsePathToListBean
(
response
,
"data.goodAtMajor"
,
GoodMajor
.
class
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
personalIntro
,
"本人有多年的保险销售和管理经验!"
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"个人介绍信息错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
exprLength
,
4
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"年限信息错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
majors
.
get
(
0
).
isChoose
(),
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"专业标签更新错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
majors
.
get
(
1
).
isChoose
(),
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"专业标签更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_PERSONALPROFILE
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_PERSONALPROFILE
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
personalIntro
,
"本人有多年的保险销售和管理经验!"
,
network
.
message
(
params
,
SELLERCARD_PERSONALPROFILE
,
"个人介绍信息错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
exprLength
,
4
,
network
.
message
(
params
,
SELLERCARD_PERSONALPROFILE
,
"年限信息错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
majors
.
get
(
0
).
isChoose
(),
network
.
message
(
params
,
SELLERCARD_PERSONALPROFILE
,
"专业标签更新错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
majors
.
get
(
1
).
isChoose
(),
network
.
message
(
params
,
SELLERCARD_PERSONALPROFILE
,
"专业标签更新失败"
,
response
.
body
().
asString
()));
//还原个人介绍模块
//还原个人介绍和年限
...
...
@@ -184,7 +187,7 @@ public class PersonCard implements Authorization {
params
.
put
(
"exprLength"
,
"2"
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITBASEINFO
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_EDITBASEINFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITBASEINFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
//还原专业标签
params
.
clear
();
...
...
@@ -192,7 +195,7 @@ public class PersonCard implements Authorization {
params
.
put
(
"goodAtCustom"
,
""
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITMAJORGOODAUTH
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_EDITMAJORGOODAUTH
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITMAJORGOODAUTH
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"更新代理人精彩点滴照片"
,
priority
=
8
)
...
...
@@ -201,7 +204,7 @@ public class PersonCard implements Authorization {
params
.
put
(
"url"
,
"//yun.kjjcrm.com/kjy/image/20210706/03fef13271844ac6b3dcd2663e70ff9c.jpg,//yun.kjjcrm.com/kjy/image/20210706/21565ef0951744298f268b72fff44d14.jpg"
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_UPDATESPLENDINGIMAGE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"更新失败
"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_UPDATESPLENDINGIMAGE
,
"接口返回失败状态
"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取代理人精彩点滴照片"
,
priority
=
9
)
...
...
@@ -211,20 +214,20 @@ public class PersonCard implements Authorization {
params
.
put
(
"pageSize"
,
"100"
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETSPLENDINGIMAGE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
get
Boolean
(
"data"
);
Object
data
=
response
.
jsonPath
().
get
JsonObject
(
"data"
);
int
totalCount
=
response
.
jsonPath
().
getInt
(
"data.totalCount"
);
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"更新失败
"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
SELLERCARD_PERSONALPROFIL
E
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
totalCount
,
2
,
network
.
message
(
SELLERCARD_PERSONALPROFIL
E
,
"更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
size
,
2
,
network
.
message
(
SELLERCARD_PERSONALPROFIL
E
,
"更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_GETSPLENDINGIMAGE
,
"接口返回失败状态
"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_GETSPLENDINGIMAG
E
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
totalCount
,
2
,
network
.
message
(
params
,
SELLERCARD_GETSPLENDINGIMAG
E
,
"更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
size
,
2
,
network
.
message
(
params
,
SELLERCARD_GETSPLENDINGIMAG
E
,
"更新失败"
,
response
.
body
().
asString
()));
//还原
params
.
clear
();
params
.
put
(
"url"
,
"//yun.kjjcrm.com/kjy/image/20210706/03fef13271844ac6b3dcd2663e70ff9c.jpg"
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_UPDATESPLENDINGIMAGE
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"更新失败
"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_UPDATESPLENDINGIMAGE
,
"接口返回失败状态
"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"根据page获取当前页面的Tips"
,
priority
=
10
)
//priorty 方法执行优先级
...
...
@@ -232,11 +235,11 @@ public class PersonCard implements Authorization {
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"page"
,
"seller_card"
);
params
.
put
(
"timestamp"
,
System
.
currentTimeMillis
());
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_SELLERCARDCASENEW
);
Response
response
=
network
.
getResponse
(
params
,
GREETING_GETTIPSBYPAGE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
get
Boolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"更新失败
"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
SELLERCARD_PERSONALPROFIL
E
,
"返回数据为空"
,
response
.
body
().
asString
()));
Object
data
=
response
.
jsonPath
().
get
JsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
GREETING_GETTIPSBYPAGE
,
"接口返回失败状态
"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
GREETING_GETTIPSBYPAG
E
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取客户投保案例模块"
,
priority
=
11
)
//priorty 方法执行优先级
...
...
@@ -247,16 +250,15 @@ public class PersonCard implements Authorization {
params
.
put
(
"isMore"
,
false
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_SELLERCARDCASENEW
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
get
Boolean
(
"data"
);
Object
data
=
response
.
jsonPath
().
get
JsonObject
(
"data"
);
int
count
=
response
.
jsonPath
().
getInt
(
"data.sellerCases.size()"
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
count
,
3
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"添加个人案例"
,
priority
=
12
)
//priorty 方法执行优先级
public
void
添加
服务
案例
()
{
public
void
添加
个人
案例
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"caseIntro"
,
"案例描述A"
);
params
.
put
(
"casePics"
,
"//yun.kjjcrm.com/kjy/image/20210706/5abb605cb2444dff8213bcdfcfa04ca4.jpg"
);
...
...
@@ -265,7 +267,7 @@ public class PersonCard implements Authorization {
params
.
put
(
"product"
,
"金牌产品A"
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITDELLERCASE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"添加失败
"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_PERSONALPROFILE
,
"接口返回失败状态
"
,
response
.
body
().
asString
()));
//查看是否添加成功
params
.
clear
();
...
...
@@ -279,7 +281,7 @@ public class PersonCard implements Authorization {
String
product
=
response
.
jsonPath
().
getString
(
"data.sellerCases.get(0).product"
);
sellerCaseId
=
response
.
jsonPath
().
getString
(
"data.sellerCases.get(0).id"
);
boolean
isShow
=
response
.
jsonPath
().
getBoolean
(
"data.sellerCases.get(0).isShow"
);
Assert
.
assertEquals
(
count
,
4
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-获取
失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
count
,
4
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-获取
案例数量错误
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
caseIntro
,
"案例描述A"
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-描述错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
customerName
,
"客户A"
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-客户错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
product
,
"金牌产品A"
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-产品错误"
,
response
.
body
().
asString
()));
...
...
@@ -293,7 +295,7 @@ public class PersonCard implements Authorization {
params
.
put
(
"caseIntro"
,
"案例描述A进行了更新"
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITDELLERCASE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"添加失败
"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITDELLERCASE
,
"接口返回失败状态
"
,
response
.
body
().
asString
()));
//查看是否添加成功
params
.
clear
();
...
...
@@ -303,7 +305,7 @@ public class PersonCard implements Authorization {
response
=
network
.
getResponse
(
params
,
SELLERCARD_SELLERCARDCASENEW
);
int
count
=
response
.
jsonPath
().
getInt
(
"data.sellerCases.size()"
);
String
caseIntro
=
response
.
jsonPath
().
getString
(
"data.sellerCases.get(0).caseIntro"
);
Assert
.
assertEquals
(
count
,
4
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-获取
失败
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
count
,
4
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-获取
案例数量错误
"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
caseIntro
,
"案例描述A进行了更新"
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-描述错误"
,
response
.
body
().
asString
()));
}
...
...
@@ -317,7 +319,9 @@ public class PersonCard implements Authorization {
params
.
put
(
"sellerCaseId"
,
sellerCaseId
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_UPDATESHOWSTATUSFORCASE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"更新失败"
,
response
.
body
().
asString
()));
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_UPDATESHOWSTATUSFORCASE
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
SELLERCARD_UPDATESHOWSTATUSFORCASE
,
"更新失败"
,
response
.
body
().
asString
()));
//查看状态是否更新成功
params
.
clear
();
...
...
@@ -336,7 +340,10 @@ public class PersonCard implements Authorization {
params
.
put
(
"sellerCaseId"
,
sellerCaseId
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_UPDATESHOWSTATUSFORCASE
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"更新失败"
,
response
.
body
().
asString
()));
data
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_PERSONALPROFILE
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
SELLERCARD_PERSONALPROFILE
,
"更新失败"
,
response
.
body
().
asString
()));
//查看状态是否更新成功
params
.
clear
();
...
...
@@ -348,13 +355,25 @@ public class PersonCard implements Authorization {
Assert
.
assertTrue
(
isShow
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"删除个人案例"
,
priority
=
15
)
//priorty 方法执行优先级
@Test
(
description
=
"访客查看某条个人案例"
,
priority
=
15
)
//priorty 方法执行优先级
public
void
查看某条个人案例
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
sellerCaseId
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETSELLERCASEINFO
);
String
path
=
"data.caseIntro"
;
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
String
caseIntro
=
response
.
jsonPath
().
getString
(
path
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_GETSELLERCASEINFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
caseIntro
,
"案例描述A进行了更新"
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-描述错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"删除个人案例"
,
priority
=
16
)
//priorty 方法执行优先级
public
void
删除个人案例
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
sellerCaseId
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_DELETESELLERCASE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"更新失败
"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_PERSONALPROFILE
,
"接口返回失败状态
"
,
response
.
body
().
asString
()));
//查看是否删除成功
params
.
clear
();
...
...
@@ -366,7 +385,7 @@ public class PersonCard implements Authorization {
Assert
.
assertEquals
(
count
,
3
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看精选产品"
,
priority
=
1
6
)
//priorty 方法执行优先级
@Test
(
description
=
"查看精选产品"
,
priority
=
1
7
)
//priorty 方法执行优先级
public
void
查看精选产品
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
...
...
@@ -374,15 +393,14 @@ public class PersonCard implements Authorization {
params
.
put
(
"isMore"
,
true
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_PRODUCTLIST
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
get
Boolean
(
"data"
);
Object
data
=
response
.
jsonPath
().
get
JsonObject
(
"data"
);
int
count
=
response
.
jsonPath
().
getInt
(
"data.productList.size()"
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PRODUCTLIST
,
"更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
SELLERCARD_PRODUCTLIST
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
count
,
3
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"添加精选产品"
,
priority
=
1
7
)
//priorty 方法执行优先级
@Test
(
description
=
"添加精选产品"
,
priority
=
1
8
)
//priorty 方法执行优先级
public
void
添加精选产品
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"productName"
,
"这是性价比非常高、投入少、保额高的产品"
);
...
...
@@ -391,7 +409,7 @@ public class PersonCard implements Authorization {
params
.
put
(
"productImg"
,
"//yun.kjjcrm.com/kjy/image/20210709/a349c64087224a47a8ba0b8bc49f3498.jpg"
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_ADDORUPDATEPRODUCT
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_ADDORUPDATEPRODUCT
,
"添加失败
"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_ADDORUPDATEPRODUCT
,
"接口返回失败状态
"
,
response
.
body
().
asString
()));
//查看是否添加成功
params
.
clear
();
...
...
@@ -406,7 +424,6 @@ public class PersonCard implements Authorization {
String
productImg
=
response
.
jsonPath
().
getString
(
"data.productList.get(0).productImg"
);
personalProductId
=
response
.
jsonPath
().
getString
(
"data.productList.get(0).personalProductId"
);
boolean
isShow
=
response
.
jsonPath
().
getBoolean
(
"data.productList.get(0).isShow"
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertEquals
(
count
,
4
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
productName
,
"这是性价比非常高、投入少、保额高的产品"
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"服务案例-描述错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
externalLink
,
"http://www.baidu.com"
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"服务案例-客户错误"
,
response
.
body
().
asString
()));
...
...
@@ -415,7 +432,7 @@ public class PersonCard implements Authorization {
Assert
.
assertTrue
(
isShow
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改精选产品"
,
priority
=
1
8
)
//priorty 方法执行优先级
@Test
(
description
=
"修改精选产品"
,
priority
=
1
9
)
//priorty 方法执行优先级
public
void
修改精选产品
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"productName"
,
"这是性价比非常高、投入少、保额高的产品"
);
...
...
@@ -425,7 +442,9 @@ public class PersonCard implements Authorization {
params
.
put
(
"productFeature"
,
"这是产品描述进行了更新"
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_ADDORUPDATEPRODUCT
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_ADDORUPDATEPRODUCT
,
"添加失败"
,
response
.
body
().
asString
()));
String
data
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_ADDORUPDATEPRODUCT
,
"添加失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
data
,
personalProductId
,
network
.
message
(
params
,
SELLERCARD_ADDORUPDATEPRODUCT
,
"添加失败"
,
response
.
body
().
asString
()));
//查看是否添加成功
params
.
clear
();
...
...
@@ -434,18 +453,13 @@ public class PersonCard implements Authorization {
params
.
put
(
"isMore"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_PRODUCTLIST
);
int
count
=
response
.
jsonPath
().
getInt
(
"data.productList.size()"
);
String
productName
=
response
.
jsonPath
().
getString
(
"data.productList.get(0).productName"
);
String
externalLink
=
response
.
jsonPath
().
getString
(
"data.productList.get(0).externalLink"
);
String
productFeature
=
response
.
jsonPath
().
getString
(
"data.productList.get(0).productFeature"
);
String
productImg
=
response
.
jsonPath
().
getString
(
"data.productList.get(0).productImg"
);
personalProductId
=
response
.
jsonPath
().
getString
(
"data.productList.get(0).personalProductId"
);
boolean
isShow
=
response
.
jsonPath
().
getBoolean
(
"data.productList.get(0).isShow"
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertEquals
(
count
,
4
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
productFeature
,
"这是产品描述进行了更新"
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"服务案例-产品错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改产品展示状态"
,
priority
=
19
)
//priorty 方法执行优先级
@Test
(
description
=
"修改产品展示状态"
,
priority
=
20
)
//priorty 方法执行优先级
public
void
修改产品展示状态
()
{
//取消展示
...
...
@@ -455,7 +469,9 @@ public class PersonCard implements Authorization {
params
.
put
(
"personalProductId"
,
personalProductId
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_UPDATESHOWSTATUSFORPRODUCT
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_UPDATESHOWSTATUSFORPRODUCT
,
"更新失败"
,
response
.
body
().
asString
()));
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_UPDATESHOWSTATUSFORPRODUCT
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
SELLERCARD_UPDATESHOWSTATUSFORPRODUCT
,
"更新失败"
,
response
.
body
().
asString
()));
//查看状态是否更新成功
params
.
clear
();
...
...
@@ -475,7 +491,9 @@ public class PersonCard implements Authorization {
params
.
put
(
"personalProductId"
,
personalProductId
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_UPDATESHOWSTATUSFORPRODUCT
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_UPDATESHOWSTATUSFORPRODUCT
,
"更新失败"
,
response
.
body
().
asString
()));
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_UPDATESHOWSTATUSFORPRODUCT
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
SELLERCARD_UPDATESHOWSTATUSFORPRODUCT
,
"更新失败"
,
response
.
body
().
asString
()));
//查看状态是否更新成功
params
.
clear
();
...
...
@@ -487,14 +505,14 @@ public class PersonCard implements Authorization {
Assert
.
assertTrue
(
isShow
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"删除精选产品"
,
priority
=
2
0
)
//priorty 方法执行优先级
@Test
(
description
=
"删除精选产品"
,
priority
=
2
1
)
//priorty 方法执行优先级
public
void
删除精选产品
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"personalProductId"
,
personalProductId
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_DELETEPRODUCT
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_DELETEPRODUCT
,
"更新
失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_DELETEPRODUCT
,
"接口返回
失败"
,
response
.
body
().
asString
()));
//查看是否删除成功
params
.
clear
();
...
...
@@ -505,4 +523,376 @@ public class PersonCard implements Authorization {
int
count
=
response
.
jsonPath
().
getInt
(
"data.productList.size()"
);
Assert
.
assertEquals
(
count
,
3
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看客户评价"
,
priority
=
22
)
//priorty 方法执行优先级
public
void
查看客户评价
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
3
);
params
.
put
(
"appraiseState"
,
1
);
params
.
put
(
"isPersonal"
,
false
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_APPRAISELISTNEW
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_APPRAISELISTNEW
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_APPRAISELISTNEW
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"发表个人评价"
,
priority
=
23
)
//priorty 方法执行优先级
public
void
发表个人评价
()
{
userTku
();
sleep
(
1000
);
Response
response
=
network
.
getResponse
(
SELLERCARD_TOPOFDETAIL
);
visitor_scid
=
response
.
jsonPath
().
getString
(
"data.scid"
);
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"anonymity"
,
0
);
params
.
put
(
"content"
,
"非常值得信赖的代理人呀"
);
params
.
put
(
"id"
,
null
);
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"star"
,
5
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_SAVECARDAPPRAISE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_SAVECARDAPPRAISE
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
SELLERCARD_SAVECARDAPPRAISE
,
"发表评价失败"
,
response
.
body
().
asString
()));
//查看是否添加成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"appraiseState"
,
1
);
params
.
put
(
"isPersonal"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_APPRAISELISTNEW
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
String
content
=
response
.
jsonPath
().
getString
(
"data.ownAppraise.content"
);
String
visitorName
=
response
.
jsonPath
().
getString
(
"data.ownAppraise.visitorName"
);
int
star
=
response
.
jsonPath
().
getInt
(
"data.ownAppraise.star"
);
int
appraiseState
=
response
.
jsonPath
().
getInt
(
"data.ownAppraise.appraiseState"
);
appraiseId
=
response
.
jsonPath
().
getString
(
"data.ownAppraise.id"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_APPRAISELISTNEW
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
content
,
"非常值得信赖的代理人呀"
,
network
.
message
(
params
,
SELLERCARD_APPRAISELISTNEW
,
"更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
visitorName
,
"Su Yi"
,
network
.
message
(
params
,
SELLERCARD_APPRAISELISTNEW
,
"更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
appraiseState
,
0
,
network
.
message
(
params
,
SELLERCARD_APPRAISELISTNEW
,
"更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
star
,
5
,
network
.
message
(
params
,
SELLERCARD_APPRAISELISTNEW
,
"更新失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改个人评价展示状态"
,
priority
=
24
)
//priorty 方法执行优先级
public
void
修改个人评价展示状态
()
{
agentTku
();
//展示
sleep
(
1000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"appraiseState"
,
1
);
params
.
put
(
"id"
,
appraiseId
);
params
.
put
(
"isPersonal"
,
true
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITCARDAPPRAISE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITCARDAPPRAISE
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
SELLERCARD_EDITCARDAPPRAISE
,
"删除失败"
,
response
.
body
().
asString
()));
//查看是否修改成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"appraiseState"
,
1
);
params
.
put
(
"isPersonal"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_APPRAISELISTNEW
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
String
path
=
"data.appraiseList.list.find {it.id == \""
+
appraiseId
+
"\"}.appraiseState"
;
int
appraiseState
=
response
.
jsonPath
().
getInt
(
path
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_APPRAISELISTNEW
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
appraiseState
,
1
,
network
.
message
(
params
,
SELLERCARD_APPRAISELISTNEW
,
"返回数据为空"
,
response
.
body
().
asString
()));
//取消展示
params
.
clear
();
params
.
put
(
"appraiseState"
,
0
);
params
.
put
(
"id"
,
appraiseId
);
params
.
put
(
"isPersonal"
,
true
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITCARDAPPRAISE
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITCARDAPPRAISE
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
SELLERCARD_EDITCARDAPPRAISE
,
"删除失败"
,
response
.
body
().
asString
()));
//查看是否修改成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"appraiseState"
,
0
);
params
.
put
(
"isPersonal"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_APPRAISELISTNEW
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
appraiseState
=
response
.
jsonPath
().
getJsonObject
(
path
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_APPRAISELISTNEW
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
appraiseState
,
0
,
network
.
message
(
params
,
SELLERCARD_APPRAISELISTNEW
,
"删除失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"删除个人评价"
,
priority
=
25
)
//priorty 方法执行优先级
public
void
删除个人评价
()
{
userTku
();
sleep
(
1000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
appraiseId
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_DELCARDAPPRAISE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_DELCARDAPPRAISE
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
SELLERCARD_DELCARDAPPRAISE
,
"删除失败"
,
response
.
body
().
asString
()));
//查看是否删除成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"appraiseState"
,
1
);
params
.
put
(
"isPersonal"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_APPRAISELISTNEW
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
ownAppraise
=
response
.
jsonPath
().
getJsonObject
(
"data.ownAppraise"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_APPRAISELISTNEW
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNull
(
ownAppraise
,
network
.
message
(
params
,
SELLERCARD_APPRAISELISTNEW
,
"删除失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看公司信息"
,
priority
=
26
)
//priorty 方法执行优先级
public
void
查看公司信息
()
{
agentTku
();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_COMPANYINFO
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_COMPANYINFO
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_COMPANYINFO
,
"公司信息为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"分享名片"
,
priority
=
27
)
//priorty 方法执行优先级
public
void
分享名片
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
String
scene
=
scid
+
","
+
userId
+
",s=1"
;
params
.
put
(
"needAvatarCover"
,
true
);
params
.
put
(
"pageType"
,
1
);
params
.
put
(
"scene"
,
scene
);
params
.
put
(
"visitorId"
,
userId
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_AYSNCGETMPORCODE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_AYSNCGETMPORCODE
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_AYSNCGETMPORCODE
,
"公司信息为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看赠险列表"
,
priority
=
28
)
//priorty 方法执行优先级
public
void
查看赠险列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_INSURANCELISTV2
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_INSURANCELISTV2
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_INSURANCELISTV2
,
"赠险列表为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取代理人专栏配置"
,
priority
=
29
)
//priorty 方法执行优先级
public
void
获取代理人专栏配置
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETENHANCEDCOLUMNCONFIG
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_GETENHANCEDCOLUMNCONFIG
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_GETENHANCEDCOLUMNCONFIG
,
"配置为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"关闭代理人名片专栏配置"
,
priority
=
30
)
//priorty 方法执行优先级
public
void
关闭代理人专栏配置
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"configKey"
,
"personal_document_switch"
);
params
.
put
(
"configValue"
,
false
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCONFIG_EDITCONFIG
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCONFIG_EDITCONFIG
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
SELLERCONFIG_EDITCONFIG
,
"关闭配置失败"
,
response
.
body
().
asString
()));
//查看是否关闭成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETENHANCEDCOLUMNCONFIG
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
val
=
response
.
jsonPath
().
getBoolean
(
"data.find{it.code=='personal_document_switch'}.val"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_GETENHANCEDCOLUMNCONFIG
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
val
,
network
.
message
(
params
,
SELLERCARD_GETENHANCEDCOLUMNCONFIG
,
"关闭人专栏配置失败"
,
response
.
body
().
asString
()));
//还原
params
.
put
(
"configKey"
,
"personal_document_switch"
);
params
.
put
(
"configValue"
,
true
);
response
=
network
.
postResponse
(
params
,
SELLERCONFIG_EDITCONFIG
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCONFIG_EDITCONFIG
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
SELLERCONFIG_EDITCONFIG
,
"开启个人专栏配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取问答列表"
,
priority
=
31
)
//priorty 方法执行优先级
public
void
获取问答列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETQUESTIONS
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
questionId
=
response
.
jsonPath
().
getJsonObject
(
"data.questionList.get(0).id"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_GETQUESTIONS
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_GETQUESTIONS
,
"配置为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询问答详情"
,
priority
=
32
)
//priorty 方法执行优先级
public
void
查询问答详情
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"qId"
,
questionId
);
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETQUESTIONDETAIL
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
questionAnswerVo
=
response
.
jsonPath
().
getJsonObject
(
"data.questionAnswerVo"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_GETQUESTIONDETAIL
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
questionAnswerVo
,
network
.
message
(
params
,
SELLERCARD_GETQUESTIONDETAIL
,
"配置为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"扫描二维码"
,
priority
=
33
)
//priorty 方法执行优先级
public
void
扫描二维码
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"qId"
,
questionId
);
params
.
put
(
"scId"
,
scid
);
params
.
put
(
"clueTypeName"
,
"FAQ_VISIT_DETAIL"
);
params
.
put
(
"locationSource"
,
2
);
params
.
put
(
"sourceId"
,
scid
);
params
.
put
(
"sourceType"
,
1
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_SENDPUSHFORSCAN
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
String
data
=
response
.
jsonPath
().
getString
(
"data."
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_SENDPUSHFORSCAN
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
data
,
"success"
,
network
.
message
(
params
,
SELLERCARD_SENDPUSHFORSCAN
,
"data返回错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询虚拟用户咨询列表"
,
priority
=
34
)
//priorty 方法执行优先级
public
void
查询虚拟用户咨询列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"size"
,
6
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_REWARDUSERS
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_REWARDUSERS
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_REWARDUSERS
,
"配置为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取问答底部福利测评专栏"
,
priority
=
35
)
//priorty 方法执行优先级
public
void
获取问答底部福利测评专栏
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_RECOMMENDLISTV3
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_RECOMMENDLISTV3
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_RECOMMENDLISTV3
,
"配置为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"选择公司"
,
priority
=
36
)
//priorty 方法执行优先级
public
void
选择公司
()
{
//查看公司列表
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
200
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_COMPANYLIST
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
int
companyId
=
response
.
jsonPath
().
getInt
(
"data.list.find {it.companyName == '杭州兑吧网络科技有限公司'}.id"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_COMPANYLIST
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
companyId
,
network
.
message
(
params
,
SELLERCARD_COMPANYLIST
,
"公司列表-获取失败"
,
response
.
body
().
asString
()));
//选择某公司
params
.
clear
();
params
.
put
(
"companyId"
,
companyId
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITBASEINFO
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITBASEINFO
,
"选择公司失败"
,
response
.
body
().
asString
()));
//查看是否更新公司成功
response
=
network
.
getResponse
(
SELLERCARD_TOPOFDETAIL
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
WechatCard
card
=
JsonUtil
.
parseResponseToBean
(
response
,
WechatCard
.
class
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_TOPOFDETAIL
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_TOPOFDETAIL
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getCompanyId
(),
companyId
,
network
.
message
(
params
,
SELLERCARD_TOPOFDETAIL
,
"名字修改失败"
,
response
.
body
().
asString
()));
//还原
params
.
clear
();
params
.
put
(
"companyId"
,
1
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITBASEINFO
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITBASEINFO
,
"选择公司失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取代理人名片详情"
,
priority
=
37
)
//priorty 方法执行优先级
public
void
获取代理人名片详情
()
{
Response
response
=
network
.
getResponse
(
SELLERCARD_READDETAIL
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_READDETAIL
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
SELLERCARD_READDETAIL
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看风险测评"
,
priority
=
38
)
//priorty 方法执行优先级
public
void
查看风险测评
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_ISDISPLAYACTIVITY
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_ISDISPLAYACTIVITY
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_ISDISPLAYACTIVITY
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"直接获取用户信息"
,
priority
=
39
)
//priorty 方法执行优先级
public
void
直接获取用户信息
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_DIRECT
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_DIRECT
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
SELLERCARD_DIRECT
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看直播权限"
,
priority
=
40
)
//priorty 方法执行优先级
public
void
查看直播权限
()
{
Response
response
=
network
.
getResponse
(
SELLERCARD_HASLIVEAUTH
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_HASLIVEAUTH
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
data
,
network
.
message
(
SELLERCARD_HASLIVEAUTH
,
"权限直播错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看新手引导"
,
priority
=
41
)
//priorty 方法执行优先级
public
void
查看新手引导
()
{
Response
response
=
network
.
getResponse
(
SELLERCARD_CARDGUIDE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
int
guideType
=
response
.
jsonPath
().
getInt
(
"data.guideType"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_CARDGUIDE
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
guideType
,
0
,
network
.
message
(
SELLERCARD_CARDGUIDE
,
"引导类型错误"
,
response
.
body
().
asString
()));
}
@AfterClass
public
static
void
tearDown
(){
apiCount
+=
41
;
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
cfd1a190
...
...
@@ -582,7 +582,24 @@ public class BasicConfig {
public
static
final
String
SELLERCARD_ADDORUPDATEPRODUCT
=
HOST
+
"/kjy/mp/sellerCardV5/addOrUpdateProduct"
;
public
static
final
String
SELLERCARD_UPDATESHOWSTATUSFORPRODUCT
=
HOST
+
"/kjy/mp/sellerCardV5/updateShowStatusForProduct"
;
public
static
final
String
SELLERCARD_DELETEPRODUCT
=
HOST
+
"/kjy/mp/sellerCardV5/deleteProduct"
;
public
static
final
String
SELLERCARD_GETSELLERCASEINFO
=
HOST
+
"/kjy/mp/sellerCardV5/getSellerCaseInfo"
;
public
static
final
String
SELLERCARD_SAVECARDAPPRAISE
=
HOST
+
"/kjy/mp/sellerCard/saveCardAppraise"
;
public
static
final
String
SELLERCARD_DELCARDAPPRAISE
=
HOST
+
"/kjy/mp/sellerCard/delCardAppraise"
;
public
static
final
String
SELLERCARD_EDITCARDAPPRAISE
=
HOST
+
"/kjy/mp/sellerCard/editCardAppraise"
;
public
static
final
String
SELLERCARD_COMPANYINFO
=
HOST
+
"/kjy/mp/sellerCard/company/info"
;
public
static
final
String
SELLERCARD_AYSNCGETMPORCODE
=
HOST
+
"/kjy/mp/sellerCard/asyncGetMpQrCode"
;
public
static
final
String
SELLERCARD_HASLIVEAUTH
=
HOST
+
"/kjy/mp/liveAgent/hasLiveAuth"
;
public
static
final
String
SELLERCARD_CARDGUIDE
=
HOST
+
"/kjy/mp/rookieGuide/cardGuide"
;
public
static
final
String
SELLERCARD_INSURANCELISTV2
=
HOST
+
"/kjy/mp/welfare/insuranceListV2"
;
public
static
final
String
SELLERCARD_GETENHANCEDCOLUMNCONFIG
=
HOST
+
"/kjy/mp/sellerConfig/getEnhancedColumnConfig"
;
public
static
final
String
SELLERCARD_GETQUESTIONDETAIL
=
HOST
+
"/kjy/mp/explosioncontent/qa/getQuestionDetail"
;
public
static
final
String
SELLERCARD_SENDPUSHFORSCAN
=
HOST
+
"/kjy/mp/explosioncontent/qa/sendPushForScan"
;
public
static
final
String
SELLERCARD_REWARDUSERS
=
HOST
+
"/kjy/mp/seller/novice/rewardUsers"
;
public
static
final
String
SELLERCARD_RECOMMENDLISTV3
=
HOST
+
"/kjy/mp/welfare/recommendListV3"
;
public
static
final
String
SELLERCARD_READDETAIL
=
HOST
+
"/kjy/mp/sellerCard/readDetail"
;
public
static
final
String
SELLERCARD_GETINTERACTIONCONFIG
=
HOST
+
"/kjy/mp/sellerConfig/getInteractionConfig"
;
public
static
final
String
SELLERCARD_GETSELLERPROMOTEINFO
=
HOST
+
"/kjy/mp/seller/getSellerPromoteInfo"
;
public
static
final
String
SELLERCARD_DIRECT
=
HOST
+
"/kjy/mp/user/direct"
;
// *************** 上传 ***************
...
...
src/test/wechatTestNG.xml
View file @
cfd1a190
...
...
@@ -16,21 +16,21 @@
<class
name=
"com.kjj.cases.basics.Pay"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"名片"
>
<classes
>
<class
name=
"com.kjj.cases.basics.SellerCard"
/
>
</classes
>
</test
>
<!-- <test preserve-order="true" name="名片">--
>
<!-- <classes>--
>
<!-- <class name="com.kjj.cases.basics.SellerCard"/>--
>
<!-- </classes>--
>
<!-- </test>--
>
<test
preserve-order=
"true"
name=
"上传"
>
<classes>
<class
name=
"com.kjj.cases.basics.Upload"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"文章"
>
<classes
>
<class
name=
"com.kjj.cases.basics.Article"
/
>
</classes
>
</test
>
<!-- <test preserve-order="true" name="文章">--
>
<!-- <classes>--
>
<!-- <class name="com.kjj.cases.basics.Article"/>--
>
<!-- </classes>--
>
<!-- </test>--
>
<test
preserve-order=
"true"
name=
"发圈"
>
<classes>
<class
name=
"com.kjj.cases.basics.CircleFriends"
/>
...
...
@@ -51,11 +51,16 @@
<class
name=
"com.kjj.cases.basics.GreetingCard"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"名片"
>
<test
preserve-order=
"true"
name=
"
我的
名片"
>
<classes>
<class
name=
"com.kjj.cases.basics.card.PersonCard"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"文章中个人名片"
>
<classes>
<class
name=
"com.kjj.cases.basics.card.ArticalPersonCard"
/>
</classes>
</test>
<test
preserve-order=
"true"
name =
"种草素材"
>
<classes>
<class
name=
"com.kjj.cases.assistant.RecommendMaterial"
/>
...
...
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