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
75edbf86
Commit
75edbf86
authored
Sep 28, 2021
by
龚小红
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Feature/20210926-gxh' into 'master'
开启直播前增加校验是否有直播场次未结束 See merge request test-group/kejiji!131
parents
a73cfae3
bc45e333
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
4 deletions
+47
-4
OpenLive.java
src/test/java/com/kjj/cases/live/anchor/OpenLive.java
+47
-3
SaveLive.java
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
+0
-1
No files found.
src/test/java/com/kjj/cases/live/anchor/OpenLive.java
View file @
75edbf86
...
...
@@ -3,19 +3,63 @@ import com.kjj.cases.admin.Authorization;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.ThreadSleepUtils
;
import
com.sun.org.apache.xalan.internal.xsltc.trax.XSLTCSource
;
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.Map
;
import
static
com
.
kjj
.
utils
.
BaseUtils
.
ssoLogin
;
public
class
OpenLive
implements
Authorization
{
@BeforeClass
public
void
setUp
()
{
ssoLogin
();
}
@Test
(
description
=
"结束直直播中或断流中的场次"
,
priority
=
1
)
public
void
结束直直播中或断流中的场次
()
{
int
totalCount2
=
0
;
long
liveid
=
0L
;
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
ConfDetailParam
.
put
(
"companyId"
,
101
);
ConfDetailParam
.
put
(
"liveStatus"
,
3
);
ConfDetailParam
.
put
(
"sort"
,
2
);
ConfDetailParam
.
put
(
"liveType"
,
1
);
ConfDetailParam
.
put
(
"pageIndex"
,
1
);
ConfDetailParam
.
put
(
"pageSize"
,
1
);
Response
ConfDetailRes
=
network
.
getResponse
(
ConfDetailParam
,
BasicConfig
.
MANAGER_liveList
);
System
.
out
.
println
(
ConfDetailRes
.
body
().
asString
());
int
totalCount1
=
ConfDetailRes
.
jsonPath
().
getInt
(
"data.totalCount"
);
if
(
totalCount1
==
0
){
ConfDetailParam
.
put
(
"liveStatus"
,
2
);
ConfDetailRes
=
network
.
getResponse
(
ConfDetailParam
,
BasicConfig
.
MANAGER_liveList
);
System
.
out
.
println
(
ConfDetailRes
.
body
().
asString
());
totalCount2
=
ConfDetailRes
.
jsonPath
().
getInt
(
"data.totalCount"
);
if
(
totalCount2
==
1
)
{
System
.
out
.
println
(
"有一场直播正在直播中"
);
liveid
=
ConfDetailRes
.
jsonPath
().
getLong
(
"data.list.get(0).id"
);
}
}
else
{
System
.
out
.
println
(
"有一场直播正在断流中"
);
liveid
=
ConfDetailRes
.
jsonPath
().
getLong
(
"data.list.get(0).id"
);
}
if
(
totalCount1
==
1
||
totalCount2
==
1
){
adminAuth
();
Map
<
String
,
Object
>
closeParam
=
new
HashMap
<>();
closeParam
.
put
(
"liveid"
,
liveid
);
closeParam
.
put
(
"cid"
,
101
);
Response
closeRes
=
network
.
postResponse
(
closeParam
,
BasicConfig
.
ANCHOR_CLOSE
);
Object
data
=
closeRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
closeParam
,
BasicConfig
.
ANCHOR_CLOSE
,
"结束直播失败"
,
closeRes
.
body
().
asString
()));
}
@Test
(
description
=
"获取直播配置详情"
,
priority
=
1
)
}
@Test
(
description
=
"获取直播配置详情"
,
priority
=
2
)
public
void
获取直播配置详情
()
{
Map
<
String
,
Object
>
ConfDetailParam
=
new
HashMap
<>();
ConfDetailParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
...
...
@@ -26,7 +70,7 @@ public class OpenLive implements Authorization {
}
@Test
(
description
=
"开始直播"
,
priority
=
2
)
@Test
(
description
=
"开始直播"
,
priority
=
3
)
public
void
开启直播
()
{
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
...
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
View file @
75edbf86
...
...
@@ -819,7 +819,6 @@ public class SaveLive implements Authorization {
boolean
hasGuessRed
=
response
.
jsonPath
().
getBoolean
(
"data.hasGuessRed"
);
System
.
out
.
println
(
hasGuessRed
);
Assert
.
assertTrue
(
hasGuessRed
,
network
.
message
(
listParam
,
BasicConfig
.
MOBILE_findDetail
,
"助播端查询直播红包配置失败"
,
response
.
body
().
asString
()));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment