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
227640f7
Commit
227640f7
authored
Jun 19, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
769cf56c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
796 additions
and
686 deletions
+796
-686
AgentVideo.java
src/test/java/com/kjj/bean/agent/AgentVideo.java
+2
-2
VideoBean.java
src/test/java/com/kjj/bean/manager/VideoBean.java
+9
-0
AdminAuthorization.java
...est/java/com/kjj/cases/live/admin/AdminAuthorization.java
+1
-1
Agent.java
src/test/java/com/kjj/cases/live/agent/Agent.java
+316
-323
LiveLater.java
src/test/java/com/kjj/cases/live/agent/LiveLater.java
+8
-14
Procurator.java
src/test/java/com/kjj/cases/live/agent/Procurator.java
+0
-90
SaveLive.java
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
+283
-226
Share.java
src/test/java/com/kjj/cases/live/liveConfig/Share.java
+1
-1
Video.java
src/test/java/com/kjj/cases/live/liveConfig/Video.java
+125
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+28
-13
liveTestNG.xml
src/test/liveTestNG.xml
+23
-16
No files found.
src/test/java/com/kjj/bean/agent/AgentVideo.java
View file @
227640f7
...
...
@@ -8,12 +8,12 @@ public class AgentVideo {
private
int
pageIndex
;
private
int
pageSize
;
private
String
totalCount
;
private
List
<
video
l
ist
>
list
;
private
List
<
video
L
ist
>
list
;
private
boolean
hasNext
;
private
String
totalPage
;
@Data
public
static
class
video
l
ist
{
public
static
class
video
L
ist
{
private
String
id
;
private
String
videoTitle
;
private
String
videoTag
;
...
...
src/test/java/com/kjj/bean/manager/VideoBean.java
0 → 100644
View file @
227640f7
package
com
.
kjj
.
bean
.
manager
;
import
lombok.Data
;
@Data
public
class
VideoBean
{
private
Integer
id
;
}
src/test/java/com/kjj/cases/live/admin/AdminAuthorization.java
View file @
227640f7
...
...
@@ -90,7 +90,7 @@ public interface AdminAuthorization {
}
/**
* 访客I(熊大)授权 ID:
946
* 访客I(熊大)授权 ID:
1239
*/
default
void
visitorAuth8
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY8
);
...
...
src/test/java/com/kjj/cases/live/agent/
Live
Agent.java
→
src/test/java/com/kjj/cases/live/agent/Agent.java
View file @
227640f7
...
...
@@ -8,62 +8,72 @@ import com.kjj.bean.agent.AgentVideo;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.JsonUtil
;
import
io.restassured.path.json.JsonPath
;
import
io.restassured.response.Response
;
import
org.apache.commons.lang3.RandomUtils
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
config
.
BasicConfig
.
MOBILE_ClueList
;
public
class
Live
Agent
implements
AdminAuthorization
{
public
class
Agent
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
agentAuth
();
}
public
String
pageSize
;
public
String
invitationNum
;
public
String
allNum
;
public
String
moreThan20MinNum
;
public
String
sellerName
;
public
String
phoneNumber
;
public
String
jobNumber
;
public
String
teamName
;
public
void
setUp
()
{
agentAuth
();
}
public
String
id
;
public
String
videoId
;
public
String
videoTitle
;
public
String
watchNum
;
public
String
shareNum
;
public
String
likeNum
;
public
String
videoTime
;
public
String
phoneNumber
;
public
String
jobNumber
;
public
String
teamName
;
public
String
sellerName
;
@Test
(
description
=
"获取用户信息判断是否是代理人"
,
priority
=
1
)
public
void
获取用户信息判断是否是代理人
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_userInfo1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Object
jobNumber
=
response
.
jsonPath
().
getJsonObject
(
"data.jobNumber"
);
System
.
out
.
println
(
jobNumber
);
Assert
.
assertNotNull
(
jobNumber
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_userInfo1
,
"用户非代理人"
,
response
.
body
().
asString
()));
}
//代理人页面
//查询代理人信息
@Test
(
description
=
"代理人名片信息"
,
priority
=
1
)
public
void
代理人名片信息
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
);
AgentCard
agentBeans
=
JsonUtil
.
parseResponseToBean
(
response
,
AgentCard
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
agentBeans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
,
"查询代理人信息失败"
,
response
.
body
().
asString
()));
@Test
(
description
=
"查看appId对应的小程序是否禁止分享"
,
priority
=
2
)
public
void
查看
appId
对应的小程序是否禁止分享
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"appid"
,
"wx4d7276f866bd24c8"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_isForbidden
);
Boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertFalse
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_isForbidden
,
"禁止分享"
,
response
.
body
().
asString
()));
}
//代理人个人信息获取
@Test
(
description
=
"获取代理人个人信息"
,
priority
=
2
)
public
void
获取代理人个人信息
()
throws
IOException
{
@Test
(
description
=
"获取直播订阅的所有消息模板"
,
priority
=
3
)
public
void
获取直播订阅的所有消息模板
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_wxIdAllList
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_wxIdAllList
,
"禁止分享"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取代理人卡片信息"
,
priority
=
4
)
public
void
获取代理人卡片信息
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
);
sellerName
=
response
.
jsonPath
().
getString
(
"data.sellerName"
);
phoneNumber
=
response
.
jsonPath
().
getString
(
"data.phoneNumber"
);
jobNumber
=
response
.
jsonPath
().
getString
(
"data.jobNumber"
);
...
...
@@ -73,27 +83,36 @@ public class LiveAgent implements AdminAuthorization {
Assert
.
assertNotNull
(
phoneNumber
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
,
"获取代理人手机号失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
jobNumber
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
,
"获取代理人工号失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
teamName
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
,
"获取代理人团队名称失败"
,
response
.
body
().
asString
()));
}
}
//修改代理人信息
@Test
(
description
=
"修改代理人信息"
,
priority
=
3
)
@Test
(
description
=
"修改代理人信息"
,
priority
=
5
)
public
void
修改代理人信息
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sellerName"
,
"
你好测试
"
+
RandomUtils
.
nextInt
(
1
,
100
));
params
.
put
(
"sellerName"
,
"
小智
"
+
RandomUtils
.
nextInt
(
1
,
100
));
params
.
put
(
"phoneNumber"
,
"152588101691"
);
params
.
put
(
"jobNumber"
,
"
TTTTTT
"
);
params
.
put
(
"jobNumber"
,
"
KJJ0000
"
);
params
.
put
(
"wechatQrCode"
,
"//yun.dui88.com/kjy/nc/qrcode1/1981ec88d22fe37041feac4724c627670817.png"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_AgentEditCardInfo
);
Boolean
agentBeans
=
JsonUtil
.
parseResponseToBean
(
response
,
Boolean
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
agentBeans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentEditCardInfo
,
"修改代理人信息失败"
,
response
.
body
().
asString
()));
Boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentEditCardInfo
,
"修改代理人信息失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"用户反馈"
,
priority
=
6
)
public
void
用户反馈
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"feedbackContent"
,
"名片反馈测试...."
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_feedbackSave
);
Boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_feedbackSave
,
"修改代理人信息失败"
,
response
.
body
().
asString
()));
}
//代理人首页直播列表
@Test
(
description
=
"代理人首页 "
,
priority
=
4
)
public
void
代理人直播列表
()
{
@Test
(
description
=
"获取直播列表 "
,
priority
=
7
)
public
void
获取直播列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -107,9 +126,9 @@ public class LiveAgent implements AdminAuthorization {
}
}
/
/代理人首页已结束的直播列表
@Test
(
description
=
"
代理人首页已结束的直播列表"
,
priority
=
5
)
public
void
代理人直播结束
列表
()
{
/
*代理人首页已结束的直播列表*/
@Test
(
description
=
"
获取已结束的直播列表"
,
priority
=
8
)
public
void
获取已结束的直播
列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -124,23 +143,168 @@ public class LiveAgent implements AdminAuthorization {
}
//代理人直播排行榜;
// 获取个人榜;
@Test
(
description
=
"获取排行榜页面个人榜单"
,
priority
=
6
)
public
void
获取排行榜页面个人榜单
()
throws
IOException
{
/**
* 精彩视频
*/
@Test
(
description
=
"获取视频列表"
,
priority
=
9
)
public
void
获取视频列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"companyId"
,
"Kj20ODE1"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_VideoList
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoList
,
"获取代理人首页视频列表失败"
,
response
.
body
().
asString
()));
}
//获取代理人首页视频列表id、标题、观看人数
@Test
(
description
=
"获取代理人首页视频列表字段"
,
priority
=
10
)
public
void
获取代理人首页视频列表字段
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AgentPersonalCharts
);
params
.
put
(
"companyId"
,
"Kj20ODE1"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_VideoList
);
AgentVideo
list
=
JsonUtil
.
parseResponseToBean
(
response
,
AgentVideo
.
class
);
id
=
list
.
getList
().
get
(
0
).
getId
();
videoTitle
=
list
.
getList
().
get
(
0
).
getVideoTitle
();
watchNum
=
list
.
getList
().
get
(
0
).
getWatchNum
();
System
.
out
.
println
(
id
);
System
.
out
.
println
(
videoTitle
);
System
.
out
.
println
(
watchNum
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ChoiceGetList
,
"获取代理人首页视频列表字段失败"
,
response
.
body
().
asString
()));
}
//获取视频详情
@Test
(
description
=
"获取视频详情"
,
priority
=
11
)
public
void
获取视频详情
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
id
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_VideoGetDetail
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
shareNum
=
response
.
jsonPath
().
getString
(
"data.vo.shareNum"
);
likeNum
=
response
.
jsonPath
().
getString
(
"data.vo.likeNum"
);
System
.
out
.
println
(
success
);
System
.
out
.
println
(
shareNum
);
System
.
out
.
println
(
likeNum
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoGetDetail
,
"获取视频详情失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
shareNum
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoGetDetail
,
"获取视频详情分享数失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
likeNum
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoGetDetail
,
"获取视频详情点赞数失败"
,
response
.
body
().
asString
()));
}
//获取视频分享信息
@Test
(
description
=
"获取视频分享信息"
,
priority
=
12
)
public
void
获取视频分享信息
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
id
);
params
.
put
(
"companyId"
,
"Kj20ODE1"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_VideoShareInfo
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoShareInfo
,
"获取视频分享信息失败"
,
response
.
body
().
asString
()));
}
//获取视频转发是否成功
@Test
(
description
=
"获取视频转发是否成功"
,
priority
=
13
)
public
void
获取视频转发是否成功
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
id
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_VideoForward
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoForward
,
"视频转发失败"
,
response
.
body
().
asString
()));
}
//获取视频能否正常观看
@Test
(
description
=
"获取视频能否正常观看"
,
priority
=
14
)
public
void
获取视频能否正常观看
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
id
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_VideoWatch
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentPersonalCharts
,
"获取个人榜单失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoWatch
,
"视频播放失败"
,
response
.
body
().
asString
()));
}
//视频点赞
@Test
(
description
=
"获取视频能否正常点赞"
,
priority
=
15
)
public
void
获取视频能否正常点赞
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
id
);
params
.
put
(
"type"
,
"1"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_VideoLike
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoLike
,
"点赞失败"
,
response
.
body
().
asString
()));
}
//视频取消点赞
@Test
(
description
=
"获取视频能否取消点赞"
,
priority
=
16
)
public
void
获取视频能否取消点赞
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
id
);
params
.
put
(
"type"
,
"0"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_VideoLike
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoLike
,
"取消点赞失败"
,
response
.
body
().
asString
()));
}
/**
* 教程
*/
//获取代理人教程列表
@Test
(
description
=
"获取代理人教程列表"
,
priority
=
17
)
public
void
获取代理人教程列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_LiveGuideList
);
AgentVideo
list
=
JsonUtil
.
parseResponseToBean
(
response
,
AgentVideo
.
class
);
videoId
=
list
.
getList
().
get
(
0
).
getId
();
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_LiveGuideList
,
"获取代理人教程列表失败"
,
response
.
body
().
asString
()));
}
//获取教程列表单条数据
@Test
(
description
=
"获取教程列表单条数据"
,
priority
=
18
)
public
void
获取教程列表单条数据
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"videoId"
,
videoId
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_listDetail
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_listDetail
,
"获取教程列表单条数据失败"
,
response
.
body
().
asString
()));
}
//获取代理人自己的榜单信息;
@Test
(
description
=
"获取代理人自己的榜单信息"
,
priority
=
7
)
public
void
获取代理人自己的榜单信息
()
throws
IOException
{
/**
* 排行榜
*/
//个人榜单
public
String
invitationNum
;
@Test
(
description
=
"获取代理人自己的榜单信息"
,
priority
=
18
)
public
void
获取代理人自己的榜单信息
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AgentOwnCharts
);
...
...
@@ -152,9 +316,59 @@ public class LiveAgent implements AdminAuthorization {
}
// 获取团队榜;
@Test
(
description
=
"获取排行榜页面团队榜单"
,
priority
=
8
)
public
void
获取排行榜页面团队榜单
()
throws
IOException
{
@Test
(
description
=
"所有榜单的奖品列表"
,
priority
=
19
)
public
void
所有榜单的奖品列表
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_allRewardList
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_allRewardList
,
"所有榜单的奖品列表获取失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取排行榜页面个人榜单"
,
priority
=
20
)
public
void
获取排行榜页面个人榜单
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AgentPersonalCharts
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentPersonalCharts
,
"获取个人榜单失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人直播间公司统计"
,
priority
=
21
)
public
void
代理人直播间公司统计
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_companyTotalData
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_companyTotalData
,
"代理人直播间公司统计失败"
,
response
.
body
().
asString
()));
}
/**
* 团队榜
*/
@Test
(
description
=
"自己所在团队的榜单"
,
priority
=
22
)
public
void
自己所在团队的榜单
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ownTeamCharts
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ownTeamCharts
,
"自己所在团队的榜单获取失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取排行榜页面团队榜单"
,
priority
=
23
)
public
void
获取排行榜页面团队榜单
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
...
...
@@ -172,9 +386,22 @@ public class LiveAgent implements AdminAuthorization {
}
// 获取队内榜;
@Test
(
description
=
"获取排行榜页面队内榜单"
,
priority
=
9
)
public
void
获取排行榜页面队内榜单
()
throws
IOException
{
@Test
(
description
=
"获取队内榜"
,
priority
=
24
)
public
void
获取队内榜
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ownChartsInTeam
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ownChartsInTeam
,
"获取队内榜失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取个人队内榜单"
,
priority
=
25
)
public
void
获取个人队内榜单
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
20
);
...
...
@@ -190,22 +417,25 @@ public class LiveAgent implements AdminAuthorization {
}
}
/**
* 邀约
*/
// 获取代理人直播海报信息;
@Test
(
description
=
"获取代理人直播海报信息"
,
priority
=
10
)
public
void
获取代理人直播海报信息
()
throws
IOException
{
@Test
(
description
=
"获取代理人直播海报信息"
,
priority
=
26
)
public
void
获取代理人直播海报信息
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
MOBILE_GetAgentPoster
Info
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success
"
);
System
.
out
.
println
(
success
);
Assert
.
assert
True
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_GetAgentPosterInfo
,
"获取代理人直播海报信息失败"
,
response
.
body
().
asString
()));
Response
response
=
network
.
getResponse
(
params
,
MOBILE_GetAgentPoster
V2
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data
"
);
System
.
out
.
println
(
data
);
Assert
.
assert
NotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_GetAgentPosterV2
,
"获取代理人直播海报信息失败"
,
response
.
body
().
asString
()));
}
// 获取代理人各线索等级的线索数;
@Test
(
description
=
"获取线索等级的线索数"
,
priority
=
11
)
public
void
获取线索等级的线索数
()
throws
IOException
{
@Test
(
description
=
"获取线索等级的线索数"
,
priority
=
27
)
public
void
获取线索等级的线索数
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueNum
);
...
...
@@ -216,8 +446,9 @@ public class LiveAgent implements AdminAuthorization {
}
//获取代理人所有线索数量
@Test
(
description
=
"获取所有线索数量"
,
priority
=
12
)
public
void
获取所有线索数量
()
throws
IOException
{
public
String
allNum
;
@Test
(
description
=
"获取所有线索数量"
,
priority
=
28
)
public
void
获取所有线索数量
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueNum
);
...
...
@@ -228,8 +459,9 @@ public class LiveAgent implements AdminAuthorization {
}
//获取观看超过20分钟的人数
@Test
(
description
=
"获取观看超过20分钟的人数"
,
priority
=
13
)
public
void
获取观看超过
20
分钟的人数
()
throws
IOException
{
public
String
moreThan20MinNum
;
@Test
(
description
=
"获取观看超过20分钟的人数"
,
priority
=
29
)
public
void
获取观看超过
20
分钟的人数
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_ClueNum
);
...
...
@@ -239,8 +471,8 @@ public class LiveAgent implements AdminAuthorization {
}
// 获取直播中直播结束线索列表;
@Test
(
description
=
"获取线索列表"
,
priority
=
14
)
public
void
获取线索列表
()
throws
IOException
{
@Test
(
description
=
"获取线索列表"
,
priority
=
30
)
public
void
获取线索列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
2
);
...
...
@@ -261,8 +493,8 @@ public class LiveAgent implements AdminAuthorization {
//直播中我的客户页面
// 获取直播中我的客户页面全部tab;
@Test
(
description
=
"获取直播中我的客户页面全部tab数据"
,
priority
=
15
)
public
void
获取直播中我的客户页面全部
tab
数据
()
throws
IOException
{
@Test
(
description
=
"获取直播中我的客户页面全部tab数据"
,
priority
=
31
)
public
void
获取直播中我的客户页面全部
tab
数据
(){
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -274,8 +506,8 @@ public class LiveAgent implements AdminAuthorization {
}
// 获取直播中我的客户页面观看tab;
@Test
(
description
=
"获取直播中我的客户页面观看tab数据"
,
priority
=
16
)
public
void
获取直播中我的客户页面观看
tab
数据
()
throws
IOException
{
@Test
(
description
=
"获取直播中我的客户页面观看tab数据"
,
priority
=
32
)
public
void
获取直播中我的客户页面观看
tab
数据
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -288,8 +520,8 @@ public class LiveAgent implements AdminAuthorization {
}
// 获取直播中我的客户页面未观看tab;
@Test
(
description
=
"获取直播中我的客户页面未观看tab数据"
,
priority
=
17
)
public
void
获取直播中我的客户页面未观看
tab
数据
()
throws
IOException
{
@Test
(
description
=
"获取直播中我的客户页面未观看tab数据"
,
priority
=
33
)
public
void
获取直播中我的客户页面未观看
tab
数据
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -302,8 +534,8 @@ public class LiveAgent implements AdminAuthorization {
}
// 获取直播中我的客户页面中奖tab;
@Test
(
description
=
"获取直播中我的客户页面中奖tab数据"
,
priority
=
18
)
public
void
获取直播中我的客户页面中奖
tab
数据
()
throws
IOException
{
@Test
(
description
=
"获取直播中我的客户页面中奖tab数据"
,
priority
=
34
)
public
void
获取直播中我的客户页面中奖
tab
数据
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -316,8 +548,8 @@ public class LiveAgent implements AdminAuthorization {
}
// 获取直播中我的客户页面报名tab;
@Test
(
description
=
"获取直播中我的客户页面报名tab数据"
,
priority
=
19
)
public
void
获取直播中我的客户页面报名
tab
数据
()
throws
IOException
{
@Test
(
description
=
"获取直播中我的客户页面报名tab数据"
,
priority
=
35
)
public
void
获取直播中我的客户页面报名
tab
数据
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -333,253 +565,14 @@ public class LiveAgent implements AdminAuthorization {
//管理后台短视频管理
//查询获取视频列表
@Test
(
description
=
"获取视频列表"
,
priority
=
20
)
public
void
获取视频列表
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"companyId"
,
101
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoList
,
"获取视频列表失败"
,
response
.
body
().
asString
()));
}
//保存或更新视频
@Test
(
description
=
"保存或更新视频"
,
priority
=
21
)
public
void
保存或更新视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"companyId"
,
101
);
params
.
put
(
"videoUrl"
,
"//yun.dui88.com/kjy/media/file/20210414/b3fc43806a190d56ca4ba57a9a1fef8e.mp4"
);
params
.
put
(
"videoTitle"
,
"测试测试"
);
params
.
put
(
"videoTag"
,
""
);
params
.
put
(
"resourceId"
,
null
);
params
.
put
(
"videoRemark"
,
""
);
params
.
put
(
"videoFirstImg"
,
"//yun.dui88.com/kjy/image/20210414/1618384473776.jpg"
);
params
.
put
(
"shareImageUrl"
,
"//yun.dui88.com/kjy/image/20210414/1618384473776.jpg"
);
params
.
put
(
"id"
,
68
);
params
.
put
(
"videoScreen"
,
1
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_SaveOrUpdate
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_SaveOrUpdate
,
"保存或更新视频失败"
,
response
.
body
().
asString
()));
}
//置顶视频
@Test
(
description
=
"置顶视频"
,
priority
=
22
)
public
void
置顶视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
68
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoTop
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoTop
,
"置顶视频失败"
,
response
.
body
().
asString
()));
}
//取消置顶视频
@Test
(
description
=
"取消置顶视频"
,
priority
=
23
)
public
void
取消置顶视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
68
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoCancelTopt
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoCancelTopt
,
"取消置顶视频失败"
,
response
.
body
().
asString
()));
}
//上移视频
@Test
(
description
=
"上移视频"
,
priority
=
24
)
public
void
上移视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
68
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoUp
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoUp
,
"上移视频失败"
,
response
.
body
().
asString
()));
}
//下移视频
@Test
(
description
=
"下移视频"
,
priority
=
25
)
public
void
下移视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
68
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoDown
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoDown
,
"下移视频失败"
,
response
.
body
().
asString
()));
}
// //删除视频
// @Test(description="删除视频",priority = 26)
// public void 删除视频() {
// BaseUtils.ssoLogin();
// Map<String, Object> params = new HashMap<>();
// params.put("id",68);
// Response response = network.postResponse(params,BasicConfig.MANAGER_CompanyVideoDelete);
// boolean success = response.jsonPath().getBoolean("success");
// System.out.println(success);
// Assert.assertTrue(success, network.message(params, BasicConfig.MANAGER_CompanyVideoDelete, "删除视频失败", response.body().asString()));
//
// }
//视频列表
//获取代理人首页视频列表
@Test
(
description
=
"获取代理人首页视频列表"
,
priority
=
27
)
public
void
获取代理人首页视频列表
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"companyId"
,
"Kj20ODE1"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_VideoList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoList
,
"获取代理人首页视频列表失败"
,
response
.
body
().
asString
()));
}
//获取代理人首页视频列表id、标题、观看人数
@Test
(
description
=
"获取代理人首页视频列表字段"
,
priority
=
28
)
public
void
获取代理人首页视频列表字段
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageSize"
,
10
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"companyId"
,
"Kj20ODE1"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_VideoList
);
AgentVideo
list
=
JsonUtil
.
parseResponseToBean
(
response
,
AgentVideo
.
class
);
id
=
list
.
getList
().
get
(
0
).
getId
();
videoTitle
=
list
.
getList
().
get
(
0
).
getVideoTitle
();
watchNum
=
list
.
getList
().
get
(
0
).
getWatchNum
();
System
.
out
.
println
(
id
);
System
.
out
.
println
(
videoTitle
);
System
.
out
.
println
(
watchNum
);
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_ChoiceGetList
,
"获取代理人首页视频列表字段失败"
,
response
.
body
().
asString
()));
}
//获取视频详情
@Test
(
description
=
"获取视频详情"
,
priority
=
29
)
public
void
获取视频详情
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
"Kj20NTgz"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_VideoGetDetail
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
shareNum
=
response
.
jsonPath
().
getString
(
"data.vo.shareNum"
);
likeNum
=
response
.
jsonPath
().
getString
(
"data.vo.likeNum"
);
System
.
out
.
println
(
success
);
System
.
out
.
println
(
shareNum
);
System
.
out
.
println
(
likeNum
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoGetDetail
,
"获取视频详情失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
shareNum
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoGetDetail
,
"获取视频详情分享数失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
likeNum
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoGetDetail
,
"获取视频详情点赞数失败"
,
response
.
body
().
asString
()));
}
//获取视频分享信息
@Test
(
description
=
"获取视频分享信息"
,
priority
=
30
)
public
void
获取视频分享信息
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
"Kj20NTgz"
);
params
.
put
(
"companyId"
,
"Kj20ODE1"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_VideoShareInfo
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoShareInfo
,
"获取视频分享信息失败"
,
response
.
body
().
asString
()));
}
//获取视频转发是否成功
@Test
(
description
=
"获取视频转发是否成功"
,
priority
=
31
)
public
void
获取视频转发是否成功
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
"Kj20NTgz"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_VideoForward
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoForward
,
"视频转发失败"
,
response
.
body
().
asString
()));
}
//获取视频能否正常观看
@Test
(
description
=
"获取视频能否正常观看"
,
priority
=
32
)
public
void
获取视频能否正常观看
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
"Kj20NTgz"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_VideoWatch
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoWatch
,
"视频播放失败"
,
response
.
body
().
asString
()));
}
//视频点赞
@Test
(
description
=
"获取视频能否正常点赞"
,
priority
=
33
)
public
void
获取视频能否正常点赞
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
"Kj20NTgz"
);
params
.
put
(
"type"
,
"1"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_VideoLike
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoLike
,
"点赞失败"
,
response
.
body
().
asString
()));
}
//视频取消点赞
@Test
(
description
=
"获取视频能否取消点赞"
,
priority
=
34
)
public
void
获取视频能否取消点赞
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
"Kj20NTgz"
);
params
.
put
(
"type"
,
"0"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_VideoLike
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_VideoLike
,
"取消点赞失败"
,
response
.
body
().
asString
()));
}
}
//获取代理人教程列表
@Test
(
description
=
"获取代理人教程列表"
,
priority
=
36
)
public
void
获取代理人教程列表
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"pageIndex"
,
1
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_LiveGuideList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_LiveGuideList
,
"获取代理人教程列表失败"
,
response
.
body
().
asString
()));
}
//获取教程列表单条数据
@Test
(
description
=
"获取教程列表单条数据"
,
priority
=
37
)
public
void
获取教程列表单条数据
()
throws
IOException
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"id"
,
"Kj20NTgz"
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_LiveGuideList
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_LiveGuideList
,
"获取教程列表单条数据失败"
,
response
.
body
().
asString
()));
}
}
\ No newline at end of file
src/test/java/com/kjj/cases/live/agent/LiveLater.java
View file @
227640f7
...
...
@@ -19,19 +19,13 @@ public class LiveLater implements AdminAuthorization {
public
void
setUp
()
{
agentAuth
();
}
public
String
pageSize
;
public
String
invitationNum
;
public
String
allNum
;
public
String
moreThan20MinNum
;
public
String
sellerName
;
public
String
phoneNumber
;
public
String
jobNumber
;
public
String
teamName
;
//直播结束我的客户页面
// 获取直播结束我的客户页面全部tab;
@Test
(
description
=
"获取直播结束我的客户页面全部tab数据"
,
priority
=
1
)
public
void
获取直播结束我的客户页面全部
tab
数据
()
throws
IOException
{
public
void
获取直播结束我的客户页面全部
tab
数据
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -44,7 +38,7 @@ public class LiveLater implements AdminAuthorization {
// 获取直播结束我的客户页面直接邀请tab;
@Test
(
description
=
"获取直播结束我的客户页面直接邀请tab数据"
,
priority
=
2
)
public
void
获取直播结束我的客户页面直接邀请
tab
数据
()
throws
IOException
{
public
void
获取直播结束我的客户页面直接邀请
tab
数据
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -58,7 +52,7 @@ public class LiveLater implements AdminAuthorization {
// 获取直播结束我的客户页面转介绍tab;
@Test
(
description
=
"获取直播结束我的客户页面转介绍tab数据"
,
priority
=
3
)
public
void
获取直播结束我的客户页面转介绍
tab
数据
()
throws
IOException
{
public
void
获取直播结束我的客户页面转介绍
tab
数据
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -72,7 +66,7 @@ public class LiveLater implements AdminAuthorization {
// 获取直播结束我的客户页面中奖tab;
@Test
(
description
=
"获取直播结束我的客户页面中奖tab数据"
,
priority
=
4
)
public
void
获取直播结束我的客户页面中奖
tab
数据
()
throws
IOException
{
public
void
获取直播结束我的客户页面中奖
tab
数据
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -86,7 +80,7 @@ public class LiveLater implements AdminAuthorization {
// 获取直播结束我的客户页面报名tab;
@Test
(
description
=
"获取直播结束我的客户页面报名tab数据"
,
priority
=
5
)
public
void
获取直播结束我的客户页面报名
tab
数据
()
throws
IOException
{
public
void
获取直播结束我的客户页面报名
tab
数据
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -100,7 +94,7 @@ public class LiveLater implements AdminAuthorization {
// 获取直播结束我的客户页面观看20分钟+tab;
@Test
(
description
=
"获取直播结束我的客户页面观看20分钟+tab数据"
,
priority
=
6
)
public
void
获取直播结束我的客户页面观看
20
分钟以上
tab
数据
()
throws
IOException
{
public
void
获取直播结束我的客户页面观看
20
分钟以上
tab
数据
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
...
...
@@ -115,7 +109,7 @@ public class LiveLater implements AdminAuthorization {
//直播结束后中奖名单查询
// 获取直播结束中奖名单;
@Test
(
description
=
"获取直播结束中奖名单"
,
priority
=
7
)
public
void
获取直播结束中奖名单
()
throws
IOException
{
public
void
获取直播结束中奖名单
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"pageIndex"
,
1
);
...
...
src/test/java/com/kjj/cases/live/agent/Procurator.java
deleted
100644 → 0
View file @
769cf56c
package
com
.
kjj
.
cases
.
live
.
agent
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.agent.AgentBean
;
import
com.kjj.bean.agent.AgentCard
;
import
com.kjj.bean.agent.AgentEndList
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.utils.JsonUtil
;
import
io.restassured.response.Response
;
import
org.apache.commons.lang3.RandomUtils
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/*代理人端*/
public
class
Procurator
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
agentAuth
();
}
/*代理人首页直播列表*/
@Test
(
description
=
"代理人首页 "
,
priority
=
1
)
public
void
代理人直播列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_Procurator
);
List
<
AgentBean
>
agentBeans
=
JsonUtil
.
parseResponseToPageBean
(
response
,
AgentBean
.
class
);
if
(
agentBeans
.
size
()
>
0
)
{
AgentBean
bean
=
agentBeans
.
get
(
0
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
bean
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_Procurator
,
"查询直播列表失败"
,
response
.
body
().
asString
()));
}
}
/*代理人首页已结束的直播列表*/
@Test
(
description
=
"代理人首页已结束的直播列表"
,
priority
=
2
)
public
void
代理人直播结束列表
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AgentEndList
);
List
<
AgentEndList
>
agentBeans
=
JsonUtil
.
parseResponseToPageBean
(
response
,
AgentEndList
.
class
);
if
(
agentBeans
.
size
()
>
0
)
{
AgentEndList
bean
=
agentBeans
.
get
(
0
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
bean
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentEndList
,
"查询直播结束列表失败"
,
response
.
body
().
asString
()));
}
}
/*代理人信息*/
@Test
(
description
=
"代理人信息"
,
priority
=
3
)
public
void
代理人名片信息
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
);
AgentCard
agentBeans
=
JsonUtil
.
parseResponseToBean
(
response
,
AgentCard
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
agentBeans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentCardInfo
,
"查询代理人信息失败"
,
response
.
body
().
asString
()));
}
/*代理人信息*/
@Test
(
description
=
"代理人修改信息"
,
priority
=
4
)
public
void
编辑代理人信息
()
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sellerName"
,
"小智"
+
RandomUtils
.
nextInt
(
1
,
100
));
params
.
put
(
"phoneNumber"
,
"152588101691"
);
params
.
put
(
"jobNumber"
,
"技术"
);
params
.
put
(
"wechatQrCode"
,
"//yun.dui88.com/kjy/nc/qrcode1/1981ec88d22fe37041feac4724c627670817.png"
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_AgentEditCardInfo
);
Boolean
agentBeans
=
JsonUtil
.
parseResponseToBean
(
response
,
Boolean
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
agentBeans
));
Assert
.
assertNotNull
(
agentBeans
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_AgentEditCardInfo
,
"修改代理人信息失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
View file @
227640f7
...
...
@@ -27,7 +27,7 @@ public class SaveLive implements AdminAuthorization {
private
Integer
taskId
;
@BeforeClass
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
}
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
}
/**
* 创建直播
...
...
@@ -40,7 +40,7 @@ public class SaveLive implements AdminAuthorization {
Params
.
put
(
"welfareUrl"
,
"https://streamimg.kjjcrm.com/kjy/image/20210201/62c25dcb3b9b4d269a74894e4255a193.jpg"
);
Params
.
put
(
"coverUrl"
,
"https://streamimg.kjjcrm.com/kjy/image/20210201/d4093b24aaca49da8f0e3e276721feea.jpg"
);
Params
.
put
(
"mpShareUrl"
,
"https://streamimg.kjjcrm.com/kjy/image/20210201/182f3659e39b4ea6898af781cc6344a1.jpg"
);
Params
.
put
(
"title"
,
"直播测试"
+
RandomUtils
.
nextInt
(
1
,
100
));
Params
.
put
(
"title"
,
"直播测试"
+
RandomUtils
.
nextInt
(
1
,
100
));
Params
.
put
(
"mpShareTitle"
,
"自动化直播"
);
Params
.
put
(
"companyId"
,
101
);
Params
.
put
(
"agentInviteAuthType"
,
1
);
...
...
@@ -56,17 +56,17 @@ public class SaveLive implements AdminAuthorization {
Params
.
put
(
"distributionType"
,
0
);
Params
.
put
(
"existSeriesPoster"
,
0
);
List
<
ProvinceCityCodeList
>
provinceCityCode
=
new
ArrayList
<>();
ProvinceCityCodeList
save
=
new
ProvinceCityCodeList
();
ProvinceCityCodeList
save
=
new
ProvinceCityCodeList
();
save
.
setProvinceCode
(
110000
);
save
.
setCityCode
(
null
);
provinceCityCode
.
add
(
save
);
ProvinceCityCodeList
save1
=
new
ProvinceCityCodeList
();
ProvinceCityCodeList
save1
=
new
ProvinceCityCodeList
();
save1
.
setProvinceCode
(
420000
);
save1
.
setCityCode
(
420900
);
provinceCityCode
.
add
(
save1
);
ProvinceCityCodeList
save2
=
new
ProvinceCityCodeList
();
ProvinceCityCodeList
save2
=
new
ProvinceCityCodeList
();
save2
.
setProvinceCode
(
330000
);
save2
.
setCityCode
(
330100
);
provinceCityCode
.
add
(
save2
);
...
...
@@ -76,8 +76,8 @@ public class SaveLive implements AdminAuthorization {
liveID
=
response
.
jsonPath
().
getString
(
"data"
);
EncodeLiveID
=
IdMakeUtil
.
encodingId
(
Long
.
valueOf
(
liveID
));
System
.
out
.
println
(
liveID
);
LiveConstants
.
setValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
(),
liveID
);
LiveConstants
.
setValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
(),
EncodeLiveID
);
LiveConstants
.
setValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
(),
liveID
);
LiveConstants
.
setValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
(),
EncodeLiveID
);
Assert
.
assertNotNull
(
liveID
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_saveAndUpdate_0
,
"新增直播失败"
,
response
.
body
().
asString
()));
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
());
}
...
...
@@ -108,9 +108,10 @@ public class SaveLive implements AdminAuthorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_MaxAmount
,
"单场红包限额配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"展示红包金额"
,
priority
=
4
)
public
void
展示红包金额
()
{
//展示红包金额
//展示红包金额
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
liveID
);
Params
.
put
(
"showAmount"
,
100000
);
...
...
@@ -118,13 +119,13 @@ public class SaveLive implements AdminAuthorization {
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_ShowAmount
,
"展示红包配置失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"互动问题"
,
priority
=
7
)
public
void
互动问题
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
liveID
);
Params
.
put
(
"ids"
,
Arrays
.
asList
(
293
,
294
));
Params
.
put
(
"ids"
,
Arrays
.
asList
(
293
,
294
));
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_saveAndUpdate_1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
...
...
@@ -169,7 +170,7 @@ public class SaveLive implements AdminAuthorization {
@Test
(
description
=
"问卷"
,
priority
=
8
)
public
void
问卷
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"id"
,
null
);
Params
.
put
(
"id"
,
null
);
Params
.
put
(
"liveId"
,
liveID
);
Params
.
put
(
"surveyDesc"
,
"问卷调研"
);
Params
.
put
(
"surveyLink"
,
"https://kjj.m.duibatest.com.cn/live/pages/survey/index?id=41"
);
...
...
@@ -231,6 +232,7 @@ public class SaveLive implements AdminAuthorization {
}
@Test
(
description
=
"查询抽奖奖品列表"
,
priority
=
10
)
public
void
查询抽奖奖品列表
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
...
...
@@ -239,7 +241,7 @@ public class SaveLive implements AdminAuthorization {
List
data
=
response
.
jsonPath
().
getList
(
"data"
);
Map
resultMap
=
(
Map
)
data
.
get
(
0
);
System
.
out
.
println
(
resultMap
.
get
(
"welfareConfId"
));
welfareConfId
=
Long
.
parseLong
(
resultMap
.
get
(
"welfareConfId"
).
toString
());
welfareConfId
=
Long
.
parseLong
(
resultMap
.
get
(
"welfareConfId"
).
toString
());
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_getLiveAwardList
,
"查询奖品列表失败"
,
response
.
body
().
asString
()));
}
...
...
@@ -254,7 +256,7 @@ public class SaveLive implements AdminAuthorization {
Params
.
put
(
"maxCanSpecifyCount"
,
0
);
Params
.
put
(
"privilegeScope"
,
1
);
Params
.
put
(
"inviteCount"
,
1
);
Params
.
put
(
"welfareConfId"
,
welfareConfId
);
Params
.
put
(
"welfareConfId"
,
welfareConfId
);
System
.
out
.
println
(
"Params"
+
JSON
.
toJSONString
(
Params
));
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_saveSpecifyAward
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
...
@@ -386,11 +388,11 @@ public class SaveLive implements AdminAuthorization {
Map
<
String
,
Object
>
resultParam
=
new
HashMap
<>();
resultParam
.
put
(
"taskId"
,
taskId
);
Response
response
=
null
;
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
response
=
network
.
getResponse
(
resultParam
,
BasicConfig
.
MANAGER_result
);
boolean
hasFinish
=
response
.
jsonPath
().
getBoolean
(
"data.hasFinish"
);
boolean
hasFinish
=
response
.
jsonPath
().
getBoolean
(
"data.hasFinish"
);
System
.
out
.
println
(
hasFinish
);
if
(
hasFinish
)
return
;
if
(
hasFinish
)
return
;
Thread
.
sleep
(
500
);
}
Assert
.
fail
(
network
.
message
(
resultParam
,
BasicConfig
.
MANAGER_result
,
"获取导入任务结果失败"
,
response
.
body
().
asString
()));
...
...
@@ -422,7 +424,7 @@ public class SaveLive implements AdminAuthorization {
getListParam
.
put
(
"pageSize"
,
20
);
getListParam
.
put
(
"welfareType"
,
6
);
Response
response
=
network
.
getResponse
(
getListParam
,
BasicConfig
.
MANAGER_getList4Admin
);
List
<
WelfareList
>
list
=
JsonUtil
.
parseResponseToPageBean
(
response
,
WelfareList
.
class
);
List
<
WelfareList
>
list
=
JsonUtil
.
parseResponseToPageBean
(
response
,
WelfareList
.
class
);
System
.
out
.
println
(
list
);
this
.
id
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
getListParam
,
BasicConfig
.
MANAGER_getList4Admin
,
"查询奖品列表失败"
,
response
.
body
().
asString
()));
...
...
@@ -434,9 +436,9 @@ public class SaveLive implements AdminAuthorization {
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
saveParam
.
put
(
"openCondition"
,
1
);
saveParam
.
put
(
"openNum"
,
10
);
saveParam
.
put
(
"openNum"
,
10
);
TreasureAward
treasureAward
=
new
TreasureAward
();
TreasureAward
treasureAward
=
new
TreasureAward
();
treasureAward
.
setWelfareId
(
this
.
id
.
get
(
0
).
getId
());
treasureAward
.
setAwardName
(
"宝箱锦鲤"
);
treasureAward
.
setTreasureProbability
(
10000
);
...
...
@@ -444,9 +446,9 @@ public class SaveLive implements AdminAuthorization {
treasureAward
.
setRuleType
(
1
);
treasureAward
.
setTotalNum
(
3
);
treasureAward
.
setWinLimitCount
(
1
);
saveParam
.
put
(
"treasureAward"
,
treasureAward
);
saveParam
.
put
(
"treasureAward"
,
treasureAward
);
TreasureRed
treasureRed
=
new
TreasureRed
();
TreasureRed
treasureRed
=
new
TreasureRed
();
treasureRed
.
setRedTotalAmount
(
100
);
treasureRed
.
setRuleType
(
2
);
treasureRed
.
setTotalNum
(
2
);
...
...
@@ -454,16 +456,16 @@ public class SaveLive implements AdminAuthorization {
treasureRed
.
setTreasureType
(
2
);
treasureRed
.
setWinLimitCount
(
1
);
treasureRed
.
setShowAmount
(
200
);
saveParam
.
put
(
"treasureRed"
,
treasureRed
);
saveParam
.
put
(
"treasureRed"
,
treasureRed
);
TreasureCode
treasureCode
=
new
TreasureCode
();
TreasureCode
treasureCode
=
new
TreasureCode
();
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setMaxNum
(
3
);
treasureCode
.
setRuleType
(
2
);
treasureCode
.
setTreasureProbability
(
0
);
treasureCode
.
setTreasureType
(
1
);
saveParam
.
put
(
"treasureCode"
,
treasureCode
);
saveParam
.
put
(
"treasurePeriod"
,
3
);
saveParam
.
put
(
"treasureCode"
,
treasureCode
);
saveParam
.
put
(
"treasurePeriod"
,
3
);
Response
response
=
network
.
postResponse
(
saveParam
,
BasicConfig
.
MANAGER_saveTreasureConf
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
...
...
@@ -478,9 +480,9 @@ public class SaveLive implements AdminAuthorization {
confDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
confDetailParam
,
BasicConfig
.
MANAGER_confDetail
);
System
.
out
.
println
(
response
);
Integer
openCondition
=
response
.
jsonPath
().
getInt
(
"data.openCondition"
);
Integer
openCondition
=
response
.
jsonPath
().
getInt
(
"data.openCondition"
);
System
.
out
.
println
(
openCondition
);
Assert
.
assertTrue
(
openCondition
>
0
,
network
.
message
(
confDetailParam
,
BasicConfig
.
MANAGER_confDetail
,
"查询宝箱配置详情失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
openCondition
>
0
,
network
.
message
(
confDetailParam
,
BasicConfig
.
MANAGER_confDetail
,
"查询宝箱配置详情失败"
,
response
.
body
().
asString
()));
treasureConf
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
response
.
jsonPath
().
get
(
"data"
)));
}
...
...
@@ -491,47 +493,47 @@ public class SaveLive implements AdminAuthorization {
switchStatusParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
switchStatusParam
.
put
(
"confStatus"
,
1
);
Response
response
=
network
.
postResponse
(
switchStatusParam
,
BasicConfig
.
MANAGER_switchStatus
);
boolean
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
switchStatusParam
,
BasicConfig
.
MANAGER_switchStatus
,
"开启宝箱失败"
,
response
.
body
().
asString
()));
}
/**
* 时长宝箱配置
*/
/**
* 时长宝箱配置
*/
public
List
<
TreasureList
>
ConfId
;
public
List
<
TreasureList
>
ConfId
;
@Test
(
description
=
"获取直播中停留时长宝箱列表"
,
priority
=
24
)
public
void
获取直播中停留时长宝箱列表
()
{
Map
<
String
,
Object
>
getListParam
=
new
HashMap
<>();
getListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
getListParam
,
BasicConfig
.
MANAGER_list1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
TreasureList
>
list
=
JsonUtil
.
parseResponseToListBean
(
response
,
TreasureList
.
class
);
System
.
out
.
println
(
list
);
this
.
ConfId
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
getListParam
,
BasicConfig
.
MANAGER_list1
,
"获取直播中停留时长宝箱列表失败"
,
response
.
body
().
asString
()));
@Test
(
description
=
"获取直播中停留时长宝箱列表"
,
priority
=
24
)
public
void
获取直播中停留时长宝箱列表
()
{
Map
<
String
,
Object
>
getListParam
=
new
HashMap
<>();
getListParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
getListParam
,
BasicConfig
.
MANAGER_list1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
TreasureList
>
list
=
JsonUtil
.
parseResponseToListBean
(
response
,
TreasureList
.
class
);
System
.
out
.
println
(
list
);
this
.
ConfId
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
getListParam
,
BasicConfig
.
MANAGER_list1
,
"获取直播中停留时长宝箱列表失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"停留时长1分钟固定抽奖码"
,
priority
=
25
)
public
void
停留时长
1
分钟固定抽奖码
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
0
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
1
);
updateParam
.
put
(
"openCondition"
,
1
);
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
0
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
1
);
updateParam
.
put
(
"openCondition"
,
1
);
TreasureCode
treasureCode
=
new
TreasureCode
();
TreasureCode
treasureCode
=
new
TreasureCode
();
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setMaxNum
(
0
);
treasureCode
.
setRuleType
(
1
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"停留时长1分钟固定抽奖码"
,
response
.
body
().
asString
()));
...
...
@@ -541,9 +543,9 @@ public void 获取直播中停留时长宝箱列表() {
@Test
(
description
=
"获取第1轮宝箱配置详情"
,
priority
=
26
)
public
void
获取第
1
轮宝箱配置详情
()
{
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
0
).
getTreasureConfId
());
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
0
).
getTreasureConfId
());
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MANAGER_detail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MANAGER_detail1
,
"获取第1轮宝箱配置详情失败"
,
response
.
body
().
asString
()));
...
...
@@ -553,25 +555,25 @@ public void 获取直播中停留时长宝箱列表() {
@Test
(
description
=
"停留时长2分钟现金红包"
,
priority
=
27
)
public
void
停留时长
2
分钟现金红包
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
1
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
2
);
updateParam
.
put
(
"openCondition"
,
2
);
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
1
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
2
);
updateParam
.
put
(
"openCondition"
,
2
);
TreasureCode
treasureCode
=
new
TreasureCode
();
TreasureCode
treasureCode
=
new
TreasureCode
();
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setMaxNum
(
3
);
treasureCode
.
setRuleType
(
2
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
TreasureRed
treasureRed
=
new
TreasureRed
();
TreasureRed
treasureRed
=
new
TreasureRed
();
treasureRed
.
setRedTotalAmount
(
100
);
treasureRed
.
setRuleType
(
1
);
treasureRed
.
setTotalNum
(
1
);
treasureRed
.
setFixedNum
(
30
);
updateParam
.
put
(
"treasureRed"
,
treasureRed
);
updateParam
.
put
(
"treasureRed"
,
treasureRed
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"停留时长2分钟现金红包配置失败"
,
response
.
body
().
asString
()));
...
...
@@ -581,9 +583,9 @@ public void 获取直播中停留时长宝箱列表() {
@Test
(
description
=
"获取第2轮宝箱配置详情"
,
priority
=
28
)
public
void
获取第
2
轮宝箱配置详情
()
{
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
1
).
getTreasureConfId
());
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
1
).
getTreasureConfId
());
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MANAGER_detail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MANAGER_detail1
,
"获取第2轮宝箱配置详情失败"
,
response
.
body
().
asString
()));
...
...
@@ -598,7 +600,7 @@ public void 获取直播中停留时长宝箱列表() {
getListParam
.
put
(
"pageSize"
,
20
);
getListParam
.
put
(
"welfareType"
,
6
);
Response
response
=
network
.
getResponse
(
getListParam
,
BasicConfig
.
MANAGER_getList4Admin
);
List
<
WelfareList
>
list
=
JsonUtil
.
parseResponseToPageBean
(
response
,
WelfareList
.
class
);
List
<
WelfareList
>
list
=
JsonUtil
.
parseResponseToPageBean
(
response
,
WelfareList
.
class
);
System
.
out
.
println
(
list
);
this
.
id
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
getListParam
,
BasicConfig
.
MANAGER_getList4Admin
,
"查询奖品列表失败"
,
response
.
body
().
asString
()));
...
...
@@ -608,26 +610,26 @@ public void 获取直播中停留时长宝箱列表() {
@Test
(
description
=
"停留时长3分钟实物奖品"
,
priority
=
30
)
public
void
停留时长
3
分钟实物奖品
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
2
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
3
);
updateParam
.
put
(
"openCondition"
,
3
);
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
2
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
3
);
updateParam
.
put
(
"openCondition"
,
3
);
TreasureCode
treasureCode
=
new
TreasureCode
();
TreasureCode
treasureCode
=
new
TreasureCode
();
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setMaxNum
(
6
);
treasureCode
.
setRuleType
(
1
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
TreasureAward
treasureAward
=
new
TreasureAward
();
TreasureAward
treasureAward
=
new
TreasureAward
();
treasureAward
.
setAwardName
(
"萌娃锦鲤"
);
treasureAward
.
setBizConfId
(
0
);
treasureAward
.
setIsLimit
(
2
);
treasureAward
.
setTotalNum
(
1
);
treasureAward
.
setWelfareId
(
this
.
id
.
get
(
5
).
getId
());
updateParam
.
put
(
"treasureAward"
,
treasureAward
);
updateParam
.
put
(
"treasureAward"
,
treasureAward
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"第3轮宝箱时长配置失败"
,
response
.
body
().
asString
()));
...
...
@@ -637,9 +639,9 @@ public void 获取直播中停留时长宝箱列表() {
@Test
(
description
=
"获取第3轮宝箱配置详情"
,
priority
=
31
)
public
void
获取第三轮宝箱配置详情
()
{
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
2
).
getTreasureConfId
());
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
2
).
getTreasureConfId
());
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MANAGER_detail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MANAGER_detail1
,
"获取第三轮宝箱配置详情失败"
,
response
.
body
().
asString
()));
...
...
@@ -648,9 +650,9 @@ public void 获取直播中停留时长宝箱列表() {
@Test
(
description
=
"上传团队配置文件"
,
priority
=
32
)
public
void
上传团队配置文件
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"bizId"
,
this
.
ConfId
.
get
(
3
).
getTreasureConfId
());
Params
.
put
(
"excelUrl"
,
"https://yun.dui88.com/kjy/media/file/20210610/6477aa64d87cd228ec658127745bc641.xlsx"
);
Params
.
put
(
"fileName"
,
"团队奖励配置模版1.xlsx"
);
Params
.
put
(
"bizId"
,
this
.
ConfId
.
get
(
3
).
getTreasureConfId
());
Params
.
put
(
"excelUrl"
,
"https://yun.dui88.com/kjy/media/file/20210610/6477aa64d87cd228ec658127745bc641.xlsx"
);
Params
.
put
(
"fileName"
,
"团队奖励配置模版1.xlsx"
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_teamImport
);
taskId
=
response
.
jsonPath
().
getInt
(
"data"
);
System
.
out
.
println
(
taskId
);
...
...
@@ -663,37 +665,36 @@ public void 获取直播中停留时长宝箱列表() {
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"taskId"
,
taskId
);
Response
response
=
null
;
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_result
);
boolean
hasFinish
=
response
.
jsonPath
().
getBoolean
(
"data.hasFinish"
);
boolean
hasFinish
=
response
.
jsonPath
().
getBoolean
(
"data.hasFinish"
);
System
.
out
.
println
(
hasFinish
);
if
(
hasFinish
)
return
;
if
(
hasFinish
)
return
;
Thread
.
sleep
(
500
);
}
Assert
.
fail
(
network
.
message
(
Params
,
BasicConfig
.
MANAGER_result
,
"获取导入任务结果失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"停留时长4分钟随机抽奖码"
,
priority
=
34
)
public
void
停留时长
4
分钟随机抽奖码
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
3
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
4
);
updateParam
.
put
(
"openCondition"
,
4
);
updateParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
3
).
getTreasureConfId
());
updateParam
.
put
(
"boxConfType"
,
4
);
updateParam
.
put
(
"openCondition"
,
4
);
TreasureCode
treasureCode
=
new
TreasureCode
();
TreasureCode
treasureCode
=
new
TreasureCode
();
treasureCode
.
setFixedNum
(
1
);
treasureCode
.
setMaxNum
(
6
);
treasureCode
.
setRuleType
(
2
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
updateParam
.
put
(
"treasureCode"
,
treasureCode
);
TreasureList
treasureTeam
=
new
TreasureList
();
treasureTeam
.
setReceiveNum
(
null
);
treasureTeam
.
setReceiveNum
(
null
);
treasureTeam
.
setTotalNum
(
null
);
updateParam
.
put
(
"treasureTeam"
,
treasureTeam
);
updateParam
.
put
(
"treasureTeam"
,
treasureTeam
);
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_update1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_update1
,
"第四轮宝箱时长配置失败"
,
response
.
body
().
asString
()));
...
...
@@ -703,9 +704,9 @@ public void 获取直播中停留时长宝箱列表() {
@Test
(
description
=
"获取第4轮宝箱配置详情"
,
priority
=
35
)
public
void
获取第四轮宝箱配置详情
()
{
Map
<
String
,
Object
>
detailParam
=
new
HashMap
<>();
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
3
).
getTreasureConfId
());
detailParam
.
put
(
"treasureConfId"
,
this
.
ConfId
.
get
(
3
).
getTreasureConfId
());
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MANAGER_detail1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MANAGER_detail1
,
"获取第四轮宝箱配置详情失败"
,
response
.
body
().
asString
()));
...
...
@@ -725,9 +726,9 @@ public void 获取直播中停留时长宝箱列表() {
Map
<
String
,
Object
>
AmountParam
=
new
HashMap
<>();
AmountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
AmountParam
,
BasicConfig
.
MANAGER_getSurplusAmount
);
Integer
data
=
response
.
jsonPath
().
getInt
(
"data"
);
Integer
data
=
response
.
jsonPath
().
getInt
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
>
0
,
network
.
message
(
AmountParam
,
BasicConfig
.
MANAGER_getSurplusAmount
,
"查询剩余可配金额失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
>
0
,
network
.
message
(
AmountParam
,
BasicConfig
.
MANAGER_getSurplusAmount
,
"查询剩余可配金额失败"
,
response
.
body
().
asString
()));
}
...
...
@@ -735,49 +736,48 @@ public void 获取直播中停留时长宝箱列表() {
public
void
新增猜数字红包
()
{
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
saveParam
.
put
(
"redAmount"
,
66
);
saveParam
.
put
(
"redRealNum"
,
1
);
saveParam
.
put
(
"redShowNum"
,
1
);
saveParam
.
put
(
"guessMinNum"
,
1
);
saveParam
.
put
(
"guessMaxNum"
,
10
);
saveParam
.
put
(
"guessLeastTime"
,
4
);
saveParam
.
put
(
"sendType"
,
1
);
saveParam
.
put
(
"redAmount"
,
66
);
saveParam
.
put
(
"redRealNum"
,
1
);
saveParam
.
put
(
"redShowNum"
,
1
);
saveParam
.
put
(
"guessMinNum"
,
1
);
saveParam
.
put
(
"guessMaxNum"
,
10
);
saveParam
.
put
(
"guessLeastTime"
,
4
);
saveParam
.
put
(
"sendType"
,
1
);
Response
response
=
network
.
postResponse
(
saveParam
,
BasicConfig
.
MANAGER_saveOrUpdate1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
saveParam
,
BasicConfig
.
MANAGER_saveOrUpdate1
,
"新增猜数字红包失败"
,
response
.
body
().
asString
()));
Map
<
String
,
Object
>
saveGuessParam
=
new
HashMap
<>();
saveGuessParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
saveGuessParam
.
put
(
"redAmount"
,
88
);
saveGuessParam
.
put
(
"redRealNum"
,
1
);
saveGuessParam
.
put
(
"redShowNum"
,
1
);
saveGuessParam
.
put
(
"guessMinNum"
,
1
);
saveGuessParam
.
put
(
"guessMaxNum"
,
10
);
saveGuessParam
.
put
(
"guessLeastTime"
,
4
);
saveGuessParam
.
put
(
"sendType"
,
1
);
saveGuessParam
.
put
(
"redAmount"
,
88
);
saveGuessParam
.
put
(
"redRealNum"
,
1
);
saveGuessParam
.
put
(
"redShowNum"
,
1
);
saveGuessParam
.
put
(
"guessMinNum"
,
1
);
saveGuessParam
.
put
(
"guessMaxNum"
,
10
);
saveGuessParam
.
put
(
"guessLeastTime"
,
4
);
saveGuessParam
.
put
(
"sendType"
,
1
);
Response
guessRes
=
network
.
postResponse
(
saveGuessParam
,
BasicConfig
.
MANAGER_saveOrUpdate1
);
boolean
data1
=
guessRes
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data1
=
guessRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
saveGuessParam
,
BasicConfig
.
MANAGER_saveOrUpdate1
,
"新增猜数字红包失败"
,
guessRes
.
body
().
asString
()));
//瓜分金额
Map
<
String
,
Object
>
sumAmountParam
=
new
HashMap
<>();
sumAmountParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
sumAmountParam
.
put
(
"redAmount"
,
88
);
sumAmountParam
.
put
(
"redRealNum"
,
1
);
sumAmountParam
.
put
(
"redShowNum"
,
1
);
sumAmountParam
.
put
(
"guessMinNum"
,
1
);
sumAmountParam
.
put
(
"guessMaxNum"
,
10
);
sumAmountParam
.
put
(
"guessLeastTime"
,
4
);
sumAmountParam
.
put
(
"sendType"
,
1
);
sumAmountParam
.
put
(
"redAmount"
,
88
);
sumAmountParam
.
put
(
"redRealNum"
,
1
);
sumAmountParam
.
put
(
"redShowNum"
,
1
);
sumAmountParam
.
put
(
"guessMinNum"
,
1
);
sumAmountParam
.
put
(
"guessMaxNum"
,
10
);
sumAmountParam
.
put
(
"guessLeastTime"
,
4
);
sumAmountParam
.
put
(
"sendType"
,
1
);
Response
sumAmountRes
=
network
.
postResponse
(
sumAmountParam
,
BasicConfig
.
MANAGER_saveOrUpdate1
);
boolean
data2
=
sumAmountRes
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data2
=
sumAmountRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data2
);
Assert
.
assertTrue
(
data2
,
network
.
message
(
sumAmountParam
,
BasicConfig
.
MANAGER_saveOrUpdate1
,
"新增猜数字红包失败"
,
sumAmountRes
.
body
().
asString
()));
}
@Test
(
description
=
"查询猜数字红包列表"
,
priority
=
38
)
...
...
@@ -785,9 +785,9 @@ public void 获取直播中停留时长宝箱列表() {
Map
<
String
,
Object
>
listParam
=
new
HashMap
<>();
listParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
listParam
,
BasicConfig
.
MANAGER_list_1
);
List
<
GuessList
>
list
=
JsonUtil
.
parseResponseToListBean
(
response
,
GuessList
.
class
);
List
<
GuessList
>
list
=
JsonUtil
.
parseResponseToListBean
(
response
,
GuessList
.
class
);
System
.
out
.
println
(
list
);
this
.
confId
=
list
;
this
.
confId
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
listParam
,
BasicConfig
.
MANAGER_list_1
,
"查询猜数字红包列表失败"
,
response
.
body
().
asString
()));
}
...
...
@@ -798,7 +798,7 @@ public void 获取直播中停留时长宝箱列表() {
detailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
detailParam
.
put
(
"confId"
,
this
.
confId
.
get
(
0
).
getConfId
());
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MANAGER_detail_1
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MANAGER_detail_1
,
"查询猜数字红包详情页失败"
,
response
.
body
().
asString
()));
...
...
@@ -808,16 +808,16 @@ public void 获取直播中停留时长宝箱列表() {
public
void
编辑猜数字红包
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
updateParam
.
put
(
"redAmount"
,
88
);
updateParam
.
put
(
"redRealNum"
,
1
);
updateParam
.
put
(
"redShowNum"
,
1
);
updateParam
.
put
(
"guessMinNum"
,
1
);
updateParam
.
put
(
"guessMaxNum"
,
10
);
updateParam
.
put
(
"guessLeastTime"
,
4
);
updateParam
.
put
(
"sendType"
,
1
);
updateParam
.
put
(
"redAmount"
,
88
);
updateParam
.
put
(
"redRealNum"
,
1
);
updateParam
.
put
(
"redShowNum"
,
1
);
updateParam
.
put
(
"guessMinNum"
,
1
);
updateParam
.
put
(
"guessMaxNum"
,
10
);
updateParam
.
put
(
"guessLeastTime"
,
4
);
updateParam
.
put
(
"sendType"
,
1
);
updateParam
.
put
(
"confId"
,
this
.
confId
.
get
(
2
).
getConfId
());
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MANAGER_saveOrUpdate1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MANAGER_saveOrUpdate1
,
"新增猜数字红包失败"
,
response
.
body
().
asString
()));
...
...
@@ -830,7 +830,7 @@ public void 获取直播中停留时长宝箱列表() {
delParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
delParam
.
put
(
"confId"
,
this
.
confId
.
get
(
2
).
getConfId
());
Response
response
=
network
.
postResponse
(
delParam
,
BasicConfig
.
MANAGER_del_1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
delParam
,
BasicConfig
.
MANAGER_del_1
,
"删除猜数字红包失败"
,
response
.
body
().
asString
()));
...
...
@@ -843,14 +843,14 @@ public void 获取直播中停留时长宝箱列表() {
ThreadSleepUtils
.
sleep
(
1000
);
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
saveParam
.
put
(
"redAmount"
,
88
);
saveParam
.
put
(
"redRealNum"
,
1
);
saveParam
.
put
(
"redShowNum"
,
1
);
saveParam
.
put
(
"guessMinNum"
,
1
);
saveParam
.
put
(
"guessMaxNum"
,
10
);
saveParam
.
put
(
"guessLeastTime"
,
4
);
saveParam
.
put
(
"redAmount"
,
88
);
saveParam
.
put
(
"redRealNum"
,
1
);
saveParam
.
put
(
"redShowNum"
,
1
);
saveParam
.
put
(
"guessMinNum"
,
1
);
saveParam
.
put
(
"guessMaxNum"
,
10
);
saveParam
.
put
(
"guessLeastTime"
,
4
);
Response
response
=
network
.
postResponse
(
saveParam
,
BasicConfig
.
MOBILE_saveOrUpdate
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
saveParam
,
BasicConfig
.
MOBILE_saveOrUpdate
,
"助播直播前新增猜数字红包失败"
,
response
.
body
().
asString
()));
...
...
@@ -863,7 +863,7 @@ public void 获取直播中停留时长宝箱列表() {
Map
<
String
,
Object
>
listParam
=
new
HashMap
<>();
listParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
listParam
,
BasicConfig
.
MOBILE_findDetail
);
boolean
hasGuessRed
=
response
.
jsonPath
().
getBoolean
(
"data.hasGuessRed"
);
boolean
hasGuessRed
=
response
.
jsonPath
().
getBoolean
(
"data.hasGuessRed"
);
System
.
out
.
println
(
hasGuessRed
);
Assert
.
assertTrue
(
hasGuessRed
,
network
.
message
(
listParam
,
BasicConfig
.
MOBILE_findDetail
,
"助播端查询直播红包配置失败"
,
response
.
body
().
asString
()));
...
...
@@ -876,9 +876,9 @@ public void 获取直播中停留时长宝箱列表() {
Map
<
String
,
Object
>
listParam
=
new
HashMap
<>();
listParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
listParam
,
BasicConfig
.
MOBILE_list
);
List
<
GuessList
>
list
=
JsonUtil
.
parseResponseToListBean
(
response
,
GuessList
.
class
,
"guessList"
);
List
<
GuessList
>
list
=
JsonUtil
.
parseResponseToListBean
(
response
,
GuessList
.
class
,
"guessList"
);
System
.
out
.
println
(
list
);
this
.
confId
=
list
;
this
.
confId
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
listParam
,
BasicConfig
.
MOBILE_list
,
"助播直播前猜数字红包列表查询失败"
,
response
.
body
().
asString
()));
}
...
...
@@ -890,7 +890,7 @@ public void 获取直播中停留时长宝箱列表() {
detailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
detailParam
.
put
(
"confId"
,
this
.
confId
.
get
(
0
).
getConfId
());
Response
response
=
network
.
getResponse
(
detailParam
,
BasicConfig
.
MOBILE_detail
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
detailParam
,
BasicConfig
.
MOBILE_detail
,
"助播直播前猜数字红包详情页查询失败"
,
response
.
body
().
asString
()));
...
...
@@ -902,15 +902,15 @@ public void 获取直播中停留时长宝箱列表() {
adminAuth
();
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
updateParam
.
put
(
"redAmount"
,
99
);
updateParam
.
put
(
"redRealNum"
,
1
);
updateParam
.
put
(
"redShowNum"
,
10
);
updateParam
.
put
(
"guessMinNum"
,
1
);
updateParam
.
put
(
"guessMaxNum"
,
10
);
updateParam
.
put
(
"guessLeastTime"
,
4
);
updateParam
.
put
(
"redAmount"
,
99
);
updateParam
.
put
(
"redRealNum"
,
1
);
updateParam
.
put
(
"redShowNum"
,
10
);
updateParam
.
put
(
"guessMinNum"
,
1
);
updateParam
.
put
(
"guessMaxNum"
,
10
);
updateParam
.
put
(
"guessLeastTime"
,
4
);
updateParam
.
put
(
"confId"
,
this
.
confId
.
get
(
0
).
getConfId
());
Response
response
=
network
.
postResponse
(
updateParam
,
BasicConfig
.
MOBILE_saveOrUpdate
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
updateParam
,
BasicConfig
.
MOBILE_saveOrUpdate
,
"直播前编辑猜数字红包失败"
,
response
.
body
().
asString
()));
...
...
@@ -924,7 +924,7 @@ public void 获取直播中停留时长宝箱列表() {
delParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
delParam
.
put
(
"confId"
,
this
.
confId
.
get
(
0
).
getConfId
());
Response
response
=
network
.
postResponse
(
delParam
,
BasicConfig
.
MOBILE_delete
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
delParam
,
BasicConfig
.
MOBILE_delete
,
"直播前删除猜数字红包失败"
,
response
.
body
().
asString
()));
...
...
@@ -936,27 +936,28 @@ public void 获取直播中停留时长宝箱列表() {
public
List
<
ConfIdList
>
confIdList
;
@Test
(
description
=
"添加定时投票"
,
priority
=
48
)
public
void
添加定时投票
(){
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"minutes"
,
0
);
Params
.
put
(
"seconds"
,
15
);
Params
.
put
(
"questionId"
,
781
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_saveTimedChoice
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
@Test
(
description
=
"添加定时投票"
,
priority
=
48
)
public
void
添加定时投票
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"minutes"
,
0
);
Params
.
put
(
"seconds"
,
15
);
Params
.
put
(
"questionId"
,
781
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_saveTimedChoice
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_saveTimedChoice
,
"定时投票添加失败"
,
response
.
body
().
asString
()));
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
saveParam
.
put
(
"minutes"
,
1
);
saveParam
.
put
(
"seconds"
,
15
);
saveParam
.
put
(
"questionId"
,
782
);
Response
saveRes
=
network
.
postResponse
(
saveParam
,
BasicConfig
.
MANAGER_saveTimedChoice
);
boolean
data1
=
saveRes
.
jsonPath
().
getBoolean
(
"data"
);
Map
<
String
,
Object
>
saveParam
=
new
HashMap
<>();
saveParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
saveParam
.
put
(
"minutes"
,
1
);
saveParam
.
put
(
"seconds"
,
15
);
saveParam
.
put
(
"questionId"
,
782
);
Response
saveRes
=
network
.
postResponse
(
saveParam
,
BasicConfig
.
MANAGER_saveTimedChoice
);
boolean
data1
=
saveRes
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
saveParam
,
BasicConfig
.
MANAGER_saveTimedChoice
,
"定时投票添加失败"
,
saveRes
.
body
().
asString
()));
...
...
@@ -964,54 +965,54 @@ public void 获取直播中停留时长宝箱列表() {
}
@Test
(
description
=
"查询定时推送投票列表"
,
priority
=
49
)
public
void
定时推送投票列表
(){
@Test
(
description
=
"查询定时推送投票列表"
,
priority
=
49
)
public
void
定时推送投票列表
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"pageIndex"
,
1
);
Params
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_timedChoice
);
confIdList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
response
.
jsonPath
().
getList
(
"data"
)),
ConfIdList
.
class
);
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"pageIndex"
,
1
);
Params
.
put
(
"pageSize"
,
20
);
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_timedChoice
);
confIdList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
response
.
jsonPath
().
getList
(
"data"
)),
ConfIdList
.
class
);
System
.
out
.
println
(
confIdList
);
Assert
.
assertNotNull
(
confIdList
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_timedChoice
,
"定时投票列表查询失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看定时推送投票详情"
,
priority
=
50
)
public
void
查看定时推送投票详情
(){
@Test
(
description
=
"查看定时推送投票详情"
,
priority
=
50
)
public
void
查看定时推送投票详情
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"confId"
,
confIdList
.
get
(
0
).
getConfId
());
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_getDetail
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"confId"
,
confIdList
.
get
(
0
).
getConfId
());
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_getDetail
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_getDetail
,
"定时投票详情查询失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"删除定时投票"
,
priority
=
51
)
public
void
删除定时投票
(){
@Test
(
description
=
"删除定时投票"
,
priority
=
51
)
public
void
删除定时投票
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"confId"
,
confIdList
.
get
(
1
).
getConfId
());
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_timedChoiceDel
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"confId"
,
confIdList
.
get
(
1
).
getConfId
());
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_timedChoiceDel
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_timedChoiceDel
,
"定时投票删除失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"开启定时投票"
,
priority
=
52
)
public
void
开启定时投票
(){
@Test
(
description
=
"开启定时投票"
,
priority
=
52
)
public
void
开启定时投票
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"confStatus"
,
1
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_switchStatus1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"confStatus"
,
1
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_switchStatus1
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_switchStatus1
,
"定时投票开启失败"
,
response
.
body
().
asString
()));
...
...
@@ -1021,6 +1022,7 @@ public void 获取直播中停留时长宝箱列表() {
* 有奖答题配置
*/
public
int
rewardId
;
@Test
(
description
=
"添加答题现金红包"
,
priority
=
53
)
public
void
添加答题现金红包
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
...
...
@@ -1043,7 +1045,7 @@ public void 获取直播中停留时长宝箱列表() {
bean
.
setOptionList
(
Answers
);
Params
.
put
(
"questionConf"
,
bean
);
AddReward
redConf
=
new
AddReward
();
AddReward
redConf
=
new
AddReward
();
redConf
.
setAmount
(
100
);
redConf
.
setShowAmount
(
100
);
redConf
.
setNum
(
3
);
...
...
@@ -1070,7 +1072,7 @@ public void 获取直播中停留时长宝箱列表() {
bean1
.
setQuestionDetail
(
"答题现金红包1"
);
bean1
.
setOptionList
(
Answers1
);
addParam
.
put
(
"questionConf"
,
bean1
);
AddReward
redConf1
=
new
AddReward
();
AddReward
redConf1
=
new
AddReward
();
redConf1
.
setAmount
(
100
);
redConf1
.
setShowAmount
(
100
);
redConf1
.
setNum
(
3
);
...
...
@@ -1099,7 +1101,7 @@ public void 获取直播中停留时长宝箱列表() {
bean2
.
setQuestionDetail
(
"答题现金红包2"
);
bean2
.
setOptionList
(
Answers2
);
add1Param
.
put
(
"questionConf"
,
bean2
);
AddReward
redConf2
=
new
AddReward
();
AddReward
redConf2
=
new
AddReward
();
redConf2
.
setAmount
(
100
);
redConf2
.
setShowAmount
(
100
);
redConf2
.
setNum
(
3
);
...
...
@@ -1119,13 +1121,14 @@ public void 获取直播中停留时长宝箱列表() {
Response
rewardRes
=
network
.
getResponse
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
);
Object
data
=
rewardRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
RewardList
.
Reward_List
>
list
=
JsonUtil
.
parseResponseToListBean
(
rewardRes
,
RewardList
.
Reward_List
.
class
);
RewardList
.
Reward_List
reward
=
list
.
get
(
list
.
size
()
-
1
);
List
<
RewardList
.
Reward_List
>
list
=
JsonUtil
.
parseResponseToListBean
(
rewardRes
,
RewardList
.
Reward_List
.
class
);
RewardList
.
Reward_List
reward
=
list
.
get
(
list
.
size
()
-
1
);
boolean
red
=
reward
.
getQuesType
()
==
1
;
rewardId
=
reward
.
getId
();
rewardId
=
reward
.
getId
();
Assert
.
assertTrue
(
red
,
network
.
message
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
,
"获取答题现金红包配置失败"
,
rewardRes
.
body
().
asString
()));
}
@Test
(
description
=
"修改答题现金红包"
,
priority
=
55
)
public
void
修改答题现金红包
()
{
Map
<
String
,
Object
>
addParam
=
new
HashMap
<>();
...
...
@@ -1145,7 +1148,7 @@ public void 获取直播中停留时长宝箱列表() {
bean
.
setQuestionDetail
(
"答题现金红包"
);
bean
.
setOptionList
(
Answers
);
addParam
.
put
(
"questionConf"
,
bean
);
AddReward
redConf
=
new
AddReward
();
AddReward
redConf
=
new
AddReward
();
redConf
.
setAmount
(
100
);
redConf
.
setShowAmount
(
100
);
redConf
.
setNum
(
3
);
...
...
@@ -1236,8 +1239,8 @@ public void 获取直播中停留时长宝箱列表() {
Response
rewardRes
=
network
.
getResponse
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
);
Object
data
=
rewardRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
List
<
RewardList
.
Reward_List
>
list
=
JsonUtil
.
parseResponseToListBean
(
rewardRes
,
RewardList
.
Reward_List
.
class
);
RewardList
.
Reward_List
reward
=
list
.
get
(
list
.
size
()
-
1
);
List
<
RewardList
.
Reward_List
>
list
=
JsonUtil
.
parseResponseToListBean
(
rewardRes
,
RewardList
.
Reward_List
.
class
);
RewardList
.
Reward_List
reward
=
list
.
get
(
list
.
size
()
-
1
);
boolean
red
=
reward
.
getQuesType
()
==
2
;
Assert
.
assertTrue
(
red
,
network
.
message
(
rewardParam
,
BasicConfig
.
MANAGER_rewardList
,
"获取答题实物奖品失败"
,
rewardRes
.
body
().
asString
()));
...
...
@@ -1245,7 +1248,7 @@ public void 获取直播中停留时长宝箱列表() {
/**
*本场答题有奖规则:仅限1次
*
本场答题有奖规则:仅限1次
*/
@Test
(
description
=
"本场答题仅限1次规则"
,
priority
=
59
)
...
...
@@ -1270,16 +1273,16 @@ public void 获取直播中停留时长宝箱列表() {
Response
response
=
network
.
getResponse
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
);
Object
redPacketRuleType
=
response
.
jsonPath
().
getJsonObject
(
"data.redPacketRuleType"
);
System
.
out
.
println
(
redPacketRuleType
);
Assert
.
assertEquals
(
redPacketRuleType
,
2
,
network
.
message
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
,
"答题有奖红包限制1次"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
redPacketRuleType
,
2
,
network
.
message
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
,
"答题有奖红包限制1次"
,
response
.
body
().
asString
()));
Object
welfareRuleType
=
response
.
jsonPath
().
getJsonObject
(
"data.welfareRuleType"
);
System
.
out
.
println
(
welfareRuleType
);
Assert
.
assertEquals
(
welfareRuleType
,
2
,
network
.
message
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
,
"答题有奖红包限制1次"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
welfareRuleType
,
2
,
network
.
message
(
getConfParam
,
BasicConfig
.
MANAGER_getQuestionPrizesRule
,
"答题有奖红包限制1次"
,
response
.
body
().
asString
()));
}
/**
*有奖答题按团队分配奖品
*
有奖答题按团队分配奖品
*/
public
List
<
com
.
kjj
.
bean
.
manager
.
QuesReward
>
ListConfId
;
...
...
@@ -1301,8 +1304,8 @@ public void 获取直播中停留时长宝箱列表() {
public
void
获取答题按团队分配的团队列表
()
{
Map
<
String
,
Object
>
TeamParam
=
new
HashMap
<>();
TeamParam
.
put
(
"confId"
,
this
.
ListConfId
.
get
(
2
).
getId
());
TeamParam
.
put
(
"pageIndex"
,
1
);
TeamParam
.
put
(
"pageSize"
,
50
);
TeamParam
.
put
(
"pageIndex"
,
1
);
TeamParam
.
put
(
"pageSize"
,
50
);
Response
response
=
network
.
getResponse
(
TeamParam
,
BasicConfig
.
MANAGER_TeamAssignmentList
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
...
...
@@ -1315,11 +1318,11 @@ public void 获取直播中停留时长宝箱列表() {
Map
<
String
,
Object
>
addTeamParam
=
new
HashMap
<>();
addTeamParam
.
put
(
"confId"
,
this
.
ListConfId
.
get
(
2
).
getId
());
addTeamParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
addTeamParam
.
put
(
"teamIds"
,
Arrays
.
asList
(
4083
,
3324
,
3817
));
addTeamParam
.
put
(
"teamIds"
,
Arrays
.
asList
(
4083
,
3324
,
3817
));
Response
response
=
network
.
postResponse
(
addTeamParam
,
BasicConfig
.
MANAGER_addTeam
);
Object
failSize
=
response
.
jsonPath
().
getJsonObject
(
"data.failSize"
);
System
.
out
.
println
(
failSize
);
Assert
.
assertEquals
(
failSize
,
0
,
network
.
message
(
addTeamParam
,
BasicConfig
.
MANAGER_addTeam
,
"添加团队失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
failSize
,
0
,
network
.
message
(
addTeamParam
,
BasicConfig
.
MANAGER_addTeam
,
"添加团队失败"
,
response
.
body
().
asString
()));
}
...
...
@@ -1328,10 +1331,10 @@ public void 获取直播中停留时长宝箱列表() {
public
void
获取答题已分配的团队列表
()
{
Map
<
String
,
Object
>
TeamParam
=
new
HashMap
<>();
TeamParam
.
put
(
"confId"
,
this
.
ListConfId
.
get
(
2
).
getId
());
TeamParam
.
put
(
"pageIndex"
,
1
);
TeamParam
.
put
(
"pageSize"
,
50
);
TeamParam
.
put
(
"pageIndex"
,
1
);
TeamParam
.
put
(
"pageSize"
,
50
);
Response
response
=
network
.
getResponse
(
TeamParam
,
BasicConfig
.
MANAGER_TeamAssignmentList
);
List
<
TeamAssignmentList
.
team_List
>
list
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
response
.
jsonPath
().
get
(
"data.list"
)),
TeamAssignmentList
.
team_List
.
class
);
List
<
TeamAssignmentList
.
team_List
>
list
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
response
.
jsonPath
().
get
(
"data.list"
)),
TeamAssignmentList
.
team_List
.
class
);
System
.
out
.
println
(
list
);
this
.
teamID
=
list
;
Assert
.
assertNotNull
(
list
,
network
.
message
(
TeamParam
,
BasicConfig
.
MANAGER_TeamAssignmentList
,
"获取有奖答题列表信息失败"
,
response
.
body
().
asString
()));
...
...
@@ -1342,7 +1345,7 @@ public void 获取直播中停留时长宝箱列表() {
public
void
单个团队删除
()
{
Map
<
String
,
Object
>
TeamParam
=
new
HashMap
<>();
TeamParam
.
put
(
"confId"
,
this
.
ListConfId
.
get
(
2
).
getId
());
TeamParam
.
put
(
"id"
,
this
.
teamID
.
get
(
0
).
getId
());
TeamParam
.
put
(
"id"
,
this
.
teamID
.
get
(
0
).
getId
());
Response
response
=
network
.
postResponse
(
TeamParam
,
BasicConfig
.
MANAGER_delTeam
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
...
...
@@ -1370,7 +1373,7 @@ public void 获取直播中停留时长宝箱列表() {
Response
response
=
network
.
postResponse
(
addTeamParam
,
BasicConfig
.
MANAGER_addTeam
);
Object
failSize
=
response
.
jsonPath
().
getJsonObject
(
"data.failSize"
);
System
.
out
.
println
(
failSize
);
Assert
.
assertEquals
(
failSize
,
0
,
network
.
message
(
addTeamParam
,
BasicConfig
.
MANAGER_addTeam
,
"添加指定中奖团队失败"
,
response
.
body
().
asString
()));
Assert
.
assertEquals
(
failSize
,
0
,
network
.
message
(
addTeamParam
,
BasicConfig
.
MANAGER_addTeam
,
"添加指定中奖团队失败"
,
response
.
body
().
asString
()));
}
...
...
@@ -1393,14 +1396,14 @@ public void 获取直播中停留时长宝箱列表() {
@Test
(
description
=
"保存翻牌配置"
,
priority
=
69
)
public
void
保存翻牌配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"withdrawalAmount"
,
100
);
Params
.
put
(
"withdrawalCondition"
,
1
);
Params
.
put
(
"withdrawalNum"
,
1
);
Params
.
put
(
"invitePresentNum"
,
1
);
Params
.
put
(
"initPresentNum"
,
10
);
Params
.
put
(
"imgUrl"
,
"https://yun.dui88.com/kjy/image/20210608/1623132676884.jpg"
);
Params
.
put
(
"secondImgUrl"
,
"https://yun.dui88.com/kjy/image/20210608/1623132676884.jpg"
);
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"withdrawalAmount"
,
100
);
Params
.
put
(
"withdrawalCondition"
,
1
);
Params
.
put
(
"withdrawalNum"
,
1
);
Params
.
put
(
"invitePresentNum"
,
1
);
Params
.
put
(
"initPresentNum"
,
10
);
Params
.
put
(
"imgUrl"
,
"https://yun.dui88.com/kjy/image/20210608/1623132676884.jpg"
);
Params
.
put
(
"secondImgUrl"
,
"https://yun.dui88.com/kjy/image/20210608/1623132676884.jpg"
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_card
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
...
...
@@ -1411,7 +1414,7 @@ public void 获取直播中停留时长宝箱列表() {
@Test
(
description
=
"查看直播翻牌配置详情"
,
priority
=
70
)
public
void
查看直播翻牌配置详情
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_cardDetail
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
...
...
@@ -1423,8 +1426,8 @@ public void 获取直播中停留时长宝箱列表() {
@Test
(
description
=
"开启翻牌配置"
,
priority
=
71
)
public
void
开启翻牌配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"confStatus"
,
1
);
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"confStatus"
,
1
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_switch
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
...
...
@@ -1435,7 +1438,7 @@ public void 获取直播中停留时长宝箱列表() {
@Test
(
description
=
"查看直播配置"
,
priority
=
72
)
public
void
查看直播配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_getConfDetail
);
boolean
cardConfBuildStatus
=
response
.
jsonPath
().
getBoolean
(
"data.cardConfBuildStatus"
);
System
.
out
.
println
(
cardConfBuildStatus
);
...
...
@@ -1446,10 +1449,64 @@ public void 获取直播中停留时长宝箱列表() {
Assert
.
assertTrue
(
cardConfStatus
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_getConfDetail
,
"未开启翻牌"
,
response
.
body
().
asString
()));
}
/**
* 直播中过渡视频
*/
@Test
(
description
=
"直播间过渡视频配置"
,
priority
=
73
)
public
void
直播间过渡视频配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"transitionVideoUrl"
,
"https://yun.dui88.com/kjy/media/file/20210619/bb4a63f026ee228ad99b2367cfa83229.mp4"
);
Params
.
put
(
"videoDelayTime"
,
5
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_confCaveOrUpdate
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_confCaveOrUpdate
,
"直播间过渡视频保存失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"直播间过渡视频配置详情"
,
priority
=
74
)
public
void
直播间过渡视频配置详情
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_videoDetail
);
Object
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_videoDetail
,
"查询直播间过渡视频配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"开启直播间过渡视频配置"
,
priority
=
75
)
public
void
开启直播间过渡视频配置
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"videoConfStatus"
,
1
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_videoSwitch
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_videoSwitch
,
"开启直播间过渡视频配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查看直播基础配置详情"
,
priority
=
76
)
public
void
查看直播基础配置详情
()
{
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
Params
,
BasicConfig
.
MANAGER_getConfDetail
);
boolean
transitionVideoConfBuildStatus
=
response
.
jsonPath
().
getBoolean
(
"data.transitionVideoConfBuildStatus"
);
System
.
out
.
println
(
transitionVideoConfBuildStatus
);
Assert
.
assertTrue
(
transitionVideoConfBuildStatus
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_getConfDetail
,
"未配置翻牌"
,
response
.
body
().
asString
()));
boolean
transitionVideoConfStatus
=
response
.
jsonPath
().
getBoolean
(
"data.transitionVideoConfStatus"
);
System
.
out
.
println
(
transitionVideoConfStatus
);
Assert
.
assertTrue
(
transitionVideoConfStatus
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_getConfDetail
,
"未开启翻牌"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/liveConfig/Share.java
View file @
227640f7
...
...
@@ -24,7 +24,7 @@ public class Share implements AdminAuthorization {
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"mpShareUrl"
,
"//yun.dui88.com/kjy/image/20210526/1622022856685.jpeg"
);
Params
.
put
(
"mpShareTitle"
,
"
「
{{welfareName}}」常规分享文案{{name}}"
);
Params
.
put
(
"mpShareTitle"
,
"{{welfareName}}」常规分享文案{{name}}"
);
Params
.
put
(
"shareType"
,
1
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_saveOrUpdateMpShare
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
...
...
src/test/java/com/kjj/cases/live/liveConfig/Video.java
0 → 100644
View file @
227640f7
package
com
.
kjj
.
cases
.
live
.
liveConfig
;
import
com.kjj.bean.manager.VideoBean
;
import
com.kjj.cases.live.admin.AdminAuthorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.JsonUtil
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
Video
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
BaseUtils
.
ssoLogin
();
}
/**
* 精彩视频
*/
public
List
<
VideoBean
>
VideoId
;
@Test
(
description
=
"新增视频"
,
priority
=
1
)
public
void
新增视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"companyId"
,
101
);
params
.
put
(
"videoUrl"
,
"//yun.dui88.com/kjy/media/file/20210414/b3fc43806a190d56ca4ba57a9a1fef8e.mp4"
);
params
.
put
(
"videoTitle"
,
"精彩视频"
);
params
.
put
(
"videoFirstImg"
,
"//yun.dui88.com/kjy/image/20210414/1618384473776.jpg"
);
params
.
put
(
"shareImageUrl"
,
"//yun.dui88.com/kjy/image/20210414/1618384473776.jpg"
);
params
.
put
(
"videoScreen"
,
1
);
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_SaveOrUpdate
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_SaveOrUpdate
,
"新增视频失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"获取视频列表"
,
priority
=
2
)
public
void
获取视频列表
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"companyId"
,
101
);
params
.
put
(
"pageIndex"
,
1
);
params
.
put
(
"pageSize"
,
10
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoList
);
List
<
VideoBean
>
list
=
JsonUtil
.
parseResponseToPageBean
(
response
,
VideoBean
.
class
);
this
.
VideoId
=
list
;
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoList
,
"获取视频列表失败"
,
response
.
body
().
asString
()));
}
//置顶视频
@Test
(
description
=
"置顶视频"
,
priority
=
3
)
public
void
置顶视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
this
.
VideoId
.
get
(
0
).
getId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoTop
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoTop
,
"置顶视频失败"
,
response
.
body
().
asString
()));
}
//取消置顶视频
@Test
(
description
=
"取消置顶视频"
,
priority
=
4
)
public
void
取消置顶视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
this
.
VideoId
.
get
(
0
).
getId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoCancelTopt
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoCancelTopt
,
"取消置顶视频失败"
,
response
.
body
().
asString
()));
}
//上移视频
@Test
(
description
=
"上移视频"
,
priority
=
5
)
public
void
上移视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
this
.
VideoId
.
get
(
0
).
getId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoUp
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoUp
,
"上移视频失败"
,
response
.
body
().
asString
()));
}
//下移视频
@Test
(
description
=
"下移视频"
,
priority
=
6
)
public
void
下移视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
this
.
VideoId
.
get
(
0
).
getId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoDown
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoDown
,
"下移视频失败"
,
response
.
body
().
asString
()));
}
//删除视频
@Test
(
description
=
"删除视频"
,
priority
=
7
)
public
void
删除视频
()
{
BaseUtils
.
ssoLogin
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
this
.
VideoId
.
get
(
0
).
getId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MANAGER_CompanyVideoDelete
);
boolean
success
=
response
.
jsonPath
().
getBoolean
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
params
,
BasicConfig
.
MANAGER_CompanyVideoDelete
,
"删除视频失败"
,
response
.
body
().
asString
()));
}
}
src/test/java/com/kjj/config/BasicConfig.java
View file @
227640f7
...
...
@@ -31,7 +31,7 @@ public class BasicConfig {
//直播访客 (熊二)ID:719
public
static
String
VISITORKEY7
=
"LEH7epeHVDJWzhZ6DiexTHnfZVkhkqorGGQahRL1y3zwSbNpp1aULAhVJCfFh6cujPTXfQ99d2qDCrKPgSvwrQ6diTkZR"
;
//直播访客 (熊大)ID:946
public
static
String
VISITORKEY8
=
"
LEH7epeHVDJWzhZ6DiexTHnfZVkhkqorGGQahRpVDVGzx7dWtF6qSrZH5EJcyPAQVSdjBa8ioSjRfJzdwoh73PR5jksrE
"
;
public
static
String
VISITORKEY8
=
"
2Tsc8MwHZmXJKPfze38rXm37UEbpakoFFxPjXnhCqixY2dghFrfLxdsKoqHrPNabbQxNUSStUGGBirKk993ogwuBZqKgm9C
"
;
//直播访客 (日落)ID:703
public
static
String
VISITORKEY10
=
"LEH7epeHVDJWzhZ6DiexTHnsaP1qQoaA7tAWpG56Y1NNQvM7gfDV7k263cKpHrAnmSrXY1MMhficzJT8UftKVVeobhNQH"
;
//直播访客 (小四)ID:108
...
...
@@ -107,6 +107,10 @@ public class BasicConfig {
public
static
final
String
MOBILE_withdrawalResult
=
MOBILE_HOST
+
"/kjy/live/flip/card/withdrawalResult"
;
public
static
final
String
MOBILE_withdrawalRecord
=
MOBILE_HOST
+
"/kjy/live/flip/card/withdrawalRecord"
;
// *************** 直播间过渡视频 ***************
public
static
final
String
MANAGER_confCaveOrUpdate
=
MANAGER_HOST
+
"/kjy/manager/live/trans/video/conf/saveOrUpdate"
;
public
static
final
String
MANAGER_videoSwitch
=
MANAGER_HOST
+
"/kjy/manager/live/trans/video/conf/status/switch"
;
public
static
final
String
MANAGER_videoDetail
=
MANAGER_HOST
+
"/kjy/manager/live/trans/video/conf/detail"
;
// *************** 猜数字红包 ***************
public
static
final
String
MANAGER_getSurplusAmount
=
MANAGER_HOST
+
"/kjy/manager/red/conf/getSurplusAmount"
;
...
...
@@ -128,10 +132,6 @@ public class BasicConfig {
public
static
final
String
MOBILE_guess
=
MOBILE_HOST
+
"/clue/guess/number/red/guess"
;
public
static
final
String
MOBILE_open
=
MOBILE_HOST
+
"/clue/guess/number/red/open"
;
public
static
final
String
MOBILE_result
=
MOBILE_HOST
+
"/clue/guess/number/red/result"
;
// public static final String MOBILE_ = MOBILE_HOST + "";
// public static final String MOBILE_ = MOBILE_HOST + "";
// public static final String MOBILE_ = MOBILE_HOST + "";
// *************** 宝箱裂变 ***************
public
static
final
String
MANAGER_getList4Admin
=
MANAGER_HOST
+
"/kjy/manager/welfare/pre/conf/getList4Admin"
;
...
...
@@ -270,6 +270,28 @@ public class BasicConfig {
public
static
final
String
MOBILE_VideoWatch
=
MOBILE_HOST
+
"/kjy/live/company/video/watch"
;
public
static
final
String
MOBILE_VideoLike
=
MOBILE_HOST
+
"/kjy/live/company/video/like"
;
public
static
final
String
MOBILE_LiveGuideList
=
MOBILE_HOST
+
"/kjy/live/guide/list"
;
public
static
final
String
MOBILE_userInfo1
=
MOBILE_HOST
+
"/kjy/live/userInfo"
;
public
static
final
String
MOBILE_isForbidden
=
MOBILE_HOST
+
"/kjy/live/share/isForbidden"
;
public
static
final
String
MOBILE_wxIdAllList
=
MOBILE_HOST1
+
"/kjy/mp/msg/config/live/user/wxIdAllList"
;
public
static
final
String
MOBILE_listDetail
=
MOBILE_HOST
+
"/kjy/live/guide/list/detail"
;
public
static
final
String
MOBILE_feedbackSave
=
MOBILE_HOST
+
"/kjy/live/user/feedback/save"
;
public
static
final
String
MOBILE_agentInfo
=
MOBILE_HOST
+
"/kjy/live/share/help/agent/info"
;
//排行榜
public
static
final
String
MOBILE_allRewardList
=
MOBILE_HOST
+
"/kjy/live/reward/allRewardList"
;
public
static
final
String
MOBILE_companyTotalData
=
MOBILE_HOST
+
"/kjy/live/team/companyTotalData"
;
public
static
final
String
MOBILE_ownTeamCharts
=
MOBILE_HOST
+
"/kjy/live/team/ownTeamCharts"
;
public
static
final
String
MOBILE_ownChartsInTeam
=
MOBILE_HOST
+
"/kjy/live/agent/ownChartsInTeam"
;
public
static
final
String
MANAGER_CompanyVideoList
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/list"
;
public
static
final
String
MANAGER_SaveOrUpdate
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/saveOrUpdate"
;
public
static
final
String
MANAGER_CompanyVideoTop
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/top"
;
public
static
final
String
MANAGER_CompanyVideoCancelTopt
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/cancelTop"
;
public
static
final
String
MANAGER_CompanyVideoUp
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/up"
;
public
static
final
String
MANAGER_CompanyVideoDown
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/down"
;
public
static
final
String
MANAGER_CompanyVideoDelete
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/delete"
;
//查询资料列表//
public
static
final
String
MOBILE_Resource
=
MOBILE_HOST
+
"/clue/resource/list"
;
...
...
@@ -286,7 +308,7 @@ public class BasicConfig {
public
static
final
String
MOBILE_ResourceTestDetail
=
MOBILE_HOST
+
"/clue/resource/test/detail"
;
public
static
final
String
MOBILE_ResourceTestParticipate
=
MOBILE_HOST
+
"/clue/resource/test/participate"
;
public
static
final
String
MOBILE_ResourceTestSubmit
=
MOBILE_HOST
+
"/clue/resource/test/submit"
;
public
static
final
String
MOBILE_GetAgentPoster
Info
=
MOBILE_HOST
+
"/kjy/live/share/getAgentPosterInfo
"
;
public
static
final
String
MOBILE_GetAgentPoster
V2
=
MOBILE_HOST
+
"/kjy/live/share/getAgentPosterInfo/v2
"
;
public
static
final
String
MOBILE_GETSHARESIGN
=
MOBILE_HOST
+
"/kjy/live/getShareSign"
;
public
static
final
String
MOBILE_binding
=
MOBILE_HOST
+
"/clue/invitation/binding"
;
public
static
final
String
MOBILE_Token
=
MOBILE_HOST
+
"/clue/invitation/token"
;
...
...
@@ -586,13 +608,6 @@ public class BasicConfig {
public
static
final
String
MANAGER_PROMOTIONCODELIST
=
MANAGER_HOST
+
"/kjy/manager/promotionCode/codeList"
;
public
static
final
String
MANAGER_PROMOTIONBATCHMODIFY
=
MANAGER_HOST
+
"/kjy/manager/promotionCode/batchModify"
;
public
static
final
String
MANAGER_PROMOTIONCODEBATCHDETAIL
=
MANAGER_HOST
+
"/kjy/manager/promotionCode/batchDetail"
;
public
static
final
String
MANAGER_CompanyVideoList
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/list"
;
public
static
final
String
MANAGER_SaveOrUpdate
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/saveOrUpdate"
;
public
static
final
String
MANAGER_CompanyVideoTop
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/top"
;
public
static
final
String
MANAGER_CompanyVideoCancelTopt
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/cancelTop"
;
public
static
final
String
MANAGER_CompanyVideoUp
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/up"
;
public
static
final
String
MANAGER_CompanyVideoDown
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/down"
;
public
static
final
String
MANAGER_CompanyVideoDelete
=
MANAGER_HOST
+
"/kjy/manager/live/company/video/delete"
;
}
src/test/liveTestNG.xml
View file @
227640f7
...
...
@@ -13,12 +13,24 @@
</classes>
</test>
<test
preserve-order=
"true"
name=
"精彩视频"
>
<classes>
<class
name=
"com.kjj.cases.live.liveConfig.Video"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"创建直播"
>
<classes>
<class
name=
"com.kjj.cases.live.liveConfig.SaveLive"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"代理人首页"
>
<classes>
<class
name=
"com.kjj.cases.live.agent.Agent"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"小程序分享"
>
<classes>
<class
name=
"com.kjj.cases.live.liveConfig.Share"
/>
...
...
@@ -37,11 +49,6 @@
</classes>
</test>
<test
preserve-order=
"true"
name=
"宝箱裂变"
>
<classes>
<class
name=
"com.kjj.cases.live.treasure.Treasure"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"中奖规则配置"
>
<classes>
...
...
@@ -49,12 +56,6 @@
</classes>
</test>
<test
preserve-order=
"true"
name=
"代理人首页"
>
<classes>
<class
name=
"com.kjj.cases.live.agent.Procurator"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"指定中奖"
>
<classes>
...
...
@@ -82,6 +83,12 @@
</classes>
</test>
<test
preserve-order=
"true"
name=
"宝箱裂变"
>
<classes>
<class
name=
"com.kjj.cases.live.treasure.Treasure"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"直播中抽奖"
>
<classes>
<class
name=
"com.kjj.cases.live.lottery.Lottery"
/>
...
...
@@ -105,11 +112,11 @@
<class
name=
"com.kjj.cases.live.anchor.LiveVisitors"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"获取代理人排行榜及客户信息"
>
<classes
>
<class
name=
"com.kjj.cases.live.agent.LiveAgent"
/
>
</classes
>
</test
>
<!-- <test preserve-order="true" name="获取代理人排行榜及客户信息">--
>
<!-- <classes>--
>
<!-- <class name="com.kjj.cases.live.agent.LiveAgent"/>--
>
<!-- </classes>--
>
<!-- </test>--
>
<test
preserve-order=
"true"
name=
"红包领取"
>
<classes>
...
...
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