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
24fdafb7
Commit
24fdafb7
authored
Jul 12, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ddd70252
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
204 additions
and
205 deletions
+204
-205
GrabWelfares.java
src/test/java/com/kjj/bean/agent/GrabWelfares.java
+9
-0
RecommendMaterial.java
src/test/java/com/kjj/cases/assistant/RecommendMaterial.java
+171
-180
LiveLater.java
src/test/java/com/kjj/cases/live/agent/LiveLater.java
+24
-25
No files found.
src/test/java/com/kjj/bean/agent/GrabWelfares.java
0 → 100644
View file @
24fdafb7
package
com
.
kjj
.
bean
.
agent
;
import
lombok.Data
;
@Data
public
class
GrabWelfares
{
private
Boolean
specifyAward
;
}
src/test/java/com/kjj/cases/assistant/RecommendMaterial.java
View file @
24fdafb7
This diff is collapsed.
Click to expand it.
src/test/java/com/kjj/cases/live/agent/LiveLater.java
View file @
24fdafb7
package
com
.
kjj
.
cases
.
live
.
agent
;
import
com.kjj.bean.agent.GrabWelfares
;
import
com.kjj.bean.agent.LiveUserList
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.config.BasicConfig
;
...
...
@@ -29,11 +30,8 @@ public class LiveLater implements Authorization {
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
// params.put("liveId","Kj21MzYyNjM");
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_recycleSuccessCase
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_recycleSuccessCase
,
"接口请求失败"
,
response
.
body
().
asString
()));
System
.
out
.
println
(
response
.
body
().
asString
());
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_recycleSuccessCase
,
"未获取到成功案例"
,
response
.
body
().
asString
()));
}
...
...
@@ -90,7 +88,6 @@ public class LiveLater implements Authorization {
System
.
out
.
println
(
data
);
String
nickname
=
response
.
jsonPath
().
getString
(
"data.nickname"
);
Assert
.
assertEquals
(
nickname
,
"张三"
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_providerInfo
,
"未获取到发奖人姓名"
,
response
.
body
().
asString
()));
String
phoneNumber
=
response
.
jsonPath
().
getString
(
"data.phoneNumber"
);
Assert
.
assertEquals
(
phoneNumber
,
"15558005636"
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_providerInfo
,
"未获取到发奖人手机号"
,
response
.
body
().
asString
()));
}
...
...
@@ -228,8 +225,25 @@ public class LiveLater implements Authorization {
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_getClueDetail
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
response
.
body
().
asString
());
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"查看客户A线索详情失败"
,
response
.
body
().
asString
()));
int
visitorInviteNum
=
response
.
jsonPath
().
getInt
(
"data.visitorInviteNum"
);
Assert
.
assertTrue
(
visitorInviteNum
==
1
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"访客邀请数不对"
,
response
.
body
().
asString
()));
String
remarkName
=
response
.
jsonPath
().
getString
(
"data.remarkName"
);
Assert
.
assertEquals
(
remarkName
,
"访客A"
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"访客备注名不正确"
,
response
.
body
().
asString
()));
int
speakNum
=
response
.
jsonPath
().
getInt
(
"data.speakNum"
);
Assert
.
assertTrue
(
speakNum
>
0
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"没有评论数"
,
response
.
body
().
asString
()));
Object
questions
=
response
.
jsonPath
().
getJsonObject
(
"data.questions"
);
Assert
.
assertNotNull
(
questions
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"用户提问列表为null"
,
response
.
body
().
asString
()));
Object
resources
=
response
.
jsonPath
().
getJsonObject
(
"data.resources"
);
Assert
.
assertNotNull
(
resources
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"用户领取资料列表为null"
,
response
.
body
().
asString
()));
Object
grabWelfares
=
response
.
jsonPath
().
getJsonObject
(
"data.grabWelfares"
);
Assert
.
assertNotNull
(
grabWelfares
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"用户中奖列表为null"
,
response
.
body
().
asString
()));
Object
choiceQuestions
=
response
.
jsonPath
().
getJsonObject
(
"data.choiceQuestions"
);
Assert
.
assertNotNull
(
choiceQuestions
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"投票列表为null"
,
response
.
body
().
asString
()));
Object
testResources
=
response
.
jsonPath
().
getJsonObject
(
"data.testResources"
);
Assert
.
assertNotNull
(
testResources
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"用户提交测试资源报告为null"
,
response
.
body
().
asString
()));
List
<
GrabWelfares
>
list
=
JsonUtil
.
parseResponseToListBean
(
response
,
GrabWelfares
.
class
,
"grabWelfares"
);
Boolean
specifyAward
=
list
.
get
(
0
).
getSpecifyAward
();
Assert
.
assertTrue
(
specifyAward
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_getClueDetail
,
"指定中奖为null"
,
response
.
body
().
asString
()));
}
...
...
@@ -249,7 +263,8 @@ public class LiveLater implements Authorization {
//需要校验返回结果
@Test
(
description
=
"访客邀请列表"
,
priority
=
14
)
public
void
访客邀请列表
()
{
public
void
访客邀请列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
// params.put("liveId","Kj21MzYyNjM");
...
...
@@ -279,7 +294,7 @@ public class LiveLater implements Authorization {
//代理人首页已结束直播,查询待跟进线索数
@Test
(
description
=
"查询待跟进线索数"
,
priority
=
1
5
)
@Test
(
description
=
"查询待跟进线索数"
,
priority
=
1
6
)
public
void
查询待跟进线索数
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -296,20 +311,4 @@ public class LiveLater implements Authorization {
}
//不确定业务场景
@Test
(
description
=
"代理人直播线索页分页查询咨询消息"
,
priority
=
16
)
public
void
代理人直播线索页分页查询咨询消息
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
// params.put("liveId","Kj21MzYyNjM");
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_clueTextList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_clueTextList
,
"接口调用失败"
,
response
.
body
().
asString
()));
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
// Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_clueTextList, "咨询消息为null", response.body().asString()));
}
}
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