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
1da6b736
Commit
1da6b736
authored
Jul 20, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2021072002-gxh02' into 'master'
2021072002 gxh02 See merge request test-group/kejiji!75
parents
390d6a1a
8a3e1196
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
478 additions
and
211 deletions
+478
-211
RecommendMaterial.java
src/test/java/com/kjj/cases/assistant/RecommendMaterial.java
+1
-0
ArticalPersonCard.java
.../java/com/kjj/cases/assistant/card/ArticalPersonCard.java
+2
-2
PersonCard.java
src/test/java/com/kjj/cases/assistant/card/PersonCard.java
+131
-131
greetingCrad.java
...ava/com/kjj/cases/assistant/markettools/greetingCrad.java
+258
-0
Article.java
src/test/java/com/kjj/cases/basics/Article.java
+0
-7
GreetingCard.java
src/test/java/com/kjj/cases/basics/GreetingCard.java
+8
-9
SellerCard.java
src/test/java/com/kjj/cases/basics/SellerCard.java
+46
-47
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+27
-15
wechatTestNG.xml
src/test/wechatTestNG.xml
+5
-0
No files found.
src/test/java/com/kjj/cases/assistant/RecommendMaterial.java
View file @
1da6b736
package
com
.
kjj
.
cases
.
assistant
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.ThreadSleepUtils
;
...
...
src/test/java/com/kjj/cases/assistant/card/ArticalPersonCard.java
View file @
1da6b736
...
...
@@ -101,7 +101,7 @@ public class ArticalPersonCard implements Authorization {
@Test
(
description
=
"代理人_头部名片详情"
,
priority
=
7
)
public
void
代理人
_
头部名片详情
(){
//获取加密的销售ID
sleep
(
1
000
);
sleep
(
5
000
);
Response
response
=
network
.
getResponse
(
USER_INFO
);
sid
=
response
.
jsonPath
().
getString
(
"data.encodeSellerId"
);
String
sellerName
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
...
...
@@ -201,7 +201,7 @@ public class ArticalPersonCard implements Authorization {
//切换为访客
userTku
();
sleep
(
1
000
);
sleep
(
2
000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
//代理人的scid
params
.
put
(
"cancelPush"
,
false
);
...
...
src/test/java/com/kjj/cases/assistant/card/PersonCard.java
View file @
1da6b736
...
...
@@ -61,19 +61,19 @@ public class PersonCard implements Authorization {
@Test
(
description
=
"获取名片顶部信息"
,
priority
=
3
)
public
void
获取名片顶部信息
(){
Response
response
=
network
.
getResponse
(
SELLERCARD_
TOPOFDETAIL
);
Response
response
=
network
.
getResponse
(
SELLERCARD_
topOfDetail
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"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
()));
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
(),
"13012341234"
,
network
.
message
(
SELLERCARD_
TOPOFDETAIL
,
"名片信息错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getWechatNumber
(),
"wx123456"
,
network
.
message
(
SELLERCARD_
TOPOFDETAIL
,
"名片信息错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getAddress
(),
"杭州数娱大厦(文一西路98号)"
,
network
.
message
(
SELLERCARD_
TOPOFDETAIL
,
"名片信息错误"
,
response
.
body
().
asString
()));
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
(),
"13012341234"
,
network
.
message
(
SELLERCARD_
topOfDetail
,
"名片信息错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getWechatNumber
(),
"wx123456"
,
network
.
message
(
SELLERCARD_
topOfDetail
,
"名片信息错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
card
.
getAddress
(),
"杭州数娱大厦(文一西路98号)"
,
network
.
message
(
SELLERCARD_
topOfDetail
,
"名片信息错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"保存名片基本信息"
,
priority
=
4
)
...
...
@@ -87,24 +87,24 @@ public class PersonCard implements Authorization {
params
.
put
(
"address"
,
"重庆市轨道集团建设大楼"
);
params
.
put
(
"addressLocation"
,
"106.544362,29.559164"
);
params
.
put
(
"avatarStyle"
,
1
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITBASEINFO
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_editBaseInfo
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITBASEINFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_editBaseInfo
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
//查看修改是否成功
response
=
network
.
getResponse
(
SELLERCARD_
TOPOFDETAIL
);
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
.
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
()));
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
();
...
...
@@ -115,24 +115,24 @@ public class PersonCard implements Authorization {
params
.
put
(
"address"
,
"杭州数娱大厦(文一西路98号)"
);
params
.
put
(
"addressLocation"
,
"120.112204,30.287785"
);
params
.
put
(
"avatarStyle"
,
3
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITBASEINFO
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_editBaseInfo
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITBASEINFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_editBaseInfo
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取用户个人介绍"
,
priority
=
5
)
public
void
获取用户个人介绍
(){
Response
response
=
network
.
getResponse
(
SELLERCARD_
PERSONALPROFILE
);
Response
response
=
network
.
getResponse
(
SELLERCARD_
personalProfile
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
String
personalIntro
=
response
.
jsonPath
().
getString
(
"data.personalIntro"
);
int
exprLength
=
response
.
jsonPath
().
getInt
(
"data.exprLength"
);
Object
majors
=
response
.
jsonPath
().
getBoolean
(
"data.goodAtMajor"
);
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
,
2
,
network
.
message
(
SELLERCARD_
PERSONALPROFILE
,
"年限信息错误"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
majors
,
network
.
message
(
SELLERCARD_
PERSONALPROFILE
,
"专业标签返回数据为空"
,
response
.
body
().
asString
()));
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
,
2
,
network
.
message
(
SELLERCARD_
personalProfile
,
"年限信息错误"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
majors
,
network
.
message
(
SELLERCARD_
personalProfile
,
"专业标签返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取个人介绍模板"
,
priority
=
6
)
public
void
获取用户个人介绍模板
(){
...
...
@@ -154,48 +154,48 @@ public class PersonCard implements Authorization {
//修改个人介绍和年限
params
.
put
(
"personalIntro"
,
"本人有多年的保险销售和管理经验!"
);
params
.
put
(
"exprLength"
,
"4"
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITBASEINFO
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_editBaseInfo
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITBASEINFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_editBaseInfo
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
//修改专业标签
params
.
clear
();
params
.
put
(
"goodAtDefault"
,
"1,2"
);
params
.
put
(
"goodAtCustom"
,
""
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITMAJORGOODAUTH
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_editMajorGoodAuth
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITMAJORGOODAUTH
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_editMajorGoodAuth
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
//查看修改是否成功
response
=
network
.
getResponse
(
SELLERCARD_
PERSONALPROFILE
);
response
=
network
.
getResponse
(
SELLERCARD_
personalProfile
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"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
(
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
()));
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
()));
//还原个人介绍模块
//还原个人介绍和年限
params
.
clear
();
params
.
put
(
"personalIntro"
,
"我在行业内整挺好!"
);
params
.
put
(
"exprLength"
,
"2"
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITBASEINFO
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_editBaseInfo
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITBASEINFO
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_editBaseInfo
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
//还原专业标签
params
.
clear
();
params
.
put
(
"goodAtDefault"
,
"1"
);
params
.
put
(
"goodAtCustom"
,
""
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITMAJORGOODAUTH
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_editMajorGoodAuth
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITMAJORGOODAUTH
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_editMajorGoodAuth
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"更新代理人精彩点滴照片"
,
priority
=
8
)
...
...
@@ -235,26 +235,26 @@ 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
,
GREETING_
GETTIPSBYPAGE
);
Response
response
=
network
.
getResponse
(
params
,
GREETING_
getTipsByPage
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
GREETING_GETTIPSBYPAGE
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
GREETING_GETTIPSBYPAGE
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
GREETING_getTipsByPage
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
GREETING_getTipsByPage
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取客户投保案例模块"
,
priority
=
11
)
//priorty 方法执行优先级
public
void
获取客户投保案例模块
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
4
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"isMore"
,
false
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
SELLERCARDCASENEW
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
sellerCardCasesList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
int
count
=
response
.
jsonPath
().
getInt
(
"data.sellerCases.size()"
);
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
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_sellerCardCasesList
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
SELLERCARD_sellerCardCasesList
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
count
,
1
,
network
.
message
(
params
,
SELLERCARD_sellerCardCasesList
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"添加个人案例"
,
priority
=
12
)
//priorty 方法执行优先级
...
...
@@ -267,25 +267,25 @@ 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
(
params
,
SELLERCARD_PERSONALPROFILE
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_personalProfile
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
//查看是否添加成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"isMore"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
SELLERCARDCASENEW
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
sellerCardCasesList
);
int
count
=
response
.
jsonPath
().
getInt
(
"data.sellerCases.size()"
);
String
caseIntro
=
response
.
jsonPath
().
getString
(
"data.sellerCases.get(0).caseIntro"
);
String
customerName
=
response
.
jsonPath
().
getString
(
"data.sellerCases.get(0).customerName"
);
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
(
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
()));
Assert
.
assertTrue
(
isShow
,
network
.
message
(
params
,
SELLERCARD_
SELLERCARDCASENEW
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
count
,
2
,
network
.
message
(
params
,
SELLERCARD_sellerCardCasesList
,
"服务案例-获取案例数量错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
caseIntro
,
"案例描述A"
,
network
.
message
(
params
,
SELLERCARD_
sellerCardCasesList
,
"服务案例-描述错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
customerName
,
"客户A"
,
network
.
message
(
params
,
SELLERCARD_
sellerCardCasesList
,
"服务案例-客户错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
product
,
"金牌产品A"
,
network
.
message
(
params
,
SELLERCARD_
sellerCardCasesList
,
"服务案例-产品错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
isShow
,
network
.
message
(
params
,
SELLERCARD_
sellerCardCasesList
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改个人案例"
,
priority
=
13
)
//priorty 方法执行优先级
...
...
@@ -297,16 +297,16 @@ public class PersonCard implements Authorization {
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_EDITDELLERCASE
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
//查看是否
添加
成功
//查看是否
修改
成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"isMore"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
SELLERCARDCASENEW
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
sellerCardCasesList
);
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
(
caseIntro
,
"案例描述A进行了更新"
,
network
.
message
(
params
,
SELLERCARD_
SELLERCARDCASENEW
,
"服务案例-描述错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
count
,
2
,
network
.
message
(
params
,
SELLERCARD_sellerCardCasesList
,
"服务案例-获取案例数量错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
caseIntro
,
"案例描述A进行了更新"
,
network
.
message
(
params
,
SELLERCARD_
sellerCardCasesList
,
"服务案例-描述错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改个人案例展示状态"
,
priority
=
14
)
//priorty 方法执行优先级
...
...
@@ -328,10 +328,10 @@ public class PersonCard implements Authorization {
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"isMore"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
SELLERCARDCASENEW
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
sellerCardCasesList
);
String
path
=
"data.sellerCases.find {it.id == \""
+
sellerCaseId
+
"\"}.isShow"
;
boolean
isShow
=
response
.
jsonPath
().
getBoolean
(
path
);
Assert
.
assertFalse
(
isShow
,
network
.
message
(
params
,
SELLERCARD_
SELLERCARDCASENEW
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
isShow
,
network
.
message
(
params
,
SELLERCARD_
sellerCardCasesList
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
//展示
params
.
clear
();
...
...
@@ -341,8 +341,8 @@ public class PersonCard implements Authorization {
response
=
network
.
postResponse
(
params
,
SELLERCARD_UPDATESHOWSTATUSFORCASE
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
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
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_personalProfile
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
SELLERCARD_personalProfile
,
"更新失败"
,
response
.
body
().
asString
()));
//查看状态是否更新成功
...
...
@@ -350,9 +350,9 @@ public class PersonCard implements Authorization {
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"isMore"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
SELLERCARDCASENEW
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
sellerCardCasesList
);
isShow
=
response
.
jsonPath
().
getBoolean
(
path
);
Assert
.
assertTrue
(
isShow
,
network
.
message
(
params
,
SELLERCARD_
SELLERCARDCASENEW
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
isShow
,
network
.
message
(
params
,
SELLERCARD_
sellerCardCasesList
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客查看某条个人案例"
,
priority
=
15
)
//priorty 方法执行优先级
...
...
@@ -364,7 +364,7 @@ public class PersonCard implements Authorization {
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
()));
Assert
.
assertEquals
(
caseIntro
,
"案例描述A进行了更新"
,
network
.
message
(
params
,
SELLERCARD_
sellerCardCasesList
,
"服务案例-描述错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"删除个人案例"
,
priority
=
16
)
//priorty 方法执行优先级
...
...
@@ -373,16 +373,16 @@ public class PersonCard implements Authorization {
params
.
put
(
"id"
,
sellerCaseId
);
Response
response
=
network
.
postResponse
(
params
,
SELLERCARD_DELETESELLERCASE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_PERSONALPROFILE
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_personalProfile
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
//查看是否删除成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"isMore"
,
false
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
SELLERCARDCASENEW
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
sellerCardCasesList
);
int
count
=
response
.
jsonPath
().
getInt
(
"data.sellerCases.size()"
);
Assert
.
assertEquals
(
count
,
3
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
count
,
1
,
network
.
message
(
params
,
SELLERCARD_sellerCardCasesList
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看精选产品"
,
priority
=
17
)
//priorty 方法执行优先级
...
...
@@ -391,13 +391,13 @@ public class PersonCard implements Authorization {
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"isMore"
,
true
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
PRODUCTLIST
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
productList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
int
count
=
response
.
jsonPath
().
getInt
(
"data.productList.size()"
);
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
()));
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
,
2
,
network
.
message
(
params
,
SELLERCARD_productList
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"添加精选产品"
,
priority
=
18
)
//priorty 方法执行优先级
...
...
@@ -416,7 +416,7 @@ public class PersonCard implements Authorization {
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"isMore"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
PRODUCTLIST
);
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"
);
...
...
@@ -424,12 +424,12 @@ 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"
);
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
()));
Assert
.
assertEquals
(
productFeature
,
"这是产品描述"
,
network
.
message
(
params
,
SELLERCARD_
PRODUCTLIST
,
"服务案例-产品错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
productImg
,
"//yun.kjjcrm.com/kjy/image/20210709/a349c64087224a47a8ba0b8bc49f3498.jpg"
,
network
.
message
(
params
,
SELLERCARD_
PRODUCTLIST
,
"服务案例-产品错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
isShow
,
network
.
message
(
params
,
SELLERCARD_
PRODUCTLIST
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
count
,
3
,
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
()));
Assert
.
assertEquals
(
productFeature
,
"这是产品描述"
,
network
.
message
(
params
,
SELLERCARD_
productList
,
"服务案例-产品错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
productImg
,
"//yun.kjjcrm.com/kjy/image/20210709/a349c64087224a47a8ba0b8bc49f3498.jpg"
,
network
.
message
(
params
,
SELLERCARD_
productList
,
"服务案例-产品错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
isShow
,
network
.
message
(
params
,
SELLERCARD_
productList
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改精选产品"
,
priority
=
19
)
//priorty 方法执行优先级
...
...
@@ -446,17 +446,17 @@ public class PersonCard implements Authorization {
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
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"isMore"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
PRODUCTLIST
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
productList
);
int
count
=
response
.
jsonPath
().
getInt
(
"data.productList.size()"
);
String
productFeature
=
response
.
jsonPath
().
getString
(
"data.productList.get(0).productFeature"
);
personalProductId
=
response
.
jsonPath
().
getString
(
"data.productList.get(0).personalProductId"
);
Assert
.
assertEquals
(
count
,
4
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
productFeature
,
"这是产品描述进行了更新"
,
network
.
message
(
params
,
SELLERCARD_
PRODUCTLIST
,
"服务案例-产品错误"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
count
,
3
,
network
.
message
(
params
,
SELLERCARD_productList
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
productFeature
,
"这是产品描述进行了更新"
,
network
.
message
(
params
,
SELLERCARD_
productList
,
"服务案例-产品错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改产品展示状态"
,
priority
=
20
)
//priorty 方法执行优先级
...
...
@@ -478,11 +478,11 @@ public class PersonCard implements Authorization {
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"isMore"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
PRODUCTLIST
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
productList
);
System
.
out
.
println
(
response
.
body
().
asString
());
String
path
=
"data.productList.find {it.personalProductId == \""
+
personalProductId
+
"\"}.isShow"
;
boolean
isShow
=
response
.
jsonPath
().
getBoolean
(
path
);
Assert
.
assertFalse
(
isShow
,
network
.
message
(
params
,
SELLERCARD_
PRODUCTLIST
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
isShow
,
network
.
message
(
params
,
SELLERCARD_
productList
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
//展示
params
.
clear
();
...
...
@@ -500,9 +500,9 @@ public class PersonCard implements Authorization {
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"isMore"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
PRODUCTLIST
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
productList
);
isShow
=
response
.
jsonPath
().
getBoolean
(
path
);
Assert
.
assertTrue
(
isShow
,
network
.
message
(
params
,
SELLERCARD_
PRODUCTLIST
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
isShow
,
network
.
message
(
params
,
SELLERCARD_
productList
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"删除精选产品"
,
priority
=
21
)
//priorty 方法执行优先级
...
...
@@ -519,9 +519,9 @@ public class PersonCard implements Authorization {
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"isMore"
,
false
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
PRODUCTLIST
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
productList
);
int
count
=
response
.
jsonPath
().
getInt
(
"data.productList.size()"
);
Assert
.
assertEquals
(
count
,
3
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
count
,
2
,
network
.
message
(
params
,
SELLERCARD_productList
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看客户评价"
,
priority
=
22
)
//priorty 方法执行优先级
public
void
查看客户评价
()
{
...
...
@@ -531,11 +531,11 @@ public class PersonCard implements Authorization {
params
.
put
(
"pageSize"
,
3
);
params
.
put
(
"appraiseState"
,
1
);
params
.
put
(
"isPersonal"
,
false
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
APPRAISELISTNEW
);
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
()));
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 方法执行优先级
...
...
@@ -543,7 +543,7 @@ public class PersonCard implements Authorization {
userTku
();
sleep
(
1000
);
Response
response
=
network
.
getResponse
(
SELLERCARD_
TOPOFDETAIL
);
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
);
...
...
@@ -565,18 +565,18 @@ public class PersonCard implements Authorization {
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"appraiseState"
,
1
);
params
.
put
(
"isPersonal"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
APPRAISELISTNEW
);
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
()));
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 方法执行优先级
...
...
@@ -602,12 +602,12 @@ public class PersonCard implements Authorization {
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"appraiseState"
,
1
);
params
.
put
(
"isPersonal"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
APPRAISELISTNEW
);
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
()));
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
();
...
...
@@ -627,11 +627,11 @@ public class PersonCard implements Authorization {
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"appraiseState"
,
0
);
params
.
put
(
"isPersonal"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
APPRAISELISTNEW
);
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
()));
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 方法执行优先级
...
...
@@ -654,11 +654,11 @@ public class PersonCard implements Authorization {
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"appraiseState"
,
1
);
params
.
put
(
"isPersonal"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
APPRAISELISTNEW
);
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
()));
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 方法执行优先级
...
...
@@ -744,12 +744,12 @@ public class PersonCard implements Authorization {
public
void
获取问答列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETQUESTIONS
);
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
()));
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 方法执行优先级
...
...
@@ -810,34 +810,34 @@ public class PersonCard implements Authorization {
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
200
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
COMPANYLIST
);
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
()));
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
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_
editBaseInfo
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_
EDITBASEINFO
,
"选择公司失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_
editBaseInfo
,
"选择公司失败"
,
response
.
body
().
asString
()));
//查看是否更新公司成功
response
=
network
.
getResponse
(
SELLERCARD_
TOPOFDETAIL
);
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
()));
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
);
params
.
put
(
"companyId"
,
6
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_
editBaseInfo
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_
EDITBASEINFO
,
"选择公司失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
SELLERCARD_
editBaseInfo
,
"选择公司失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取代理人名片详情"
,
priority
=
37
)
//priorty 方法执行优先级
...
...
@@ -855,11 +855,11 @@ public class PersonCard implements Authorization {
public
void
查看风险测评
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
ISDISPLAYACTIVITY
);
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
()));
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 方法执行优先级
...
...
@@ -880,7 +880,7 @@ public class PersonCard implements Authorization {
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_HASLIVEAUTH
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assert
Fals
e
(
data
,
network
.
message
(
SELLERCARD_HASLIVEAUTH
,
"权限直播错误"
,
response
.
body
().
asString
()));
Assert
.
assert
Tru
e
(
data
,
network
.
message
(
SELLERCARD_HASLIVEAUTH
,
"权限直播错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看新手引导"
,
priority
=
41
)
//priorty 方法执行优先级
...
...
src/test/java/com/kjj/cases/assistant/markettools/greetingCrad.java
0 → 100644
View file @
1da6b736
package
com
.
kjj
.
cases
.
assistant
.
markettools
;
import
com.kjj.cases.admin.Authorization
;
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.util.HashMap
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
public
class
greetingCrad
implements
Authorization
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
public
String
sid
;
// 加密的销售ID
public
String
greetingCardId
;
// 文章的contentId
public
String
scid
;
// getScid后的文章scid
public
String
scId
;
// 底部名片获取的scid
public
int
userId
;
// 代理人用户ID
public
String
visitId
;
// 访问记录ID
@BeforeClass
public
void
setUp
(){
agentTku
();
}
@Test
(
description
=
"营销工具聚合页内容"
,
priority
=
1
)
public
void
营销工具聚合页内容
(){
Response
response
=
network
.
getResponse
(
GREETING_getMarketingToolArea
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
GREETING_getMarketingToolArea
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
GREETING_getMarketingToolArea
,
"返回数据为空"
,
response
.
body
().
asString
()));
int
greetingList
=
response
.
jsonPath
().
getInt
(
"data.greetingList.size()"
);
int
invitationList
=
response
.
jsonPath
().
getInt
(
"data.greetingList.size()"
);
int
templateList
=
response
.
jsonPath
().
getInt
(
"data.greetingList.size()"
);
Assert
.
assertTrue
(
greetingList
>
0
,
network
.
message
(
GREETING_getMarketingToolArea
,
"贺卡列表为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
invitationList
>
0
,
network
.
message
(
GREETING_getMarketingToolArea
,
"邀请函列表为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
templateList
>
0
,
network
.
message
(
GREETING_getMarketingToolArea
,
"抽奖列表为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取趣味测试列表"
,
priority
=
2
)
public
void
获取趣味测试列表
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageSize"
,
5
);
Response
response
=
network
.
getResponse
(
params
,
GREETING_answerPageList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
GREETING_answerPageList
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
GREETING_answerPageList
,
"返回数据为空"
,
response
.
body
().
asString
()));
int
answerPageList
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
Assert
.
assertTrue
(
answerPageList
>
0
,
network
.
message
(
params
,
GREETING_answerPageList
,
"趣味测试列表为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取代理人vip信息"
,
priority
=
3
)
public
void
获取代理人
vip
信息
(){
Response
response
=
network
.
getResponse
(
GREETING_getSellerVipInfo
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
GREETING_getSellerVipInfo
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
GREETING_getSellerVipInfo
,
"返回数据为空"
,
response
.
body
().
asString
()));
boolean
isVip
=
response
.
jsonPath
().
getBoolean
(
"data.isVip"
);
Assert
.
assertTrue
(
isVip
,
network
.
message
(
GREETING_getSellerVipInfo
,
"代理人不是vip用户"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"检查访客登录信息"
,
priority
=
4
)
public
void
检查访客登录信息
(){
Response
response
=
network
.
getResponse
(
GREETING_checkVisitor
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
GREETING_checkVisitor
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
GREETING_checkVisitor
,
"返回数据为失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取贺卡首页banner"
,
priority
=
5
)
public
void
获取贺卡首页
banner
(){
Response
response
=
network
.
getResponse
(
GREETING_banner
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
GREETING_banner
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
GREETING_banner
,
"返回数据为空"
,
response
.
body
().
asString
()));
int
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
GREETING_banner
,
"贺卡列表为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取转发数量最高的贺卡"
,
priority
=
6
)
public
void
获取转发数量最高的贺卡
(){
Response
response
=
network
.
getResponse
(
GREETING_allForward
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
GREETING_allForward
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
GREETING_allForward
,
"返回数据为空"
,
response
.
body
().
asString
()));
int
size
=
response
.
jsonPath
().
getInt
(
"data.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
GREETING_allForward
,
"贺卡列表为空"
,
response
.
body
().
asString
()));
greetingCardId
=
response
.
jsonPath
().
getString
(
"data.get(0).id"
);
}
@Test
(
description
=
"根据page获取当前页面的Tips"
,
priority
=
7
)
public
void
根据
page
获取当前页面的
Tips
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"page"
,
"greeting_card"
);
Response
response
=
network
.
getResponse
(
params
,
GREETING_getTipsByPage
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
GREETING_getTipsByPage
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
GREETING_getTipsByPage
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"按类型查询标签"
,
priority
=
8
)
public
void
按类型查询标签
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"tagType"
,
"greeting_card"
);
Response
response
=
network
.
getResponse
(
params
,
GREETING_findByType
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
GREETING_findByType
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
GREETING_findByType
,
"返回数据为空"
,
response
.
body
().
asString
()));
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
GREETING_findByType
,
"贺卡列表为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取当前用户关注公众号类型"
,
priority
=
9
)
public
void
获取当前用户关注公众号类型
(){
Response
response
=
network
.
getResponse
(
GREETING_oaSubscribeType
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
int
data
=
response
.
jsonPath
().
getInt
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
GREETING_oaSubscribeType
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
data
,
2
,
network
.
message
(
GREETING_oaSubscribeType
,
"返回数据错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取更多贺卡列表"
,
priority
=
10
)
public
void
获取更多贺卡列表
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
"1"
);
params
.
put
(
"pageSize"
,
"10"
);
params
.
put
(
"type"
,
"0"
);
Response
response
=
network
.
getResponse
(
GREETING_pageList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
GREETING_pageList
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
GREETING_pageList
,
"返回数据为失败"
,
response
.
body
().
asString
()));
int
size
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
Assert
.
assertTrue
(
size
>
0
,
network
.
message
(
params
,
GREETING_pageList
,
"贺卡列表为空"
,
response
.
body
().
asString
()));
}
//获取贺卡详情页
@Test
(
description
=
"获取贺卡详情页"
,
priority
=
11
)
public
void
获取贺卡详情页
()
{
//根据ContentId获取Scid
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"contentId"
,
greetingCardId
);
Response
response
=
network
.
getResponse
(
params
,
GETSCID
);
scid
=
response
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertNotNull
(
scid
,
network
.
message
(
params
,
GETSCID
,
"获取scid失败"
,
response
.
body
().
asString
()));
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
response
=
network
.
getResponse
(
params
,
GREETING_H5INFO
);
String
id
=
response
.
jsonPath
().
getString
(
"data.id"
);
Assert
.
assertEquals
(
greetingCardId
,
id
,
network
.
message
(
params
,
GREETING_H5INFO
,
"获取贺卡页面失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"贺卡是否可以正常访问"
,
priority
=
12
)
public
void
贺卡是否可以正常访问
()
{
Response
response
=
network
.
getResponse
(
GREETING_check
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
GREETING_check
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
GREETING_check
,
"返回数据为失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取贺卡预览"
,
priority
=
13
)
public
void
获取贺卡预览
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
GREETING_preView
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
GREETING_preView
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
GREETING_preView
,
"返回数据为空"
,
response
.
body
().
asString
()));
String
blessWord
=
response
.
jsonPath
().
getString
(
"data.blessWord"
);
String
sellerSignature
=
response
.
jsonPath
().
getString
(
"data.sellerSignature"
);
Assert
.
assertNotNull
(
blessWord
,
network
.
message
(
GREETING_preView
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
sellerSignature
,
"吉吉"
,
network
.
message
(
GREETING_preView
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"红包功能是否开启"
,
priority
=
14
)
public
void
红包功能是否开启
()
{
Response
response
=
network
.
getResponse
(
GREETING_isRedpackEnable
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
GREETING_isRedpackEnable
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
GREETING_isRedpackEnable
,
"返回数据为失败"
,
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
,
GREETING_self
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
GREETING_self
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
GREETING_self
,
"返回数据为失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取销售名片"
,
priority
=
16
)
public
void
获取销售名片
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
GREETING_getInfoByScid
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
GREETING_getInfoByScid
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
GREETING_getInfoByScid
,
"返回数据为失败"
,
response
.
body
().
asString
()));
userId
=
response
.
jsonPath
().
getInt
(
"data.userId"
);
String
sellerName
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
Assert
.
assertEquals
(
userId
,
5495
,
network
.
message
(
params
,
GREETING_getInfoByScid
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
sellerName
,
"吉吉"
,
network
.
message
(
params
,
GREETING_getInfoByScid
,
"返回数据为失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取代理人是否超过次数限制"
,
priority
=
17
)
public
void
获取代理人是否超过次数限制
()
{
Response
response
=
network
.
getResponse
(
GREETING_checkLimit
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
GREETING_checkLimit
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertFalse
(
data
,
network
.
message
(
GREETING_checkLimit
,
"返回数据为失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取更多精彩贺卡"
,
priority
=
18
)
public
void
获取更多精彩贺卡
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
GREETING_more
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
GREETING_more
,
"接口返回失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
GREETING_more
,
"返回数据为空"
,
response
.
body
().
asString
()));
}
@AfterClass
public
void
teardown
(){
}
}
src/test/java/com/kjj/cases/basics/Article.java
View file @
1da6b736
...
...
@@ -129,13 +129,6 @@ public class Article {
String
scId
=
response
.
jsonPath
().
getString
(
"data.scid"
);
String
name
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
Assert
.
assertEquals
(
name
,
sellerName
,
"头部名片信息显示有误"
);
//获取名片的点赞
Map
<
String
,
Object
>
likeParams
=
new
HashMap
<
String
,
Object
>();
likeParams
.
put
(
"scId"
,
scId
);
response
=
network
.
getResponse
(
likeParams
,
HASALREADYLIKE
);
boolean
favourResult
=
response
.
jsonPath
().
getBoolean
(
"data.favourResult"
);
Assert
.
assertTrue
(
favourResult
,
"头部名片点赞数量显示有误"
);
}
// 底部名片
...
...
src/test/java/com/kjj/cases/basics/GreetingCard.java
View file @
1da6b736
package
com
.
kjj
.
cases
.
basics
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.NetworkUtils
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
...
...
@@ -32,17 +31,17 @@ public class GreetingCard {
// BANNER
@Test
(
description
=
"BANNER"
,
priority
=
1
)
public
void
BANNER
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
GREETING_
BANNER
);
Response
response
=
network
.
getResponse
(
GREETING_
banner
);
boolean
hasList
=
response
.
jsonPath
().
getInt
(
"data.size()"
)
>
0
;
Assert
.
assertTrue
(
hasList
,
network
.
message
(
GREETING_
BANNER
,
"获取Banner列表失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
hasList
,
network
.
message
(
GREETING_
banner
,
"获取Banner列表失败"
,
response
.
body
().
asString
()));
}
// 转发最多
@Test
(
description
=
"大家都在发"
,
priority
=
2
)
public
void
大家都在发
()
throws
IOException
{
Response
response
=
network
.
getResponse
(
GREETING_
ALLFORWARD
);
Response
response
=
network
.
getResponse
(
GREETING_
allForward
);
boolean
hasList
=
response
.
jsonPath
().
getInt
(
"data.size()"
)
>
0
;
Assert
.
assertTrue
(
hasList
,
network
.
message
(
GREETING_
ALLFORWARD
,
"获取大家都在发列表失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
hasList
,
network
.
message
(
GREETING_
allForward
,
"获取大家都在发列表失败"
,
response
.
body
().
asString
()));
}
// 贺卡tab
...
...
@@ -51,10 +50,10 @@ public class GreetingCard {
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"tagType"
,
"greeting_card"
);
params
.
put
(
"exclusiveArea"
,
0
);
Response
response
=
network
.
getResponse
(
params
,
GREETING_FINDBYTYPE
);
Response
response
=
network
.
getResponse
(
params
,
GREETING_findByType
);
int
totalCount
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
);
tagId
=
response
.
jsonPath
().
getInt
(
"data.list[-1].id"
);
Assert
.
assertEquals
(
totalCount
,
3
,
network
.
message
(
params
,
GREETING_FINDBYTYPE
,
"获取贺卡tab失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
totalCount
,
3
,
network
.
message
(
params
,
GREETING_findByType
,
"获取贺卡tab失败"
,
response
.
body
().
asString
()));
}
// 获取539的贺卡列表
...
...
@@ -65,11 +64,11 @@ public class GreetingCard {
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"type"
,
6
);
params
.
put
(
"tag1Id"
,
tagId
);
Response
response
=
network
.
getResponse
(
params
,
GREETING_PAGELIST
);
Response
response
=
network
.
getResponse
(
params
,
GREETING_pageList
);
boolean
hasList
=
response
.
jsonPath
().
getInt
(
"data.list.size()"
)
>
0
;
contentId
=
response
.
jsonPath
().
getString
(
"data.list[0].id"
);
greetingName
=
response
.
jsonPath
().
getString
(
"data.list[0].title"
);
Assert
.
assertTrue
(
hasList
,
network
.
message
(
params
,
GREETING_PAGELIST
,
"获取贺卡tab失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
hasList
,
network
.
message
(
params
,
GREETING_pageList
,
"获取贺卡tab失败"
,
response
.
body
().
asString
()));
}
// 贺卡详情页
...
...
src/test/java/com/kjj/cases/basics/SellerCard.java
View file @
1da6b736
...
...
@@ -12,17 +12,16 @@ import java.io.IOException;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
ISVIPSUBSCRIBE
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_APPRAISELISTNEW
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_COMPANYLIST
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_EDITBASEINFO
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_EDITMAJORGOODAUTH
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_GETQUESTIONS
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_ISDISPLAYACTIVITY
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_PERSONALPROFILE
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_PRODUCTLIST
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_SELLERCARDCASENEW
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_TOPOFDETAIL
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_appraiseListNew
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_companyList
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_editBaseInfo
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_editMajorGoodAuth
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_getQuestions
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_isDisplayActivity
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_personalProfile
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_productList
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_sellerCardCasesList
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
SELLERCARD_topOfDetail
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
VERSION_INFO
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
WECHAT_NAME
;
import
static
com
.
kjj
.
config
.
BasicConfig
.
apiCount
;
...
...
@@ -60,12 +59,12 @@ public class SellerCard {
@Test
(
description
=
"头部展示"
,
priority
=
3
)
public
void
头部展示
()
throws
IOException
{
//获取信息
Response
response
=
network
.
getResponse
(
SELLERCARD_
TOPOFDETAIL
);
Response
response
=
network
.
getResponse
(
SELLERCARD_
topOfDetail
);
scid
=
response
.
jsonPath
().
getString
(
"data.scid"
);
sellerId
=
response
.
jsonPath
().
getString
(
"data.sellerId"
);
String
sellerName
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
Assert
.
assertEquals
(
sellerName
,
WECHAT_NAME
,
network
.
message
(
SELLERCARD_
TOPOFDETAIL
,
"获取用户失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
sellerName
,
WECHAT_NAME
,
network
.
message
(
SELLERCARD_
topOfDetail
,
"获取用户失败"
,
response
.
body
().
asString
()));
//修改用户信息
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
...
...
@@ -75,60 +74,60 @@ public class SellerCard {
params
.
put
(
"address"
,
"杭州数娱大厦(文一西路98号)"
);
params
.
put
(
"addressLocation"
,
"120.112204,30.287785"
);
params
.
put
(
"avatarStyle"
,
3
);
Response
editRsponse
=
network
.
postResponse
(
params
,
SELLERCARD_
EDITBASEINFO
);
Response
editRsponse
=
network
.
postResponse
(
params
,
SELLERCARD_
editBaseInfo
);
boolean
isChanged
=
editRsponse
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
isChanged
,
network
.
message
(
params
,
SELLERCARD_
EDITBASEINFO
,
"修改用户信息无效"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
isChanged
,
network
.
message
(
params
,
SELLERCARD_
editBaseInfo
,
"修改用户信息无效"
,
response
.
body
().
asString
()));
//重新获取用户信息
response
=
network
.
getResponse
(
SELLERCARD_
TOPOFDETAIL
);
response
=
network
.
getResponse
(
SELLERCARD_
topOfDetail
);
sellerName
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
String
phoneNumber
=
response
.
jsonPath
().
getString
(
"data.phoneNumber"
);
String
wechatNumber
=
response
.
jsonPath
().
getString
(
"data.wechatNumber"
);
String
address
=
response
.
jsonPath
().
getString
(
"data.address"
);
int
avatarStyle
=
response
.
jsonPath
().
getInt
(
"data.avatarStyle"
);
Assert
.
assertEquals
(
sellerName
,
"自动化测试"
,
network
.
message
(
SELLERCARD_
TOPOFDETAIL
,
"修改后的姓名不正确"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
phoneNumber
,
"13012341234"
,
network
.
message
(
SELLERCARD_
TOPOFDETAIL
,
"修改后的手机号不正确"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
wechatNumber
,
"wx123456"
,
network
.
message
(
SELLERCARD_
TOPOFDETAIL
,
"修改后的微信号不正确"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
address
,
"杭州数娱大厦(文一西路98号)"
,
network
.
message
(
SELLERCARD_
TOPOFDETAIL
,
"修改后的地址不正确"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
sellerName
,
"自动化测试"
,
network
.
message
(
SELLERCARD_
topOfDetail
,
"修改后的姓名不正确"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
phoneNumber
,
"13012341234"
,
network
.
message
(
SELLERCARD_
topOfDetail
,
"修改后的手机号不正确"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
wechatNumber
,
"wx123456"
,
network
.
message
(
SELLERCARD_
topOfDetail
,
"修改后的微信号不正确"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
address
,
"杭州数娱大厦(文一西路98号)"
,
network
.
message
(
SELLERCARD_
topOfDetail
,
"修改后的地址不正确"
,
response
.
body
().
asString
()));
// 改为原微信昵称
params
.
put
(
"sellerName"
,
WECHAT_NAME
);
editRsponse
=
network
.
postResponse
(
params
,
SELLERCARD_
EDITBASEINFO
);
editRsponse
=
network
.
postResponse
(
params
,
SELLERCARD_
editBaseInfo
);
}
@Test
(
description
=
"专业介绍"
,
priority
=
4
)
public
void
专业介绍
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
PERSONALPROFILE
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
personalProfile
);
int
exprLength
=
response
.
jsonPath
().
getInt
(
"data.exprLength"
);
//工作年限
Assert
.
assertEquals
(
exprLength
,
2
,
network
.
message
(
params
,
SELLERCARD_
PERSONALPROFILE
,
"个人介绍-获取工作年限不匹配"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
exprLength
,
2
,
network
.
message
(
params
,
SELLERCARD_
personalProfile
,
"个人介绍-获取工作年限不匹配"
,
response
.
body
().
asString
()));
//修改工作年限和个人介绍
Map
<
String
,
Object
>
baseParams
=
new
HashMap
<
String
,
Object
>();
baseParams
.
put
(
"exprLength"
,
2
);
baseParams
.
put
(
"personalIntro"
,
"我在行业内整挺好!"
);
Response
baseResponse
=
network
.
postResponse
(
baseParams
,
SELLERCARD_
EDITBASEINFO
);
Response
baseResponse
=
network
.
postResponse
(
baseParams
,
SELLERCARD_
editBaseInfo
);
boolean
isChanged
=
baseResponse
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
isChanged
,
network
.
message
(
baseParams
,
SELLERCARD_
EDITBASEINFO
,
"修改工作年限和个人介绍无效"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
isChanged
,
network
.
message
(
baseParams
,
SELLERCARD_
editBaseInfo
,
"修改工作年限和个人介绍无效"
,
response
.
body
().
asString
()));
//修改擅长专业
Map
<
String
,
Object
>
personalParams
=
new
HashMap
<
String
,
Object
>();
personalParams
.
put
(
"goodAtCustom"
,
"嘻嘻哈哈"
);
personalParams
.
put
(
"goodAtDefault"
,
"16"
);
Response
personalResponse
=
network
.
postResponse
(
personalParams
,
SELLERCARD_
EDITMAJORGOODAUTH
);
Response
personalResponse
=
network
.
postResponse
(
personalParams
,
SELLERCARD_
editMajorGoodAuth
);
isChanged
=
personalResponse
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
isChanged
,
network
.
message
(
personalParams
,
SELLERCARD_
EDITBASEINFO
,
"修改擅长专业无效"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
isChanged
,
network
.
message
(
personalParams
,
SELLERCARD_
editBaseInfo
,
"修改擅长专业无效"
,
response
.
body
().
asString
()));
//查看修改后的专业介绍
response
=
network
.
getResponse
(
params
,
SELLERCARD_
PERSONALPROFILE
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
personalProfile
);
String
intro
=
response
.
jsonPath
().
getString
(
"data.personalIntro"
);
//个人介绍
exprLength
=
response
.
jsonPath
().
getInt
(
"data.exprLength"
);
//工作年限
boolean
isChooseGoodAtDefault
=
response
.
jsonPath
().
getBoolean
(
"data.goodAtMajor.find {it.code == '16'}.choose"
);
Assert
.
assertEquals
(
intro
,
"我在行业内整挺好!"
,
network
.
message
(
params
,
SELLERCARD_
PERSONALPROFILE
,
"修改个人介绍失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
exprLength
,
2
,
network
.
message
(
params
,
SELLERCARD_
PERSONALPROFILE
,
"修改工作年限失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
isChooseGoodAtDefault
,
network
.
message
(
params
,
SELLERCARD_
PERSONALPROFILE
,
"选择默认擅长专业失效"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
intro
,
"我在行业内整挺好!"
,
network
.
message
(
params
,
SELLERCARD_
personalProfile
,
"修改个人介绍失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
exprLength
,
2
,
network
.
message
(
params
,
SELLERCARD_
personalProfile
,
"修改工作年限失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
isChooseGoodAtDefault
,
network
.
message
(
params
,
SELLERCARD_
personalProfile
,
"选择默认擅长专业失效"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"客户评价"
,
priority
=
5
)
//priorty 方法执行优先级
...
...
@@ -140,32 +139,32 @@ public class SellerCard {
params
.
put
(
"appraiseState"
,
1
);
params
.
put
(
"isPersonal"
,
false
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
APPRAISELISTNEW
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
appraiseListNew
);
boolean
hasAppraise
=
response
.
jsonPath
().
getInt
(
"data.appraiseList.totalCount"
)
>
0
;
Assert
.
assertTrue
(
hasAppraise
,
network
.
message
(
params
,
SELLERCARD_
APPRAISELISTNEW
,
"获取用户评价失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
hasAppraise
,
network
.
message
(
params
,
SELLERCARD_
appraiseListNew
,
"获取用户评价失败"
,
response
.
body
().
asString
()));
params
.
put
(
"isPersonal"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
APPRAISELISTNEW
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_
appraiseListNew
);
hasAppraise
=
response
.
jsonPath
().
getInt
(
"data.appraiseList.totalCount"
)
==
0
;
Assert
.
assertTrue
(
hasAppraise
,
network
.
message
(
params
,
SELLERCARD_
APPRAISELISTNEW
,
"获取专业评价失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
hasAppraise
,
network
.
message
(
params
,
SELLERCARD_
appraiseListNew
,
"获取专业评价失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"互动问答"
,
priority
=
6
)
//priorty 方法执行优先级
public
void
互动问答
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
GETQUESTIONS
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
getQuestions
);
int
qurstionsCount
=
response
.
jsonPath
().
getInt
(
"data.questionList.size()"
);
Assert
.
assertEquals
(
qurstionsCount
,
2
,
network
.
message
(
params
,
SELLERCARD_
GETQUESTIONS
,
"获取用户评价失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
qurstionsCount
,
2
,
network
.
message
(
params
,
SELLERCARD_
getQuestions
,
"获取用户评价失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"风险评测"
,
priority
=
7
)
//priorty 方法执行优先级
public
void
风险评测
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
ISDISPLAYACTIVITY
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
isDisplayActivity
);
String
contentId
=
response
.
jsonPath
().
getString
(
"data.contentId"
);
//写死风险评测id
Assert
.
assertEquals
(
contentId
,
"Kj21Mzc0NzE"
,
network
.
message
(
params
,
SELLERCARD_
ISDISPLAYACTIVITY
,
"风险评测-获取失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
contentId
,
"Kj21Mzc0NzE"
,
network
.
message
(
params
,
SELLERCARD_
isDisplayActivity
,
"风险评测-获取失败"
,
response
.
body
().
asString
()));
}
//
...
...
@@ -174,16 +173,16 @@ public class SellerCard {
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
200
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
COMPANYLIST
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
companyList
);
String
companyId
=
response
.
jsonPath
().
getString
(
"data.list.find {it.companyName == '太平洋保险'}.id"
);
Assert
.
assertNotNull
(
companyId
,
network
.
message
(
params
,
SELLERCARD_
COMPANYLIST
,
"公司列表-获取失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
companyId
,
network
.
message
(
params
,
SELLERCARD_
companyList
,
"公司列表-获取失败"
,
response
.
body
().
asString
()));
Map
<
String
,
Object
>
editParams
=
new
HashMap
<
String
,
Object
>();
editParams
.
put
(
"companyId"
,
companyId
);
response
=
network
.
postResponse
(
editParams
,
SELLERCARD_
EDITBASEINFO
);
response
=
network
.
postResponse
(
editParams
,
SELLERCARD_
editBaseInfo
);
boolean
isChanged
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
isChanged
,
network
.
message
(
editParams
,
SELLERCARD_
EDITBASEINFO
,
"选择公司失效"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
isChanged
,
network
.
message
(
editParams
,
SELLERCARD_
editBaseInfo
,
"选择公司失效"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"服务案例"
,
priority
=
9
)
//priorty 方法执行优先级
...
...
@@ -191,9 +190,9 @@ public class SellerCard {
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
4
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
SELLERCARDCASENEW
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
sellerCardCasesList
);
int
count
=
response
.
jsonPath
().
getInt
(
"data.sellerCases.size()"
);
Assert
.
assertEquals
(
count
,
3
,
network
.
message
(
params
,
SELLERCARD_
SELLERCARDCASENEW
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
count
,
3
,
network
.
message
(
params
,
SELLERCARD_
sellerCardCasesList
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"精选产品"
,
priority
=
10
)
//priorty 方法执行优先级
...
...
@@ -202,9 +201,9 @@ public class SellerCard {
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
3
);
params
.
put
(
"isMore"
,
false
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
PRODUCTLIST
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_
productList
);
int
count
=
response
.
jsonPath
().
getInt
(
"data.productList.size()"
);
Assert
.
assertEquals
(
count
,
3
,
network
.
message
(
params
,
SELLERCARD_
PRODUCTLIST
,
"精选产品-获取失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
count
,
3
,
network
.
message
(
params
,
SELLERCARD_
productList
,
"精选产品-获取失败"
,
response
.
body
().
asString
()));
}
@AfterClass
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
1da6b736
...
...
@@ -631,16 +631,16 @@ public class BasicConfig {
// *************** 名片 ***************
public
static
final
String
SELLERCARD_
TOPOFDETAIL
=
HOST
+
"/kjy/mp/sellerCardV5/topOfDetail"
;
public
static
final
String
SELLERCARD_
EDITBASEINFO
=
HOST
+
"/kjy/mp/sellerCard/editBaseInfo"
;
public
static
final
String
SELLERCARD_
PERSONALPROFILE
=
HOST
+
"/kjy/mp/sellerCardV5/personalProfile"
;
public
static
final
String
SELLERCARD_
EDITMAJORGOODAUTH
=
HOST
+
"/kjy/mp/sellerCard/editMajorGoodAuth"
;
public
static
final
String
SELLERCARD_
APPRAISELISTNEW
=
HOST
+
"/kjy/mp/sellerCardV5/appraiseListNew"
;
public
static
final
String
SELLERCARD_
GETQUESTIONS
=
HOST
+
"/kjy/mp/sellerCardV5/getQuestions"
;
public
static
final
String
SELLERCARD_
ISDISPLAYACTIVITY
=
HOST
+
"/kjy/mp/clue/activity/isDisplayActivity"
;
public
static
final
String
SELLERCARD_
COMPANYLIST
=
HOST
+
"/kjy/mp/company/list"
;
public
static
final
String
SELLERCARD_
SELLERCARDCASENEW
=
HOST
+
"/kjy/mp/sellerCardV5/sellerCardCasesList"
;
public
static
final
String
SELLERCARD_
PRODUCTLIST
=
HOST
+
"/kjy/mp/sellerCardV5/productList"
;
public
static
final
String
SELLERCARD_
topOfDetail
=
HOST
+
"/kjy/mp/sellerCardV5/topOfDetail"
;
public
static
final
String
SELLERCARD_
editBaseInfo
=
HOST
+
"/kjy/mp/sellerCard/editBaseInfo"
;
public
static
final
String
SELLERCARD_
personalProfile
=
HOST
+
"/kjy/mp/sellerCardV5/personalProfile"
;
public
static
final
String
SELLERCARD_
editMajorGoodAuth
=
HOST
+
"/kjy/mp/sellerCard/editMajorGoodAuth"
;
public
static
final
String
SELLERCARD_
appraiseListNew
=
HOST
+
"/kjy/mp/sellerCardV5/appraiseListNew"
;
public
static
final
String
SELLERCARD_
getQuestions
=
HOST
+
"/kjy/mp/sellerCardV5/getQuestions"
;
public
static
final
String
SELLERCARD_
isDisplayActivity
=
HOST
+
"/kjy/mp/clue/activity/isDisplayActivity"
;
public
static
final
String
SELLERCARD_
companyList
=
HOST
+
"/kjy/mp/company/list"
;
public
static
final
String
SELLERCARD_
sellerCardCasesList
=
HOST
+
"/kjy/mp/sellerCardV5/sellerCardCasesList"
;
public
static
final
String
SELLERCARD_
productList
=
HOST
+
"/kjy/mp/sellerCardV5/productList"
;
public
static
final
String
SELLERCARD_GETSELLERCARDCONFIG
=
HOST
+
"/kjy/mp/sellerConfig/getSellerCardConfig"
;
public
static
final
String
SELLERCARD_GETSELLERCARDSTYLE
=
HOST
+
"/kjy/mp/sellerConfig/getSellerCardStyle"
;
public
static
final
String
SELLERCARD_TOPOFCONTENT
=
HOST
+
"/kjy/mp/sellerCardV5/topOfContent"
;
...
...
@@ -788,15 +788,27 @@ public class BasicConfig {
// *************** 贺卡 ***************
public
static
final
String
GREETING_
BANNER
=
HOST
+
"/kjy/mp/greeting/banner"
;
public
static
final
String
GREETING_
ALLFORWARD
=
HOST
+
"/kjy/mp/greeting/allForward"
;
public
static
final
String
GREETING_
FINDBYTYPE
=
HOST
+
"/kjy/mp/tag/findByType"
;
public
static
final
String
GREETING_
PAGELIST
=
HOST
+
"/kjy/mp/greeting/pageList"
;
public
static
final
String
GREETING_
banner
=
HOST
+
"/kjy/mp/greeting/banner"
;
public
static
final
String
GREETING_
allForward
=
HOST
+
"/kjy/mp/greeting/allForward"
;
public
static
final
String
GREETING_
findByType
=
HOST
+
"/kjy/mp/tag/findByType"
;
public
static
final
String
GREETING_
pageList
=
HOST
+
"/kjy/mp/greeting/pageList"
;
public
static
final
String
GREETING_CONFLIST
=
HOST
+
"/kjy/mp/greeting/conf/list"
;
public
static
final
String
GREETING_H5SHARE
=
ACTIVITY_HOST
+
"/kjy/mp/greeting/conf/h5share"
;
public
static
final
String
GREETING_H5INFO
=
ACTIVITY_HOST
+
"/kjy/mp/content/h5info"
;
public
static
final
String
GREETING_SAVEDEFAULT
=
ACTIVITY_HOST
+
"/kjy/mp/greeting/conf/saveDefault"
;
public
static
final
String
GREETING_getTipsByPage
=
HOST
+
"/kjy/mp/tips/getTipsByPage"
;
public
static
final
String
GREETING_getMarketingToolArea
=
HOST
+
"/kjy/mp/home/getMarketingToolArea"
;
public
static
final
String
GREETING_answerPageList
=
HOST
+
"/kjy/mp/game/answerPageList"
;
public
static
final
String
GREETING_getSellerVipInfo
=
HOST
+
"/kjy/mp/seller/getSellerVipInfo"
;
public
static
final
String
GREETING_checkVisitor
=
HOST
+
"/kjy/mp/greeting/checkVisitor"
;
public
static
final
String
GREETING_oaSubscribeType
=
HOST
+
"/kjy/mp/user/oaSubscribeType"
;
public
static
final
String
GREETING_check
=
ACTIVITY_HOST
+
"/kjy/mp/greeting/conf/check"
;
public
static
final
String
GREETING_preView
=
ACTIVITY_HOST
+
"/kjy/mp/greeting/preView"
;
public
static
final
String
GREETING_isRedpackEnable
=
ACTIVITY_HOST
+
"/kjy/mp/greeting/packet/isRedpackEnable"
;
public
static
final
String
GREETING_self
=
ACTIVITY_HOST
+
"/kjy/mp/seller/self"
;
public
static
final
String
GREETING_getInfoByScid
=
ACTIVITY_HOST
+
"/kjy/mp/seller/getInfoByScid"
;
public
static
final
String
GREETING_checkLimit
=
ACTIVITY_HOST
+
"/kjy/mp/greeting/conf/checkLimit"
;
public
static
final
String
GREETING_more
=
ACTIVITY_HOST
+
"/kjy/mp/greeting/more"
;
// *************** 管理后台 ***************
...
...
src/test/wechatTestNG.xml
View file @
1da6b736
...
...
@@ -37,6 +37,11 @@
<class
name=
"com.kjj.cases.assistant.whoSawMe.WhoSawMe"
/>
</classes>
</test>
<test
preserve-order=
"true"
name =
"贺卡"
>
<classes>
<class
name=
"com.kjj.cases.assistant.markettools.greetingCrad"
/>
</classes>
</test>
</suite>
<!-- Suite -->
...
...
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