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
fccdce50
Commit
fccdce50
authored
Jul 09, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加了我的名片基本信息、服务案例、精选产品的测试用例
parent
1e1a4e4d
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
572 additions
and
1 deletion
+572
-1
GoodMajor.java
src/test/java/com/kjj/bean/card/GoodMajor.java
+11
-0
WechatCard.java
src/test/java/com/kjj/bean/card/WechatCard.java
+33
-0
PersonCard.java
src/test/java/com/kjj/cases/basics/card/PersonCard.java
+508
-0
Treasure.java
src/test/java/com/kjj/cases/live/treasure/Treasure.java
+1
-1
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+9
-0
JsonUtil.java
src/test/java/com/kjj/utils/JsonUtil.java
+5
-0
wechatTestNG.xml
src/test/wechatTestNG.xml
+5
-0
No files found.
src/test/java/com/kjj/bean/card/GoodMajor.java
0 → 100644
View file @
fccdce50
package
com
.
kjj
.
bean
.
card
;
import
lombok.Data
;
@Data
public
class
GoodMajor
{
String
code
;
String
desc
;
boolean
choose
;
String
type
;
}
src/test/java/com/kjj/bean/card/WechatCard.java
0 → 100644
View file @
fccdce50
package
com
.
kjj
.
bean
.
card
;
import
lombok.Data
;
@Data
public
class
WechatCard
{
String
avatar
;
String
address
;
String
addressLocation
;
int
avatarStyle
;
String
backgroundAvatar
;
String
backgroundAvatarThumbnail
;
int
companyId
;
String
companyName
;
String
companyLogo
;
String
jobPost
;
String
normalAvatar
;
String
normalAvatarThumbnail
;
String
parentCompanyName
;
String
professionalAvatar
;
String
professionalAvatarThumbnail
;
String
phoneNumber
;
String
screenshotUrl
;
String
sellerName
;
String
s_cid
;
String
sellerId
;
String
wechatNumber
;
String
wechatQrCode
;
int
userVersion
;
boolean
self
;
boolean
vip
;
int
tradeType
;
}
src/test/java/com/kjj/cases/basics/card/PersonCard.java
0 → 100644
View file @
fccdce50
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.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
.*;
public
class
PersonCard
implements
Authorization
{
private
static
final
NetworkUtils
network
=
NetworkUtils
.
getInstance
();
public
String
scid
;
public
String
sellerCaseId
;
public
String
personalProductId
;
@BeforeClass
public
void
setUp
()
{
agentTku
();
}
@Test
(
description
=
"获取用户信息"
,
priority
=
1
)
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
().
getBoolean
(
"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
()));
}
@Test
(
description
=
"获取用户版本"
,
priority
=
2
)
public
void
获取用户版本
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"t"
,
System
.
currentTimeMillis
());
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
().
getBoolean
(
"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
()));
}
@Test
(
description
=
"获取名片顶部信息"
,
priority
=
3
)
public
void
获取名片顶部信息
(){
Response
response
=
network
.
getResponse
(
SELLERCARD_TOPOFDETAIL
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
WechatCard
card
=
JsonUtil
.
parseResponseToBean
(
response
,
WechatCard
.
class
);
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
()));
}
@Test
(
description
=
"保存名片基本信息"
,
priority
=
4
)
public
void
保存名片基本信息
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
//修改用户信息
params
.
put
(
"sellerName"
,
"自动化测试"
);
params
.
put
(
"phoneNumber"
,
"13043214321"
);
params
.
put
(
"wechatNumber"
,
"wx654321"
);
params
.
put
(
"jobPost"
,
"啦啦啦"
);
params
.
put
(
"address"
,
"重庆市轨道集团建设大楼"
);
params
.
put
(
"addressLocation"
,
"106.544362,29.559164"
);
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
()));
//查看修改是否成功
response
=
network
.
getResponse
(
SELLERCARD_TOPOFDETAIL
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getBoolean
(
"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
()));
//还原用户信息
params
.
clear
();
params
.
put
(
"sellerName"
,
"吉吉"
);
params
.
put
(
"phoneNumber"
,
"13012341234"
);
params
.
put
(
"wechatNumber"
,
"wx123456"
);
params
.
put
(
"jobPost"
,
"嘿嘿嘿"
);
params
.
put
(
"address"
,
"杭州数娱大厦(文一西路98号)"
);
params
.
put
(
"addressLocation"
,
"120.112204,30.287785"
);
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
()));
}
@Test
(
description
=
"获取用户个人介绍模块"
,
priority
=
5
)
public
void
获取用户个人介绍模块
(){
Response
response
=
network
.
getResponse
(
SELLERCARD_PERSONALPROFILE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getBoolean
(
"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
()));
}
@Test
(
description
=
"获取个人介绍模板"
,
priority
=
6
)
public
void
获取用户个人介绍模板
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
30
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETPERSONINTROTEMPLATE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
int
totalCount
=
response
.
jsonPath
().
getInt
(
"data.totalCount"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
totalCount
>
1
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"模板列表为空"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改个人介绍模块"
,
priority
=
7
)
public
void
修改个人介绍模块
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
//修改个人介绍和年限
params
.
put
(
"personalIntro"
,
"本人有多年的保险销售和管理经验!"
);
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
()));
//修改专业标签
params
.
clear
();
params
.
put
(
"goodAtDefault"
,
"1,2"
);
params
.
put
(
"goodAtCustom"
,
""
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITMAJORGOODAUTH
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_EDITMAJORGOODAUTH
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
//查看修改是否成功
response
=
network
.
getResponse
(
SELLERCARD_PERSONALPROFILE
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getBoolean
(
"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
()));
//还原个人介绍模块
//还原个人介绍和年限
params
.
clear
();
params
.
put
(
"personalIntro"
,
"我在行业内整挺好!"
);
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
()));
//还原专业标签
params
.
clear
();
params
.
put
(
"goodAtDefault"
,
"1"
);
params
.
put
(
"goodAtCustom"
,
""
);
response
=
network
.
postResponse
(
params
,
SELLERCARD_EDITMAJORGOODAUTH
);
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_EDITMAJORGOODAUTH
,
"接口返回失败状态"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"更新代理人精彩点滴照片"
,
priority
=
8
)
public
void
更新代理人精彩点滴照片
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
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
()));
}
@Test
(
description
=
"获取代理人精彩点滴照片"
,
priority
=
9
)
public
void
获取代理人精彩点滴照片
(){
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
"1"
);
params
.
put
(
"pageSize"
,
"100"
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_GETSPLENDINGIMAGE
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getBoolean
(
"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_PERSONALPROFILE
,
"返回数据为空"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
totalCount
,
2
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
size
,
2
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"更新失败"
,
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
()));
}
@Test
(
description
=
"根据page获取当前页面的Tips"
,
priority
=
10
)
//priorty 方法执行优先级
public
void
根据
page
获取当前页面的
Tips
()
{
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
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"更新失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
SELLERCARD_PERSONALPROFILE
,
"返回数据为空"
,
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
(
"isMore"
,
false
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_SELLERCARDCASENEW
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getBoolean
(
"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
.
assertEquals
(
count
,
3
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"添加个人案例"
,
priority
=
12
)
//priorty 方法执行优先级
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"
);
params
.
put
(
"customerName"
,
"客户A"
);
params
.
put
(
"isShow"
,
true
);
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
()));
//查看是否添加成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"isMore"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_SELLERCARDCASENEW
);
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
()));
}
@Test
(
description
=
"修改个人案例"
,
priority
=
13
)
//priorty 方法执行优先级
public
void
修改个人案例
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
sellerCaseId
);
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
()));
//查看是否添加成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"isMore"
,
true
);
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
(
caseIntro
,
"案例描述A进行了更新"
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-描述错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"修改个人案例展示状态"
,
priority
=
14
)
//priorty 方法执行优先级
public
void
修改个人案例展示状态
()
{
//取消展示
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"caseId"
,
null
);
params
.
put
(
"isShow"
,
false
);
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
()));
//查看状态是否更新成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"isMore"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_SELLERCARDCASENEW
);
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
()));
//展示
params
.
clear
();
params
.
put
(
"caseId"
,
null
);
params
.
put
(
"isShow"
,
true
);
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
()));
//查看状态是否更新成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"isMore"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_SELLERCARDCASENEW
);
isShow
=
response
.
jsonPath
().
getBoolean
(
path
);
Assert
.
assertTrue
(
isShow
,
network
.
message
(
params
,
SELLERCARD_SELLERCARDCASENEW
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"删除个人案例"
,
priority
=
15
)
//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
()));
//查看是否删除成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"isMore"
,
false
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_SELLERCARDCASENEW
);
int
count
=
response
.
jsonPath
().
getInt
(
"data.sellerCases.size()"
);
Assert
.
assertEquals
(
count
,
3
,
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
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"isMore"
,
true
);
Response
response
=
network
.
getResponse
(
params
,
SELLERCARD_PRODUCTLIST
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Object
data
=
response
.
jsonPath
().
getBoolean
(
"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
.
assertEquals
(
count
,
3
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"服务案例-获取失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"添加精选产品"
,
priority
=
17
)
//priorty 方法执行优先级
public
void
添加精选产品
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"productName"
,
"这是性价比非常高、投入少、保额高的产品"
);
params
.
put
(
"externalLink"
,
"http://www.baidu.com"
);
params
.
put
(
"productFeature"
,
"这是产品描述"
);
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
()));
//查看是否添加成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
30
);
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
(
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
=
18
)
//priorty 方法执行优先级
public
void
修改精选产品
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"productName"
,
"这是性价比非常高、投入少、保额高的产品"
);
params
.
put
(
"externalLink"
,
"http://www.baidu.com"
);
params
.
put
(
"productImg"
,
"//yun.kjjcrm.com/kjy/image/20210709/a349c64087224a47a8ba0b8bc49f3498.jpg"
);
params
.
put
(
"personalProductId"
,
personalProductId
);
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
()));
//查看是否添加成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
30
);
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 方法执行优先级
public
void
修改产品展示状态
()
{
//取消展示
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
null
);
params
.
put
(
"isShow"
,
false
);
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
()));
//查看状态是否更新成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"isMore"
,
true
);
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
()));
//展示
params
.
clear
();
params
.
put
(
"id"
,
null
);
params
.
put
(
"isShow"
,
true
);
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
()));
//查看状态是否更新成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"isMore"
,
true
);
response
=
network
.
getResponse
(
params
,
SELLERCARD_PRODUCTLIST
);
isShow
=
response
.
jsonPath
().
getBoolean
(
path
);
Assert
.
assertTrue
(
isShow
,
network
.
message
(
params
,
SELLERCARD_PRODUCTLIST
,
"服务案例-展示状态错误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"删除精选产品"
,
priority
=
20
)
//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
()));
//查看是否删除成功
params
.
clear
();
params
.
put
(
"scid"
,
scid
);
params
.
put
(
"pageSize"
,
30
);
params
.
put
(
"isMore"
,
false
);
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
()));
}
}
src/test/java/com/kjj/cases/live/treasure/Treasure.java
View file @
fccdce50
...
...
@@ -146,7 +146,7 @@ public class Treasure implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
simpleParam
,
BasicConfig
.
MOBILE_simple
,
"未登录查询分享人头像昵称失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"已登录查询
分享人头像昵称
"
,
priority
=
10
)
@Test
(
description
=
"已登录查询
助力信息
"
,
priority
=
10
)
public
void
已登录查询分享人头像昵称
()
{
visitorAuth2
();
Map
<
String
,
Object
>
infoParam
=
new
HashMap
<>();
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
fccdce50
...
...
@@ -573,6 +573,15 @@ public class BasicConfig {
public
static
final
String
SELLERCARD_GETSELLERCARDSTYLE
=
HOST
+
"/kjy/mp/sellerConfig/getSellerCardStyle"
;
public
static
final
String
SELLERCARD_TOPOFCONTENT
=
HOST
+
"/kjy/mp/sellerCardV5/topOfContent"
;
public
static
final
String
SELLERCARD_BOTTOMOFCONTENT
=
HOST
+
"/kjy/mp/sellerCardV5/bottomOfContent"
;
public
static
final
String
SELLERCARD_GETPERSONINTROTEMPLATE
=
HOST
+
"/kjy/mp/sellerCardV5/getPersonalIntroTemplate"
;
public
static
final
String
SELLERCARD_UPDATESPLENDINGIMAGE
=
HOST
+
"/kjy/mp/sellerCard/updateSplendidImage"
;
public
static
final
String
SELLERCARD_GETSPLENDINGIMAGE
=
HOST
+
"/kjy/mp/sellerCard/getSellerSplendidImage"
;
public
static
final
String
SELLERCARD_EDITDELLERCASE
=
HOST
+
"/kjy/mp/sellerCard/editSellerCase"
;
public
static
final
String
SELLERCARD_UPDATESHOWSTATUSFORCASE
=
HOST
+
"/kjy/mp/sellerCardV5/updateShowStatusForCase"
;
public
static
final
String
SELLERCARD_DELETESELLERCASE
=
HOST
+
"/kjy/mp/sellerCard/deleteSellerCase"
;
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"
;
...
...
src/test/java/com/kjj/utils/JsonUtil.java
View file @
fccdce50
...
...
@@ -73,4 +73,9 @@ public class JsonUtil {
return
JSON
.
parseArray
(
str
,
tClass
);
}
public
static
<
T
>
List
<
T
>
parseResponsePathToListBean
(
Response
response
,
String
path
,
Class
<
T
>
tClass
){
Object
data
=
response
.
jsonPath
().
getJsonObject
(
path
);
String
str
=
new
JsonBuilder
(
data
).
toString
();
return
JSON
.
parseArray
(
str
,
tClass
);
}
}
src/test/wechatTestNG.xml
View file @
fccdce50
...
...
@@ -51,6 +51,11 @@
<class
name=
"com.kjj.cases.basics.GreetingCard"
/>
</classes>
</test>
<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.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